# mahmood601/novateam architecture

> Architecture diagram of the GitHub repository mahmood601/novateam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahmood601/novateam
- Repository: https://github.com/mahmood601/novateam

## Overview

Nova App is a medical-student study platform whose central workflow is selecting course material, taking quizzes, and reviewing results; it also supports lecture reading and authoring. The app router exposes student and permission-gated management routes. Quiz and lecture data use local IndexedDB alongside Supabase-backed services; the editor adds draft saving and print preview, while classification can use Gemini. Relationships are limited to routing, imports, calls, and data flows visible in the supplied excerpts or SOURCE INDEX; unsampled internals are represented only at supported paths.

Main entry points: [`src/app/AppRoutes.tsx`](https://github.com/mahmood601/novateam/blob/master/src/app/AppRoutes.tsx) (App router), [`src/features/shared/services/supabase.ts`](https://github.com/mahmood601/novateam/blob/master/src/features/shared/services/supabase.ts) (Supabase client), [`src/features/quizzes/pages/QuizEditor.tsx`](https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/pages/QuizEditor.tsx) (Quiz management), [`src/features/shared/context/user.tsx`](https://github.com/mahmood601/novateam/blob/master/src/features/shared/context/user.tsx) (Identity and grants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and identity"]
  node_app_router["App router<br/>[AppRoutes.tsx]"]
  node_identity["Identity and grants<br/>[user.tsx]"]
end

subgraph group_study["Study experience"]
  node_quiz["Timed quizzes<br/>[Quiz.tsx]"]
  node_lecture_view["Lecture reader"]
  node_lecture_search["Lecture search index"]
  node_search["Study search<br/>[Search.tsx]"]
end

subgraph group_content["Content authoring"]
  node_quiz_editor["Quiz management<br/>[QuizEditor.tsx]"]
  node_classifier["Question classifier<br/>[ClassifierPage.tsx]"]
  node_lecture_editor["Lecture editor"]
  node_a4_preview["A4 print preview<br/>[a4Preview.ts]"]
end

subgraph group_services["Data and integrations"]
  node_local_db[("Local IndexedDB<br/>[db.ts]")]
  node_sections["Section sync<br/>[sections.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_gemini["Gemini service<br/>[gemini.ts]"]
end

node_student(("Student"))
node_admin(("Content administrator"))
node_supabase[("Supabase")]
node_browser[("Browser storage")]
node_ai_service["Gemini API"]

node_student -->|"opens routes"| node_app_router
node_admin -->|"opens routes"| node_app_router
node_app_router -->|"routes to"| node_quiz
node_app_router -->|"routes to"| node_quiz_editor
node_app_router -->|"routes to"| node_classifier
node_app_router -->|"routes to"| node_lecture_editor
node_app_router -.->|"routes to"| node_lecture_view
node_identity -->|"authenticates via"| node_supabase_client
node_identity -->|"reads identity"| node_supabase
node_identity -->|"caches identity"| node_browser
node_quiz_editor -->|"reads and writes"| node_supabase_client
node_quiz_editor -->|"checks permissions"| node_identity
node_quiz_editor -.->|"uses local data"| node_local_db
node_classifier -->|"uses data service"| node_supabase_client
node_classifier -->|"requests classification"| node_gemini
node_gemini -.->|"sends requests"| node_ai_service
node_lecture_view -->|"loads sections"| node_sections
node_lecture_view -->|"reads cached subject"| node_local_db
node_search -->|"searches lectures"| node_lecture_search
node_lecture_search -->|"uses local database"| node_local_db
node_sections -->|"reads and writes"| node_local_db
node_sections -->|"syncs sections"| node_supabase_client
node_supabase_client -->|"queries"| node_supabase
node_lecture_editor -->|"saves drafts"| node_browser
node_lecture_editor -->|"renders preview"| node_a4_preview
node_a4_preview -.->|"uploads assets"| node_supabase_client

click node_app_router "https://github.com/mahmood601/novateam/blob/master/src/app/AppRoutes.tsx"
click node_identity "https://github.com/mahmood601/novateam/blob/master/src/features/shared/context/user.tsx"
click node_quiz "https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/pages/Quiz.tsx"
click node_quiz_editor "https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/pages/QuizEditor.tsx"
click node_classifier "https://github.com/mahmood601/novateam/blob/master/src/features/classifier/ClassifierPage.tsx"
click node_lecture_view "https://github.com/mahmood601/novateam/blob/master/src/features/lectures/pages/LectureViewPage.tsx"
click node_lecture_search "https://github.com/mahmood601/novateam/blob/master/src/features/lectures/lib/lectureSearchIndex.ts"
click node_search "https://github.com/mahmood601/novateam/blob/master/src/features/shared/pages/Search.tsx"
click node_lecture_editor "https://github.com/mahmood601/novateam/blob/master/src/features/editor/components/TiptapReviewEditor.tsx"
click node_a4_preview "https://github.com/mahmood601/novateam/blob/master/src/features/editor/lib/a4Preview.ts"
click node_local_db "https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/services/local/indexeddb/db.ts"
click node_sections "https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/services/local/indexeddb/sections.ts"
click node_supabase_client "https://github.com/mahmood601/novateam/blob/master/src/features/shared/services/supabase.ts"
click node_gemini "https://github.com/mahmood601/novateam/blob/master/src/features/shared/services/gemini.ts"

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_app_router,node_identity toneBlue
class node_quiz,node_lecture_view,node_lecture_search,node_search,node_supabase,node_browser toneAmber
class node_quiz_editor,node_classifier,node_lecture_editor,node_a4_preview,node_ai_service toneMint
class node_local_db,node_sections,node_supabase_client,node_gemini toneRose
class node_student,node_admin toneIndigo
```

## Components

### App and identity

- [App router](https://github.com/mahmood601/novateam/blob/master/src/app/AppRoutes.tsx): `src/app/AppRoutes.tsx`
- [Identity and grants](https://github.com/mahmood601/novateam/blob/master/src/features/shared/context/user.tsx): `src/features/shared/context/user.tsx`

### Study experience

- [Timed quizzes](https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/pages/Quiz.tsx): `src/features/quizzes/pages/Quiz.tsx`
- [Lecture reader](https://github.com/mahmood601/novateam/blob/master/src/features/lectures/pages/LectureViewPage.tsx): `src/features/lectures/pages/LectureViewPage.tsx`
- [Lecture search index](https://github.com/mahmood601/novateam/blob/master/src/features/lectures/lib/lectureSearchIndex.ts): `src/features/lectures/lib/lectureSearchIndex.ts`
- [Study search](https://github.com/mahmood601/novateam/blob/master/src/features/shared/pages/Search.tsx): `src/features/shared/pages/Search.tsx`

### Content authoring

- [Quiz management](https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/pages/QuizEditor.tsx): `src/features/quizzes/pages/QuizEditor.tsx`
- [Question classifier](https://github.com/mahmood601/novateam/blob/master/src/features/classifier/ClassifierPage.tsx): `src/features/classifier/ClassifierPage.tsx`
- [Lecture editor](https://github.com/mahmood601/novateam/blob/master/src/features/editor/components/TiptapReviewEditor.tsx): `src/features/editor/components/TiptapReviewEditor.tsx`
- [A4 print preview](https://github.com/mahmood601/novateam/blob/master/src/features/editor/lib/a4Preview.ts): `src/features/editor/lib/a4Preview.ts`

### Data and integrations

- [Local IndexedDB](https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/services/local/indexeddb/db.ts): `src/features/quizzes/services/local/indexeddb/db.ts`
- [Section sync](https://github.com/mahmood601/novateam/blob/master/src/features/quizzes/services/local/indexeddb/sections.ts): `src/features/quizzes/services/local/indexeddb/sections.ts`
- [Supabase client](https://github.com/mahmood601/novateam/blob/master/src/features/shared/services/supabase.ts): `src/features/shared/services/supabase.ts`
- [Gemini service](https://github.com/mahmood601/novateam/blob/master/src/features/shared/services/gemini.ts): `src/features/shared/services/gemini.ts`

### Other components

- **Student**
- **Content administrator**
- **Supabase**
- **Browser storage**
- **Gemini API**

## Connections

- Student → App router: opens routes (evidence: `src/app/AppRoutes.tsx`)
- Content administrator → App router: opens routes (evidence: `src/app/AppRoutes.tsx`)
- App router → Timed quizzes: routes to (evidence: `src/app/AppRoutes.tsx`)
- App router → Quiz management: routes to (evidence: `src/app/AppRoutes.tsx`)
- App router → Question classifier: routes to (evidence: `src/app/AppRoutes.tsx`)
- App router → Lecture editor: routes to (evidence: `src/app/AppRoutes.tsx`)
- App router → Lecture reader: routes to (evidence: `src/app/AppRoutes.tsx`)
- Identity and grants → Supabase client: authenticates via (evidence: `src/features/shared/context/user.tsx`)
- Identity and grants → Supabase: reads identity (evidence: `src/features/shared/context/user.tsx`)
- Identity and grants → Browser storage: caches identity (evidence: `src/features/shared/context/user.tsx`)
- Quiz management → Supabase client: reads and writes (evidence: `src/features/quizzes/pages/QuizEditor.tsx`)
- Quiz management → Identity and grants: checks permissions (evidence: `src/features/quizzes/pages/QuizEditor.tsx`)
- Quiz management → Local IndexedDB: uses local data
- Question classifier → Supabase client: uses data service (evidence: `src/features/classifier/ClassifierPage.tsx`)
- Question classifier → Gemini service: requests classification (evidence: `src/features/classifier/ClassifierPage.tsx`)
- Gemini service → Gemini API: sends requests
- Lecture reader → Section sync: loads sections (evidence: `src/features/lectures/pages/LectureViewPage.tsx`)
- Lecture reader → Local IndexedDB: reads cached subject (evidence: `src/features/lectures/pages/LectureViewPage.tsx`)
- Study search → Lecture search index: searches lectures (evidence: `src/features/shared/pages/Search.tsx`)
- Lecture search index → Local IndexedDB: uses local database (evidence: `src/features/lectures/lib/lectureSearchIndex.ts`)
- Section sync → Local IndexedDB: reads and writes (evidence: `src/features/quizzes/services/local/indexeddb/sections.ts`)
- Section sync → Supabase client: syncs sections (evidence: `src/features/quizzes/services/local/indexeddb/sections.ts`)
- Supabase client → Supabase: queries (evidence: `src/features/shared/services/supabase.ts`)
- Lecture editor → Browser storage: saves drafts (evidence: `src/features/editor/components/TiptapReviewEditor.tsx`)
- Lecture editor → A4 print preview: renders preview (evidence: `src/features/editor/components/TiptapReviewEditor.tsx`)
- A4 print preview → Supabase client: uploads assets
