# anujtiwari1427/quiz-ai architecture

> Architecture diagram of the GitHub repository anujtiwari1427/quiz-ai, 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/anujtiwari1427/quiz-ai
- Repository: https://github.com/anujtiwari1427/quiz-ai

## Overview

Quiz-AI is a browser-based school assessment and study application with teacher, student, parent, and administrator views. Users enter through the app shell, which selects a role or study-feature view from shared application state. Teachers build and import assessments, oversee proctoring, and grade work; students take tests and practice questions; parents review student information and use tutoring features. Marks, syllabus, books, and question sets provide additional study workflows. The inspected storage service persists application data in browser local storage. The README contains no usable product description, so capability coverage is based on the source tree and shown excerpts; some subsystem links rely on source-index references.

Main entry points: [`src/App.tsx`](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/App.tsx) (View Router), [`src/components/teacher/TeacherConsole.tsx`](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/TeacherConsole.tsx) (Teacher Console), [`src/context/AppContext.tsx`](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/context/AppContext.tsx) (App State), [`src/components/student/StudentTestRoom.tsx`](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/StudentTestRoom.tsx) (Student Test Room)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_appcontent["View Router<br/>[App.tsx]"]
  node_marketing["Marketing Landing"]
end

subgraph group_assessment["Assessment"]
  node_teacher["Teacher Console<br/>[TeacherConsole.tsx]"]
  node_builder["Test Builder"]
  node_importer["Document Import"]
  node_proctorhud["Live Proctoring"]
  node_grading["Grading Queue"]
  node_mastery["Mastery Heatmap<br/>[MasteryHeatmap.tsx]"]
  node_student["Student Test Room"]
  node_guard["Proctor Guard<br/>[ProctorGuard.tsx]"]
  node_diagnostic["Result Diagnostics"]
end

subgraph group_study["Study Features"]
  node_marks["Marks Dashboard<br/>[MarksDashboard.tsx]"]
  node_syllabus["Syllabus Dashboard"]
  node_books["Book Library<br/>[BookLibrary.tsx]"]
  node_reader["Book Reader<br/>[BookReader.tsx]"]
  node_questions["Question Sets"]
  node_practice["Question Practice"]
end

subgraph group_community["Stakeholder Portals"]
  node_parent["Parent Portal<br/>[ParentPortal.tsx]"]
  node_auth["WhatsApp Access"]
  node_tutor["AI Tutor<br/>[AITutorDrawer.tsx]"]
  node_admin["Admin Console<br/>[AdminConsole.tsx]"]
  node_roster["Roster Import"]
  node_audit["DPDP Audit Logs<br/>[DPDPAuditLogs.tsx]"]
end

subgraph group_services["Shared Services"]
  node_state["App State<br/>[AppContext.tsx]"]
  node_parser["Document Parser"]
  node_ai["AI Services<br/>[aiService.ts]"]
  node_storage[("Browser Storage<br/>[storageService.ts]")]
  node_grades["Grade Utility<br/>[gradeUtils.ts]"]
end

node_user(("User"))

node_user -.->|"uses"| node_appcontent
node_appcontent -->|"reads view"| node_state
node_appcontent -->|"renders"| node_marketing
node_appcontent -->|"renders"| node_teacher
node_appcontent -->|"renders"| node_student
node_appcontent -->|"renders"| node_parent
node_appcontent -->|"renders"| node_admin
node_appcontent -->|"renders"| node_marks
node_appcontent -->|"renders"| node_syllabus
node_appcontent -->|"renders"| node_books
node_appcontent -->|"renders"| node_questions
node_state -->|"persists data"| node_storage
node_state -->|"calculates grades"| node_grades
node_teacher -->|"opens builder"| node_builder
node_teacher -->|"shows proctoring"| node_proctorhud
node_teacher -->|"opens grading"| node_grading
node_teacher -->|"shows mastery"| node_mastery
node_builder -->|"generates questions"| node_ai
node_builder -->|"uses importer"| node_importer
node_importer -->|"parses documents"| node_parser
node_student -->|"checks proctoring"| node_guard
node_student -->|"shows diagnostics"| node_diagnostic
node_student -->|"submits attempts"| node_state
node_questions -->|"opens practice"| node_practice
node_books -->|"opens book"| node_reader
node_reader -->|"starts quiz"| node_state
node_parent -->|"requests access"| node_auth
node_parent -->|"opens tutor"| node_tutor
node_tutor -->|"requests tutoring"| node_ai
node_admin -->|"manages roster"| node_roster
node_admin -->|"reviews audits"| node_audit

