TrainingCenter

AC & DC Technical Institute - Developer & AI Integration Guide

Welcome to the central developer documentation for the AC & DC Technical Institute application.

For Developers: If you need an AI agent to build a new feature, modify the database schema, or alter the UI design language, update this document first. Outline the new feature or architecture here, and simply instruct the AI: “Read DEVELOPER_GUIDE.md and implement the architectural changes defined within.” The AI will read this file and construct the code accordingly.


🏗️ 1. Architecture Overview

The application is built on a modern, React-based web stack designed for real-time reactivity, comprehensive SEO routing, and robust serverless deployment.

flowchart TB
    %% Styling Classes
    classDef frontend fill:#0ea5e9,stroke:#0369a1,stroke-width:2px,color:#fff,rx:5px,ry:5px
    classDef firebase fill:#f59e0b,stroke:#b45309,stroke-width:2px,color:#fff,rx:5px,ry:5px
    classDef api fill:#10b981,stroke:#047857,stroke-width:2px,color:#fff,rx:5px,ry:5px
    classDef db fill:#8b5cf6,stroke:#6d28d9,stroke-width:2px,color:#fff,rx:5px,ry:5px

    %% Architecture Nodes
    subgraph Frontend["Frontend Client (Next.js 16)"]
        direction TB
        UI["Tailwind CSS v4 & shadcn/ui"]
        Pages["App / Pages Router"]
        Portals["Public | Student | Admin Portals"]
    end

    subgraph BackendServices["Backend Services"]
        direction LR
        subgraph Firebase["Firebase (BaaS)"]
            Auth["Firebase Auth\n(Identity & Roles)"]
            Firestore[("Firestore NoSQL\n(Real-time Database)")]
        end
        
        subgraph InternalAPI["Next.js Server API"]
            Mailer["/api/send-otp\n(NodeMailer SMTP)"]
        end
    end

    %% Data Flow Connections
    Portals -->|"Authenticates (Email/Pass)"| Auth
    Portals <-->|"CRUD & Real-time Listeners\n(onSnapshot)"| Firestore
    Portals -->|"Requests OTP / Approvals"| Mailer
    
    %% Apply Styling
    Frontend:::frontend
    Auth:::firebase
    Firestore:::db
    InternalAPI:::api

🗄️ 2. Database Connectivity & Data Models (Firebase Firestore)

The application uses Firebase Firestore as its primary NoSQL database. Connection initialization sits in src/firebase.js.

Core Collections:

  1. users: Contains all registered user profiles (Students and Admins).
    • Key Fields: uid, email, role, profilePhotoUrl (stored natively as Base64), aadhar, pan, passport.
  2. courses: The master list of available institute offerings.
    • Key Fields: id, name, duration, image (URL), details (array of sub-topics).
  3. certificates: Issued certificates confirming course completion.
    • Key Fields: certificateId (unique alphanumeric), studentEmail, courseId, marks (Object mapping subject names to obtained/max marks), issueDate.
  4. enrollmentRequests: Mid-tier collection tracking student requests to join unassigned courses.
    • Key Fields: studentEmail, courseId, status (‘pending’, ‘approved’, ‘denied’).
  5. instructors: Faculty directory.
    • Key Fields: id, name, department, image (Base64 string < 500KB), assignedCourses (Array).

🎨 3. Design Patterns & UI/UX Standards

The visual identity of the platform prioritizes accessibility, mobile responsiveness, and modern web aesthetics.


🔌 4. APIs, Server Actions, & Integrations

The system integrates directly with external services using internal API routes to mask credentials securely.

Custom API Routes:

Third-Party Utility Integrations:


🤖 5. How to Instruct the AI Agent

If you are a developer looking to expand the system, follow this sequence:

  1. Define the Change Here: Scroll up to the relevant section (e.g., ‘Core Collections’) and update it. (e.g., Add a new payments collection definition).
  2. Define the UI Consequence: Update the ‘Design Patterns’ specifying how the new feature should look.
  3. Prompt the AI: In your chat interface, say:

    “I have updated DEVELOPER_GUIDE.md with a new payments collection and a Payment History dashboard table requirement. Read the guide and implement the entire feature across the Next.js frontend and Firebase backend according to the updated specs.”

  4. Review: The AI will parse this document, understand the architectural constraints (shadcn, real-time snapshot listeners, dark mode compatibility), and generate context-accurate code.
  5. AI Self-Correction: When the AI finishes modifying the codebase, it is explicitly instructed to re-read and update this DEVELOPER_GUIDE.md to ensure the documentation perfectly mirrors the new reality of the codebase.