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.
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
pages/ or app/ router boundaries defined in the root directory.onSnapshot listeners.The application uses Firebase Firestore as its primary NoSQL database. Connection initialization sits in src/firebase.js.
users: Contains all registered user profiles (Students and Admins).
uid, email, role, profilePhotoUrl (stored natively as Base64), aadhar, pan, passport.courses: The master list of available institute offerings.
id, name, duration, image (URL), details (array of sub-topics).certificates: Issued certificates confirming course completion.
certificateId (unique alphanumeric), studentEmail, courseId, marks (Object mapping subject names to obtained/max marks), issueDate.enrollmentRequests: Mid-tier collection tracking student requests to join unassigned courses.
studentEmail, courseId, status (‘pending’, ‘approved’, ‘denied’).instructors: Faculty directory.
id, name, department, image (Base64 string < 500KB), assignedCourses (Array).enrollmentRequests, certificates, and notifications (where studentId or userId matches) must be removed in a single batch operation alongside the student document.onSnapshot listeners are properly cleaned up (unsubscribe()) in useEffect hooks.The visual identity of the platform prioritizes accessibility, mobile responsiveness, and modern web aesthetics.
@media print). Use utility classes extensively.shadcn/ui component.<Dialog> (modals) overlaid on the current dashboard rather than navigating the user to a new disjointed page.
grid-cols-1 md:grid-cols-2) to eliminate vertical scrolling.dark: prefix appropriately. Use semantic coloring (e.g., bg-primary, text-primary-foreground) to let the theme engine handle contrast.CertificateTemplate.jsx must remain pixel-perfect for A4 browser printing. Any modifications to certificates must strictly employ @media print directives and -webkit-print-color-adjust: exact to maintain the integrity of background seals and tables.sonner (integrated via shadcn/ui) for all user feedback.
window.alert() and local state-based error displays with toast.success() or toast.error().Toaster is located in src/app/layout.jsx.react-leaflet. Leaflet components must be imported dynamically using next/dynamic with { ssr: false } to prevent server-side rendering errors in Next.js 16.normalizeImage utility in src/utils/imageProcessor.js. This utilizes browser-image-compression to resize images (e.g., max 800x800 or 500x500) and compress them to JPEG. Do not store raw, uncompressed images in Firebase Storage or Firestore (Base64).The system integrates directly with external services using internal API routes to mask credentials securely.
POST /api/send-otp:
nodemailer.SMTP_USER and SMTP_PASS environment variables. If these are missing (Development Mode), the frontend seamlessly degrades to triggering a local window.alert() to expose the OTP.POST /api/admin/delete-student:
firebase-admin (adminAuth.deleteUser).FIREBASE_SERVICE_ACCOUNT_KEY (JSON string) for production deployment.qrcode.react. All generated certificates contain a dynamically embedded QR code linking back to the exact /c/[certificateId] public URL.GoogleTranslate.jsx).
material-icons) must be wrapped with class="notranslate" translate="no" to prevent the translation engine from corrupting the ligature strings.If you are a developer looking to expand the system, follow this sequence:
payments collection definition).“I have updated
DEVELOPER_GUIDE.mdwith a newpaymentscollection and aPayment Historydashboard table requirement. Read the guide and implement the entire feature across the Next.js frontend and Firebase backend according to the updated specs.”
DEVELOPER_GUIDE.md to ensure the documentation perfectly mirrors the new reality of the codebase.