# darkplaying/final-year-project architecture

> Architecture diagram of the GitHub repository darkplaying/final-year-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darkplaying/final-year-project
- Repository: https://github.com/darkplaying/final-year-project

## Overview

Edu Online is a role-based education management platform. Users enter through the public landing and login flows, then reach protected Admin, Teacher, or Student dashboards; those dashboards provide user/workspace administration, teaching workflows, and student learning/submission features. Firebase is the documented backend for authentication, data, presence, and messaging, with Google Drive described as file storage and Supabase functions present for AI test generation and document parsing. Dashboard implementation details and several integrations were not sampled, so some capability links are documented rather than source-verified.

Main entry points: [`src/App.tsx`](https://github.com/darkplaying/final-year-project/blob/main/src/App.tsx) (Route and access shell), [`src/pages/AdminDashboard.tsx`](https://github.com/darkplaying/final-year-project/blob/main/src/pages/AdminDashboard.tsx) (Admin dashboard), [`src/pages/TeacherDashboard.tsx`](https://github.com/darkplaying/final-year-project/blob/main/src/pages/TeacherDashboard.tsx) (Teacher dashboard), [`src/hooks/usePresence.ts`](https://github.com/darkplaying/final-year-project/blob/main/src/hooks/usePresence.ts) (Live presence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and access"]
  node_landing["Landing page<br/>[Index.tsx]"]
  node_login["Login<br/>[Login.tsx]"]
  node_app["Route and access shell<br/>[App.tsx]"]
end

subgraph group_roles["Role dashboards"]
  node_admin["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_teacher["Teacher dashboard"]
  node_student["Student dashboard"]
  node_attendance["Attendance management"]
  node_csv["CSV report generation<br/>[AICsvGenerator.tsx]"]
  node_aitest["AI test generation UI"]
end

subgraph group_services["Platform services"]
  node_presence["Live presence<br/>[usePresence.ts]"]
  node_auth["Auth utilities<br/>[auth.ts]"]
  node_authstate["Firebase auth state<br/>[useAuthState.ts]"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_storage["Assignment and exam storage<br/>[storage.ts]"]
end

subgraph group_integrations["External integrations"]
  node_generate["Test generation function<br/>[index.ts]"]
  node_parse["Document parsing function<br/>[index.ts]"]
  node_drive["Google Drive"]
  node_firebase_services[("Firebase services")]
  node_notifications["Notification delivery<br/>[index.js]"]
end

node_visitor(("Visitor / user"))

node_visitor -->|"opens"| node_landing
node_landing -->|"navigates to"| node_login
node_login -.->|"enters routes"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_login
node_app -->|"role-routes"| node_admin
node_app -->|"role-routes"| node_teacher
node_app -->|"role-routes"| node_student
node_admin -->|"renders"| node_attendance
node_admin -->|"uses"| node_csv
node_admin -->|"reads presence"| node_presence
node_teacher -->|"uses"| node_aitest
node_teacher -->|"reads presence"| node_presence
node_student -->|"reads presence"| node_presence
node_attendance -->|"reads / writes"| node_firebase
node_presence -->|"updates presence"| node_firebase
node_authstate -->|"observes auth"| node_firebase
node_aitest -.->|"requests generation"| node_generate
node_generate -.->|"may use parsing"| node_parse
node_teacher -.->|"stores course files"| node_drive
node_student -.->|"submits files"| node_drive
node_firebase -->|"connects"| node_firebase_services
node_firebase_services -.->|"delivers alerts"| node_notifications

click node_landing "https://github.com/darkplaying/final-year-project/blob/main/src/pages/Index.tsx"
click node_login "https://github.com/darkplaying/final-year-project/blob/main/src/pages/Login.tsx"
click node_app "https://github.com/darkplaying/final-year-project/blob/main/src/App.tsx"
click node_admin "https://github.com/darkplaying/final-year-project/blob/main/src/pages/AdminDashboard.tsx"
click node_teacher "https://github.com/darkplaying/final-year-project/blob/main/src/pages/TeacherDashboard.tsx"
click node_student "https://github.com/darkplaying/final-year-project/blob/main/src/pages/StudentDashboard.tsx"
click node_attendance "https://github.com/darkplaying/final-year-project/blob/main/src/components/AdminAttendanceManager.tsx"
click node_presence "https://github.com/darkplaying/final-year-project/blob/main/src/hooks/usePresence.ts"
click node_auth "https://github.com/darkplaying/final-year-project/blob/main/src/lib/auth.ts"
click node_authstate "https://github.com/darkplaying/final-year-project/blob/main/src/hooks/useAuthState.ts"
click node_firebase "https://github.com/darkplaying/final-year-project/blob/main/src/lib/firebase.ts"
click node_csv "https://github.com/darkplaying/final-year-project/blob/main/src/components/AICsvGenerator.tsx"
click node_aitest "https://github.com/darkplaying/final-year-project/blob/main/src/components/AITestGenerator.tsx"
click node_storage "https://github.com/darkplaying/final-year-project/blob/main/src/lib/storage.ts"
click node_generate "https://github.com/darkplaying/final-year-project/blob/main/supabase/functions/generate-test/index.ts"
click node_parse "https://github.com/darkplaying/final-year-project/blob/main/supabase/functions/parse-document/index.ts"
click node_notifications "https://github.com/darkplaying/final-year-project/blob/main/notification-service/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_landing,node_login,node_app,node_visitor toneBlue
class node_admin,node_teacher,node_student,node_attendance,node_csv,node_aitest toneAmber
class node_presence,node_auth,node_authstate,node_firebase,node_storage toneMint
class node_generate,node_parse,node_drive,node_firebase_services,node_notifications toneRose
```

## Components

### Entry and access

- [Landing page](https://github.com/darkplaying/final-year-project/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Login](https://github.com/darkplaying/final-year-project/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Route and access shell](https://github.com/darkplaying/final-year-project/blob/main/src/App.tsx): `src/App.tsx`

### Role dashboards

- [Admin dashboard](https://github.com/darkplaying/final-year-project/blob/main/src/pages/AdminDashboard.tsx): `src/pages/AdminDashboard.tsx`
- [Teacher dashboard](https://github.com/darkplaying/final-year-project/blob/main/src/pages/TeacherDashboard.tsx): `src/pages/TeacherDashboard.tsx`
- [Student dashboard](https://github.com/darkplaying/final-year-project/blob/main/src/pages/StudentDashboard.tsx): `src/pages/StudentDashboard.tsx`
- [Attendance management](https://github.com/darkplaying/final-year-project/blob/main/src/components/AdminAttendanceManager.tsx): `src/components/AdminAttendanceManager.tsx`
- [CSV report generation](https://github.com/darkplaying/final-year-project/blob/main/src/components/AICsvGenerator.tsx): `src/components/AICsvGenerator.tsx`
- [AI test generation UI](https://github.com/darkplaying/final-year-project/blob/main/src/components/AITestGenerator.tsx): `src/components/AITestGenerator.tsx`

### Platform services

- [Live presence](https://github.com/darkplaying/final-year-project/blob/main/src/hooks/usePresence.ts): `src/hooks/usePresence.ts`
- [Auth utilities](https://github.com/darkplaying/final-year-project/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Firebase auth state](https://github.com/darkplaying/final-year-project/blob/main/src/hooks/useAuthState.ts): `src/hooks/useAuthState.ts`
- [Firebase client](https://github.com/darkplaying/final-year-project/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Assignment and exam storage](https://github.com/darkplaying/final-year-project/blob/main/src/lib/storage.ts): `src/lib/storage.ts`

### External integrations

- [Test generation function](https://github.com/darkplaying/final-year-project/blob/main/supabase/functions/generate-test/index.ts): `supabase/functions/generate-test/index.ts`
- [Document parsing function](https://github.com/darkplaying/final-year-project/blob/main/supabase/functions/parse-document/index.ts): `supabase/functions/parse-document/index.ts`
- **Google Drive**
- **Firebase services**
- [Notification delivery](https://github.com/darkplaying/final-year-project/blob/main/notification-service/index.js): `notification-service/index.js`

### Other components

- **Visitor / user**

## Connections

- Visitor / user → Landing page: opens (evidence: `src/pages/Index.tsx`)
- Landing page → Login: navigates to (evidence: `src/pages/Index.tsx`)
- Login → Route and access shell: enters routes (evidence: `src/App.tsx`)
- Route and access shell → Landing page: routes to (evidence: `src/App.tsx`)
- Route and access shell → Login: routes to (evidence: `src/App.tsx`)
- Route and access shell → Admin dashboard: role-routes (evidence: `src/App.tsx`)
- Route and access shell → Teacher dashboard: role-routes (evidence: `src/App.tsx`)
- Route and access shell → Student dashboard: role-routes (evidence: `src/App.tsx`)
- Admin dashboard → Attendance management: renders (evidence: `src/pages/AdminDashboard.tsx`)
- Admin dashboard → CSV report generation: uses (evidence: `src/pages/AdminDashboard.tsx`)
- Admin dashboard → Live presence: reads presence (evidence: `src/pages/AdminDashboard.tsx`)
- Teacher dashboard → AI test generation UI: uses (evidence: `src/pages/TeacherDashboard.tsx`)
- Teacher dashboard → Live presence: reads presence (evidence: `src/pages/TeacherDashboard.tsx`)
- Student dashboard → Live presence: reads presence (evidence: `src/pages/StudentDashboard.tsx`)
- Attendance management → Firebase client: reads / writes (evidence: `src/components/AdminAttendanceManager.tsx`)
- Live presence → Firebase client: updates presence (evidence: `src/hooks/usePresence.ts`)
- Firebase auth state → Firebase client: observes auth (evidence: `src/hooks/useAuthState.ts`)
- AI test generation UI → Test generation function: requests generation
- Test generation function → Document parsing function: may use parsing
- Teacher dashboard → Google Drive: stores course files
- Student dashboard → Google Drive: submits files
- Firebase client → Firebase services: connects (evidence: `src/lib/firebase.ts`)
- Firebase services → Notification delivery: delivers alerts
