# decastroaldwin0/quizforge architecture

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

- Interactive diagram: https://gitdiagram.com/decastroaldwin0/quizforge
- Repository: https://github.com/decastroaldwin0/quizforge

## Overview

QuizForge is an AI-assisted assessment platform. Teachers upload source documents, create and publish quizzes, and review results; students access exams by token, complete safeguarded attempts, and receive AI-assisted grading and feedback. The graph preserves the documented document/RAG, quiz authoring, class access, attempt, analytics, and administration capabilities. Source excerpts show server route registration and selected repository/service dependencies; internal links not demonstrated there are represented only where the README documents the workflow.

Main entry points: [`frontend/src/app/router.jsx`](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/app/router.jsx) (App routing), [`backend/src/server.ts`](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/server.ts) (Express API), [`backend/src/routes/quizSubmit.route.ts`](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/quizSubmit.route.ts) (Attempt submission), [`frontend/src/features/quizzes/pages/QuizMakerPage.jsx`](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/quizzes/pages/QuizMakerPage.jsx) (Teacher workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_webapp["App routing<br/>[router.jsx]"]
  node_authui["Sign in<br/>[LoginPage.jsx]"]
  node_teacherui["Teacher workspace<br/>[QuizMakerPage.jsx]"]
  node_classui["Class management<br/>[ClassesPage.jsx]"]
  node_resultsui["Attempt analytics"]
  node_studentui["Student exam"]
  node_attemptstorage["Attempt progress<br/>[attemptStorage.js]"]
end

subgraph group_content["Content and authoring"]
  node_docupload["Document ingestion"]
  node_embeddings["Text embeddings<br/>[embedText.ts]"]
  node_chunks["Document chunks"]
  node_quizauthor["Quiz authoring"]
  node_questionauthor["Question authoring"]
  node_classes["Class access"]
end

subgraph group_assessment["Assessment and insights"]
  node_quizaccess["Token access"]
  node_submission["Attempt submission"]
  node_grading["AI grading"]
  node_remarks["Learning feedback"]
  node_attemptdata["Attempt records"]
  node_quizdata["Quiz records"]
end

subgraph group_platform["Platform services"]
  node_admin["Administration<br/>[admin.route.ts]"]
  node_auth["Authentication<br/>[auth.middleware.ts]"]
  node_ai["AI provider client<br/>[aiClient.ts]"]
  node_database[("Postgres data<br/>[db.ts]")]
  node_api["Express API<br/>[server.ts]"]
end

node_teacher(("Teacher"))
node_student(("Student"))
node_administrator(("Administrator"))

node_teacher -->|"uses"| node_webapp
node_student -->|"uses"| node_webapp
node_administrator -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_teacherui
node_webapp -->|"routes to"| node_classui
node_webapp -->|"routes to"| node_resultsui
node_webapp -->|"routes to"| node_studentui
node_teacherui -.->|"uploads sources"| node_docupload
node_docupload -->|"embeds text"| node_embeddings
node_docupload -->|"stores chunks"| node_chunks
node_teacherui -.->|"creates quizzes"| node_quizauthor
node_quizauthor -.->|"manages questions"| node_questionauthor
node_teacherui -.->|"limits access"| node_classes
node_studentui -->|"saves progress"| node_attemptstorage
node_student -->|"enters token"| node_quizaccess
node_quizaccess -.->|"begins attempt"| node_submission
node_studentui -.->|"submits answers"| node_submission
node_submission -.->|"requests grading"| node_grading
node_grading -->|"calls model"| node_ai
node_submission -.->|"records attempt"| node_attemptdata
node_grading -.->|"informs feedback"| node_remarks
node_remarks -->|"calls model"| node_ai
node_resultsui -.->|"reviews results"| node_attemptdata
node_resultsui -.->|"shows quiz results"| node_quizdata
node_administrator -->|"manages users"| node_admin
node_api -->|"mounts route"| node_quizauthor
node_api -->|"mounts route"| node_questionauthor
node_api -->|"mounts route"| node_classes
node_api -->|"mounts route"| node_quizaccess
node_api -->|"mounts route"| node_submission
node_api -->|"mounts route"| node_admin
node_quizauthor -->|"queries quizzes"| node_quizdata
node_quizdata -->|"reads and writes"| node_database
node_attemptdata -->|"reads and writes"| node_database
node_authui -.->|"authenticates"| node_auth

click node_webapp "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/app/router.jsx"
click node_authui "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/auth/pages/LoginPage.jsx"
click node_teacherui "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/quizzes/pages/QuizMakerPage.jsx"
click node_classui "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/classes/pages/ClassesPage.jsx"
click node_resultsui "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/exam-attempts/pages/ExamAttemptsPage.jsx"
click node_studentui "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/student-quiz/pages/StudentQuizPage.jsx"
click node_attemptstorage "https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/student-quiz/lib/attemptStorage.js"
click node_docupload "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/fileExtract.service.ts"
click node_embeddings "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/lib/embedText.ts"
click node_chunks "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/DocumentChunksRepo.ts"
click node_quizauthor "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-quiz.route.ts"
click node_questionauthor "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-question.route.ts"
click node_classes "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-classes.route.ts"
click node_quizaccess "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/quizAccess.route.ts"
click node_submission "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/quizSubmit.route.ts"
click node_grading "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/getReasoningScoreObject.service.ts"
click node_remarks "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/summaryRemarks.service.ts"
click node_attemptdata "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/QuizAttemptsRepository.ts"
click node_quizdata "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/UserQuizzesRepository.ts"
click node_admin "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/admin.route.ts"
click node_auth "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/middlewares/auth.middleware.ts"
click node_ai "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/lib/aiClient.ts"
click node_database "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/db/db.ts"
click node_api "https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/server.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_webapp,node_authui,node_teacherui,node_classui,node_resultsui,node_studentui,node_attemptstorage toneBlue
class node_docupload,node_embeddings,node_chunks,node_quizauthor,node_questionauthor,node_classes toneAmber
class node_quizaccess,node_submission,node_grading,node_remarks,node_attemptdata,node_quizdata toneMint
class node_admin,node_auth,node_ai,node_database,node_api toneRose
class node_teacher,node_student,node_administrator toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/app/router.jsx): `frontend/src/app/router.jsx`
- [Sign in](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/auth/pages/LoginPage.jsx): `frontend/src/features/auth/pages/LoginPage.jsx`
- [Teacher workspace](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/quizzes/pages/QuizMakerPage.jsx): `frontend/src/features/quizzes/pages/QuizMakerPage.jsx`
- [Class management](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/classes/pages/ClassesPage.jsx): `frontend/src/features/classes/pages/ClassesPage.jsx`
- [Attempt analytics](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/exam-attempts/pages/ExamAttemptsPage.jsx): `frontend/src/features/exam-attempts/pages/ExamAttemptsPage.jsx`
- [Student exam](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/student-quiz/pages/StudentQuizPage.jsx): `frontend/src/features/student-quiz/pages/StudentQuizPage.jsx`
- [Attempt progress](https://github.com/decastroaldwin0/quizforge/blob/main/frontend/src/features/student-quiz/lib/attemptStorage.js): `frontend/src/features/student-quiz/lib/attemptStorage.js`

### Content and authoring

- [Document ingestion](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/fileExtract.service.ts): `backend/src/services/fileExtract.service.ts`
- [Text embeddings](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/lib/embedText.ts): `backend/src/lib/embedText.ts`
- [Document chunks](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/DocumentChunksRepo.ts): `backend/src/repository/DocumentChunksRepo.ts`
- [Quiz authoring](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-quiz.route.ts): `backend/src/routes/teacher-quiz.route.ts`
- [Question authoring](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-question.route.ts): `backend/src/routes/teacher-question.route.ts`
- [Class access](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/teacher-classes.route.ts): `backend/src/routes/teacher-classes.route.ts`

### Assessment and insights

- [Token access](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/quizAccess.route.ts): `backend/src/routes/quizAccess.route.ts`
- [Attempt submission](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/quizSubmit.route.ts): `backend/src/routes/quizSubmit.route.ts`
- [AI grading](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/getReasoningScoreObject.service.ts): `backend/src/services/getReasoningScoreObject.service.ts`
- [Learning feedback](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/services/summaryRemarks.service.ts): `backend/src/services/summaryRemarks.service.ts`
- [Attempt records](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/QuizAttemptsRepository.ts): `backend/src/repository/QuizAttemptsRepository.ts`
- [Quiz records](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/repository/UserQuizzesRepository.ts): `backend/src/repository/UserQuizzesRepository.ts`

### Platform services

- [Administration](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/routes/admin.route.ts): `backend/src/routes/admin.route.ts`
- [Authentication](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/middlewares/auth.middleware.ts): `backend/src/middlewares/auth.middleware.ts`
- [AI provider client](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/lib/aiClient.ts): `backend/src/lib/aiClient.ts`
- [Postgres data](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/db/db.ts): `backend/src/db/db.ts`
- [Express API](https://github.com/decastroaldwin0/quizforge/blob/main/backend/src/server.ts): `backend/src/server.ts`

### Other components

- **Teacher**
- **Student**
- **Administrator**

## Connections

- Teacher → App routing: uses
- Student → App routing: uses
- Administrator → App routing: uses (evidence: `frontend/src/app/router.jsx`)
- App routing → Sign in: routes to (evidence: `frontend/src/app/router.jsx`)
- App routing → Teacher workspace: routes to (evidence: `frontend/src/app/router.jsx`)
- App routing → Class management: routes to (evidence: `frontend/src/app/router.jsx`)
- App routing → Attempt analytics: routes to (evidence: `frontend/src/app/router.jsx`)
- App routing → Student exam: routes to (evidence: `frontend/src/app/router.jsx`)
- Teacher workspace → Document ingestion: uploads sources
- Document ingestion → Text embeddings: embeds text (evidence: `backend/src/services/fileExtract.service.ts`)
- Document ingestion → Document chunks: stores chunks (evidence: `backend/src/services/fileExtract.service.ts`)
- Teacher workspace → Quiz authoring: creates quizzes
- Quiz authoring → Question authoring: manages questions
- Teacher workspace → Class access: limits access
- Student exam → Attempt progress: saves progress (evidence: `frontend/src/features/student-quiz/pages/StudentQuizPage.jsx`)
- Student → Token access: enters token
- Token access → Attempt submission: begins attempt
- Student exam → Attempt submission: submits answers
- Attempt submission → AI grading: requests grading
- AI grading → AI provider client: calls model (evidence: `backend/src/services/getReasoningScoreObject.service.ts`)
- Attempt submission → Attempt records: records attempt
- AI grading → Learning feedback: informs feedback
- Learning feedback → AI provider client: calls model (evidence: `backend/src/services/summaryRemarks.service.ts`)
- Attempt analytics → Attempt records: reviews results
- Attempt analytics → Quiz records: shows quiz results
- Administrator → Administration: manages users
- Express API → Quiz authoring: mounts route (evidence: `backend/src/server.ts`)
- Express API → Question authoring: mounts route (evidence: `backend/src/server.ts`)
- Express API → Class access: mounts route (evidence: `backend/src/server.ts`)
- Express API → Token access: mounts route (evidence: `backend/src/server.ts`)
- Express API → Attempt submission: mounts route (evidence: `backend/src/server.ts`)
- Express API → Administration: mounts route (evidence: `backend/src/server.ts`)
- Quiz authoring → Quiz records: queries quizzes (evidence: `backend/src/routes/teacher-quiz.route.ts`)
- Quiz records → Postgres data: reads and writes (evidence: `backend/src/repository/UserQuizzesRepository.ts`)
- Attempt records → Postgres data: reads and writes (evidence: `backend/src/repository/QuizAttemptsRepository.ts`)
- Sign in → Authentication: authenticates
