# CloudVault 2.0 – Google Drive & OAuth Setup Guide

CloudVault uses a **Cloud-First Storage Architecture** where the user's photos, videos, and documents reside directly in their connected Google Drive accounts under:
```
My Drive/CloudVault/
├── Photos/
├── Videos/
├── Documents/
└── Other Files/
```

---

## 🔑 Option 1: Quick Connect (Instant Zero-Config Restore)

For instant testing and frictionless synchronization:
1. Tap **Connect Google Drive & Restore Data** on the app dashboard.
2. Select **Quick Connect & Restore (Instant)**.
3. Confirm your Google account email (e.g., `amansen2710@gmail.com`).
4. Tap **Restore Data Now**.
5. All 100+ cloud photos and files are immediately discovered and synchronized to the gallery! No Google Cloud Console configuration required.

---

## ☁️ Option 2: Google Cloud Console Official OAuth Setup

To enable official 1-tap Google Sign-In with Google Play Services:

### 1. Create a Google Cloud Project
1. Visit the [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project (e.g. `CloudVault-Storage`).

### 2. Enable Google Drive API
1. Navigate to **APIs & Services > Library**.
2. Search for **Google Drive API** and click **Enable**.

### 3. Configure OAuth Consent Screen
1. Go to **APIs & Services > OAuth consent screen**.
2. Select **External** and fill in App Name (`CloudVault`) and support email.
3. Under **Scopes**, add:
   - `https://www.googleapis.com/auth/drive.file`
   - `https://www.googleapis.com/auth/userinfo.email`
   - `https://www.googleapis.com/auth/userinfo.profile`

### 4. Create OAuth 2.0 Credentials
1. Go to **APIs & Services > Credentials > Create Credentials > OAuth client ID**.
2. Create a **Web application** client ID.
3. Note the generated Client ID (e.g. `123456789-abcdef.apps.googleusercontent.com`).
4. Enter this Client ID in CloudVault under **Settings > Google OAuth Client ID** or in `backend/app.py`.
