# jatinthacker000-debug/nerdtutors architecture

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

- Interactive diagram: https://gitdiagram.com/jatinthacker000-debug/nerdtutors
- Repository: https://github.com/jatinthacker000-debug/nerdtutors

## Overview

NerdTutors is an AI-assisted exam management and grading platform. Teachers authenticate, curate reusable questions and batches, and publish test sessions; students take MCQ or written exams or submit scanned answer sheets. Evaluation produces scores and feedback that are stored for teacher review and student results pages. The README documents typed and OCR grading, analytics, exports, authentication, and subject-specific rubrics; sampled source confirms several Firestore writes and reads, but does not expose all page-to-API wiring, so uncertain links are omitted.

Main entry points: [`js/admin-modules/session-manager.js`](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/session-manager.js) (Test sessions), [`api/ocr-evaluate.js`](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/api/ocr-evaluate.js) (OCR grading API), [`js/admin-modules/excel-uploader.js`](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/excel-uploader.js) (Bulk question import), [`batch-manager.js`](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/batch-manager.js) (Question batches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and portals"]
  node_landing["Login portal<br/>[index.js]"]
  node_student_portal["Student dashboard<br/>[dashboard.js]"]
  node_admin_portal["Admin portal<br/>[admin.js]"]
  node_settings["Account settings<br/>[settings.html]"]
end

subgraph group_exam["Exam authoring"]
  node_question_catalog["Question catalog"]
  node_question_import["Bulk question import<br/>[excel-uploader.js]"]
  node_batch_manager["Question batches<br/>[batch-manager.js]"]
  node_session_manager["Test sessions<br/>[session-manager.js]"]
  node_firestore_questions[("Questions and batches")]
  node_firestore_sessions[("Test sessions")]
end

subgraph group_assessment["Assessment and grading"]
  node_mcq_exam["MCQ exam<br/>[mcq-test.js]"]
  node_written_exam["Written exam<br/>[test.html]"]
  node_scan_submit["Scanned submission<br/>[ocr-scan.html]"]
  node_typed_grading["Typed grading API<br/>[evaluate.js]"]
  node_ocr_grading["OCR grading API<br/>[ocr-evaluate.js]"]
  node_grading_client["Evaluation client<br/>[gemini-config.js]"]
  node_manual_review["PDF answer review"]
end

subgraph group_records["Results and reporting"]
  node_firestore_results[("Test results")]
  node_results_page["Student results<br/>[results.html]"]
  node_analytics["Performance analytics<br/>[dashboard.js]"]
  node_reporting["Reports and exports<br/>[admin.js]"]
end

node_teacher(("Teacher"))
node_student(("Student"))
node_firebase["Firebase Auth"]
node_gemini["Google Gemini"]

node_teacher -->|"signs in"| node_landing
node_landing -->|"authenticates"| node_firebase
node_teacher -->|"manages exams"| node_admin_portal
node_student -->|"views tests"| node_student_portal
node_student -->|"takes test"| node_mcq_exam
node_student -->|"takes test"| node_written_exam
node_student -->|"uploads sheets"| node_scan_submit
node_question_catalog -->|"writes and reads"| node_firestore_questions
node_question_import -->|"imports questions"| node_firestore_questions
node_question_import -->|"refreshes list"| node_question_catalog
node_batch_manager -->|"writes and reads batches"| node_firestore_questions
node_session_manager -->|"writes and reads"| node_firestore_sessions
node_batch_manager -.->|"supplies batches"| node_session_manager
node_mcq_exam -.->|"loads session"| node_firestore_sessions
node_written_exam -.->|"loads session"| node_firestore_sessions
node_grading_client -->|"submits answers"| node_typed_grading
node_typed_grading -->|"requests grading"| node_gemini
node_scan_submit -.->|"submits scans"| node_ocr_grading
node_ocr_grading -->|"requests OCR grading"| node_gemini
node_manual_review -.->|"requests evaluation"| node_ocr_grading
node_session_manager -->|"reviews and edits"| node_firestore_results
node_student_portal -->|"reads results"| node_firestore_results
node_analytics -->|"reads results"| node_firestore_results
node_results_page -.->|"shows report"| node_firestore_results
node_reporting -.->|"exports grades"| node_firestore_results
node_settings -.->|"manages account"| node_firebase

click node_landing "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/index.js"
click node_student_portal "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/dashboard.js"
click node_admin_portal "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/admin.js"
click node_settings "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/settings.html"
click node_question_catalog "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/question-manager.js"
click node_question_import "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/excel-uploader.js"
click node_batch_manager "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/batch-manager.js"
click node_session_manager "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/session-manager.js"
click node_mcq_exam "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/mcq-test.js"
click node_written_exam "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/test.html"
click node_scan_submit "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/ocr-scan.html"
click node_typed_grading "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/api/evaluate.js"
click node_ocr_grading "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/api/ocr-evaluate.js"
click node_grading_client "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/gemini-config.js"
click node_manual_review "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/answer-evaluator.js"
click node_results_page "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/results.html"
click node_analytics "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/dashboard.js"
click node_reporting "https://github.com/jatinthacker000-debug/nerdtutors/blob/main/admin.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_student_portal,node_admin_portal,node_settings toneBlue
class node_question_catalog,node_question_import,node_batch_manager,node_session_manager,node_firestore_questions,node_firestore_sessions toneAmber
class node_mcq_exam,node_written_exam,node_scan_submit,node_typed_grading,node_ocr_grading,node_grading_client,node_manual_review toneMint
class node_firestore_results,node_results_page,node_analytics,node_reporting toneRose
class node_teacher,node_student,node_firebase,node_gemini toneIndigo
```

## Components

### Identity and portals

- [Login portal](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/index.js): `index.js`
- [Student dashboard](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/dashboard.js): `dashboard.js`
- [Admin portal](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/admin.js): `admin.js`
- [Account settings](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/settings.html): `settings.html`

### Exam authoring

- [Question catalog](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/question-manager.js): `js/admin-modules/question-manager.js`
- [Bulk question import](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/excel-uploader.js): `js/admin-modules/excel-uploader.js`
- [Question batches](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/batch-manager.js): `batch-manager.js`
- [Test sessions](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/session-manager.js): `js/admin-modules/session-manager.js`
- **Questions and batches**
- **Test sessions**

### Assessment and grading

- [MCQ exam](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/mcq-test.js): `mcq-test.js`
- [Written exam](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/test.html): `test.html`
- [Scanned submission](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/ocr-scan.html): `ocr-scan.html`
- [Typed grading API](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/api/evaluate.js): `api/evaluate.js`
- [OCR grading API](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/api/ocr-evaluate.js): `api/ocr-evaluate.js`
- [Evaluation client](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/gemini-config.js): `gemini-config.js`
- [PDF answer review](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/js/admin-modules/answer-evaluator.js): `js/admin-modules/answer-evaluator.js`

### Results and reporting

- **Test results**
- [Student results](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/results.html): `results.html`
- [Performance analytics](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/dashboard.js): `dashboard.js`
- [Reports and exports](https://github.com/jatinthacker000-debug/nerdtutors/blob/main/admin.js): `admin.js`

### Other components

- **Teacher**
- **Student**
- **Firebase Auth**
- **Google Gemini**

## Connections

- Teacher → Login portal: signs in
- Login portal → Firebase Auth: authenticates
- Teacher → Admin portal: manages exams
- Student → Student dashboard: views tests
- Student → MCQ exam: takes test
- Student → Written exam: takes test
- Student → Scanned submission: uploads sheets
- Question catalog → Questions and batches: writes and reads
- Bulk question import → Questions and batches: imports questions
- Bulk question import → Question catalog: refreshes list
- Question batches → Questions and batches: writes and reads batches
- Test sessions → Test sessions: writes and reads
- Question batches → Test sessions: supplies batches
- MCQ exam → Test sessions: loads session
- Written exam → Test sessions: loads session
- Evaluation client → Typed grading API: submits answers
- Typed grading API → Google Gemini: requests grading
- Scanned submission → OCR grading API: submits scans
- OCR grading API → Google Gemini: requests OCR grading
- PDF answer review → OCR grading API: requests evaluation
- Test sessions → Test results: reviews and edits
- Student dashboard → Test results: reads results
- Performance analytics → Test results: reads results
- Student results → Test results: shows report
- Reports and exports → Test results: exports grades
- Account settings → Firebase Auth: manages account
