# Global Tutors Premium - Developer Handbook & Handover Guide

Welcome to the Global Tutors Premium technical manual. This document is designed to provide a complete overview of the platform's architecture, database structure, and maintenance procedures to ensure long-term stability and scalability.

## 1. Technology Stack
The platform is built using industry-standard technologies to ensure maximum compatibility and ease of hiring future developers:
- **Frontend**: Pure HTML5, CSS3, and Vanilla JavaScript (ES6+).
- **Backend/Database**: Google Firebase (Firestore, Authentication, Hosting).
- **Icons**: FontAwesome 6.4.0.
- **Hosting**: Firebase Hosting (Global CDN).

---

## 2. File Structure Overview
- `index.html`: The main landing page and educator marketplace.
- `app.js`: Central application logic, Firebase initialization, and global auth handling.
- `student-auth.html`: Unified authentication portal for both Students and Teachers.
- `teacher-dashboard.html`: Secure dashboard for educators to manage their profile and wallet.
- `profile.html`: Dynamic profile page that loads educator data based on URL parameters (`?id=UID`).
- `admin.html`: The command center for the platform owner (Sooraj).
- `style.css`: Centralized design system and premium UI components.

---

## 3. Database Schema (Firestore)
The platform uses four primary collections in Firestore:

### `teachers`
Stores educator profiles.
- `name`, `email`, `photo`, `bio`, `tagline`, `subjects`, `fee`.
- `coinBalance`: Integer for the internal wallet system.
- `verified`: `0` (Unverified), `1` (Pending), `2` (Verified).
- `blocked`: Boolean (true/false) to restrict access.
- `edit_disabled`: Boolean to lock the teacher's profile from self-editing.

### `requirements` (Student Leads)
Stores student requests.
- `subject`, `mode`, `details`, `budget`, `studentName`, `studentId`.
- `unlockedBy`: Array of Teacher UIDs who have paid to view this lead.

### `messages`
Stores private conversations.
- `senderId`, `receiverId`, `text`, `timestamp`, `read`.

---

## 4. Maintenance & Operations

### How to Deploy Updates
When changes are made to the local files, use the following terminal command to push them live:
```powershell
npx firebase deploy
```

### Managing Admin Access
The Admin Panel (`admin.html`) is restricted to the email: `soorajsinger@gmail.com`. To change the admin or add more moderators, update the `adminEmail` constant in the `<script>` section of `admin.html`.

### SEO Management
- **Global SEO**: Managed in the `<head>` section of `index.html`.
- **Dynamic SEO**: Managed in `profile.html` via the `renderFullProfile` function which updates `document.title` and meta tags based on the tutor's data.

---

## 5. Security Best Practices
- **Rules**: Ensure Firestore Security Rules are set to `allow read, write: if request.auth != null;` for most collections to prevent unauthorized data access.
- **API Keys**: The Firebase config is public in `app.js`, but access is restricted via **Domain Whitelisting** in the Firebase Console (Settings > Authorized Domains).

---

## 6. Project Philosophy
This project was built with a "Pro-Custom" approach. Unlike Wix or WordPress, every line of code is optimized for speed and SEO. Any developer proficient in JavaScript will be able to scale this academy to thousands of teachers without platform restrictions.

**Generated by Antigravity AI (Google DeepMind)**
*Last Updated: April 2026*