click node_appcontent "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/App.tsx"
click node_marketing "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/marketing/MarketingLanding.tsx"
click node_state "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/context/AppContext.tsx"
click node_teacher "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/TeacherConsole.tsx"
click node_builder "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/TestBuilderWizard.tsx"
click node_importer "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/DocumentQuestionImporter.tsx"
click node_parser "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/documentParserService.ts"
click node_ai "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/aiService.ts"
click node_proctorhud "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/LiveProctoringHUD.tsx"
click node_grading "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/SubjectiveGradingQueue.tsx"
click node_mastery "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/MasteryHeatmap.tsx"
click node_student "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/StudentTestRoom.tsx"
click node_guard "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/ProctorGuard.tsx"
click node_diagnostic "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/ResultDiagnosticSheet.tsx"
click node_marks "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/marks/MarksDashboard.tsx"
click node_syllabus "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/syllabus/SyllabusDashboard.tsx"
click node_books "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/books/BookLibrary.tsx"
click node_reader "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/books/BookReader.tsx"
click node_questions "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/questions/QuestionSetsHub.tsx"
click node_practice "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/questions/QuestionPracticeRoom.tsx"
click node_parent "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/ParentPortal.tsx"
click node_auth "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/WhatsAppAuthModal.tsx"
click node_tutor "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/AITutorDrawer.tsx"
click node_admin "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/AdminConsole.tsx"
click node_roster "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/BulkRosterImport.tsx"
click node_audit "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/DPDPAuditLogs.tsx"
click node_storage "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/storageService.ts"
click node_grades "https://github.com/anujtiwari1427/quiz-ai/blob/main/src/utils/gradeUtils.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_appcontent,node_marketing,node_user toneBlue
class node_teacher,node_builder,node_importer,node_proctorhud,node_grading,node_mastery,node_student,node_guard,node_diagnostic toneAmber
class node_marks,node_syllabus,node_books,node_reader,node_questions,node_practice toneMint
class node_parent,node_auth,node_tutor,node_admin,node_roster,node_audit toneRose
class node_state,node_parser,node_ai,node_storage,node_grades toneIndigo
```

## Components

### App Shell

- [View Router](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Marketing Landing](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/marketing/MarketingLanding.tsx): `src/components/marketing/MarketingLanding.tsx`

### Assessment

- [Teacher Console](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/TeacherConsole.tsx): `src/components/teacher/TeacherConsole.tsx`
- [Test Builder](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/TestBuilderWizard.tsx): `src/components/teacher/TestBuilderWizard.tsx`
- [Document Import](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/DocumentQuestionImporter.tsx): `src/components/teacher/DocumentQuestionImporter.tsx`
- [Live Proctoring](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/LiveProctoringHUD.tsx): `src/components/teacher/LiveProctoringHUD.tsx`
- [Grading Queue](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/SubjectiveGradingQueue.tsx): `src/components/teacher/SubjectiveGradingQueue.tsx`
- [Mastery Heatmap](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/teacher/MasteryHeatmap.tsx): `src/components/teacher/MasteryHeatmap.tsx`
- [Student Test Room](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/StudentTestRoom.tsx): `src/components/student/StudentTestRoom.tsx`
- [Proctor Guard](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/ProctorGuard.tsx): `src/components/student/ProctorGuard.tsx`
- [Result Diagnostics](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/student/ResultDiagnosticSheet.tsx): `src/components/student/ResultDiagnosticSheet.tsx`

### Study Features

- [Marks Dashboard](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/marks/MarksDashboard.tsx): `src/components/marks/MarksDashboard.tsx`
- [Syllabus Dashboard](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/syllabus/SyllabusDashboard.tsx): `src/components/syllabus/SyllabusDashboard.tsx`
- [Book Library](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/books/BookLibrary.tsx): `src/components/books/BookLibrary.tsx`
- [Book Reader](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/books/BookReader.tsx): `src/components/books/BookReader.tsx`
- [Question Sets](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/questions/QuestionSetsHub.tsx): `src/components/questions/QuestionSetsHub.tsx`
- [Question Practice](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/questions/QuestionPracticeRoom.tsx): `src/components/questions/QuestionPracticeRoom.tsx`

### Stakeholder Portals

- [Parent Portal](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/ParentPortal.tsx): `src/components/parent/ParentPortal.tsx`
- [WhatsApp Access](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/WhatsAppAuthModal.tsx): `src/components/parent/WhatsAppAuthModal.tsx`
- [AI Tutor](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/parent/AITutorDrawer.tsx): `src/components/parent/AITutorDrawer.tsx`
- [Admin Console](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/AdminConsole.tsx): `src/components/admin/AdminConsole.tsx`
- [Roster Import](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/BulkRosterImport.tsx): `src/components/admin/BulkRosterImport.tsx`
- [DPDP Audit Logs](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/components/admin/DPDPAuditLogs.tsx): `src/components/admin/DPDPAuditLogs.tsx`

### Shared Services

- [App State](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Document Parser](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/documentParserService.ts): `src/services/documentParserService.ts`
- [AI Services](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/aiService.ts): `src/services/aiService.ts`
- [Browser Storage](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/services/storageService.ts): `src/services/storageService.ts`
- [Grade Utility](https://github.com/anujtiwari1427/quiz-ai/blob/main/src/utils/gradeUtils.ts): `src/utils/gradeUtils.ts`

### Other components

- **User**

## Connections

- User → View Router: uses
- View Router → App State: reads view (evidence: `src/App.tsx`)
- View Router → Marketing Landing: renders (evidence: `src/App.tsx`)
- View Router → Teacher Console: renders (evidence: `src/App.tsx`)
- View Router → Student Test Room: renders (evidence: `src/App.tsx`)
- View Router → Parent Portal: renders (evidence: `src/App.tsx`)
- View Router → Admin Console: renders (evidence: `src/App.tsx`)
- View Router → Marks Dashboard: renders (evidence: `src/App.tsx`)
- View Router → Syllabus Dashboard: renders (evidence: `src/App.tsx`)
- View Router → Book Library: renders (evidence: `src/App.tsx`)
- View Router → Question Sets: renders (evidence: `src/App.tsx`)
- App State → Browser Storage: persists data (evidence: `src/context/AppContext.tsx`)
- App State → Grade Utility: calculates grades (evidence: `src/context/AppContext.tsx`)
- Teacher Console → Test Builder: opens builder (evidence: `src/components/teacher/TeacherConsole.tsx`)
- Teacher Console → Live Proctoring: shows proctoring (evidence: `src/components/teacher/TeacherConsole.tsx`)
- Teacher Console → Grading Queue: opens grading (evidence: `src/components/teacher/TeacherConsole.tsx`)
- Teacher Console → Mastery Heatmap: shows mastery (evidence: `src/components/teacher/TeacherConsole.tsx`)
- Test Builder → AI Services: generates questions (evidence: `src/components/teacher/TestBuilderWizard.tsx`)
- Test Builder → Document Import: uses importer (evidence: `src/components/teacher/TestBuilderWizard.tsx`)
- Document Import → Document Parser: parses documents (evidence: `src/components/teacher/DocumentQuestionImporter.tsx`)
- Student Test Room → Proctor Guard: checks proctoring (evidence: `src/components/student/StudentTestRoom.tsx`)
- Student Test Room → Result Diagnostics: shows diagnostics (evidence: `src/components/student/StudentTestRoom.tsx`)
- Student Test Room → App State: submits attempts (evidence: `src/components/student/StudentTestRoom.tsx`)
- Question Sets → Question Practice: opens practice (evidence: `src/components/questions/QuestionSetsHub.tsx`)
- Book Library → Book Reader: opens book (evidence: `src/components/books/BookLibrary.tsx`)
- Book Reader → App State: starts quiz (evidence: `src/components/books/BookReader.tsx`)
- Parent Portal → WhatsApp Access: requests access (evidence: `src/components/parent/ParentPortal.tsx`)
- Parent Portal → AI Tutor: opens tutor (evidence: `src/components/parent/ParentPortal.tsx`)
- AI Tutor → AI Services: requests tutoring (evidence: `src/components/parent/AITutorDrawer.tsx`)
- Admin Console → Roster Import: manages roster (evidence: `src/components/admin/AdminConsole.tsx`)
- Admin Console → DPDP Audit Logs: reviews audits (evidence: `src/components/admin/AdminConsole.tsx`)
