# CloudVault 2.0 – Web Application Setup Guide

The CloudVault 2.0 Web Application is a modern single-page application built with **React 18**, **TypeScript**, **Tailwind CSS**, and **Vite**.

---

## 🛠️ Prerequisites
- Node.js `v18+` or `v20+` (tested on Node `v24.18.0`)
- npm `v9+` or `v11+`

---

## 💻 Running the Web App in Development

1. Navigate to the `web/` directory:
```bash
cd web
```

2. Install dependencies:
```bash
npm install
```

3. Start Vite development server:
```bash
npm run dev
```
The application will launch on `http://localhost:5173`.
Vite is pre-configured to proxy `/api` and `/health` requests to the Flask backend running on `http://localhost:5000`.

---

## 📦 Building for Production

To compile production-optimized static assets:
```bash
cd web
npm run build
```
This produces the bundled JavaScript, CSS, and HTML files in `web/dist/`.

> **Note:** The Flask backend (`backend/app.py`) automatically serves the compiled `web/dist/` bundle at the root URL (`http://localhost:5000/` and `http://<LAN_IP>:5000/`), enabling zero-configuration web access directly from laptop and mobile browsers.

---

## 📱 Web Features Overview
- **Landing Page (`/`):** Showcase of cloud-first architecture and download links.
- **Login (`/login`):** JWT token authentication with multi-device session support.
- **Register (`/register`):** Instant registration with deterministic UUIDv5 ID.
- **Dashboard (`/dashboard`):** Real-time Google Drive quota breakdown, stat cards, and recent files.
- **My Files (`/files`):** Search, sort, filter by category (Photos, Videos, Docs), and download cloud files.
- **Upload Files (`/upload-files`):** Multi-file drag-and-drop uploader from laptop browser.
- **Upload Folder (`/upload-folder`):** Batch folder directory upload preserving directory names.
- **Connected Accounts (`/accounts`):** Link Google accounts, manage targets, and toggle active backup destination.
- **Storage Management (`/storage`):** Quota visualization and safety reserve buffer configuration.
- **Backup History (`/history`):** Complete chronological audit trail with source device attribution.
- **Connected Devices (`/devices`):** View active devices (Android phones, laptops) with one-click revoke.
- **Settings (`/settings`):** Network constraints, auto-backup rules, and quality options.
- **Profile (`/profile`):** View UUIDv5 credentials and reset passwords.
