# adungm75/website architecture

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

- Interactive diagram: https://gitdiagram.com/adungm75/website
- Repository: https://github.com/adungm75/website

## Overview

Thi trắc nghiệm is a web-based exam-management and online assessment product for schools. Teachers manage academic structures and classes, create questions and exams manually, from imported files or text, or with AI, then schedule exam sessions. Learners sign in, complete required monitoring consent, take exams, and receive automatically graded results. Browser and webcam monitoring generate violations and evidence for staff review; reports and system administration support the broader workflow. The graph follows documented capabilities and sampled route/service references; several feature internals are represented by their existing directories because their source was not sampled.

Main entry points: [`server/src/attempts/attempts.service.ts`](https://github.com/adungm75/website/blob/main/server/src/attempts/attempts.service.ts) (Exam attempts), [`server/src/academic/academic.service.ts`](https://github.com/adungm75/website/blob/main/server/src/academic/academic.service.ts) (Academic setup), [`client/src/app/routes.tsx`](https://github.com/adungm75/website/blob/main/client/src/app/routes.tsx) (Routes and screens), [`server/src/exams/sessions.service.ts`](https://github.com/adungm75/website/blob/main/server/src/exams/sessions.service.ts) (Exam scheduling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["React web app<br/>[main.tsx]"]
  node_routes["Routes and screens<br/>[routes.tsx]"]
  node_learnerlayout["Learner layout<br/>[LearnerLayout.tsx]"]
  node_stafflayout["Staff layout<br/>[StaffLayout.tsx]"]
  node_screens["Screen registry<br/>[screens.ts]"]
  node_api["Express API<br/>[app.ts]"]
end

subgraph group_school["School management"]
  node_auth["Accounts and roles<br/>[auth.service.ts]"]
  node_academic["Academic setup"]
  node_classes["Classes and rosters<br/>[classes.service.ts]"]
  node_consent["Monitoring consent"]
end

subgraph group_assessment["Assessment authoring"]
  node_questions["Question bank"]
  node_imports["Import drafts<br/>[drafts.service.ts]"]
  node_ai["AI assistant"]
  node_exams["Exam authoring<br/>[exams.service.ts]"]
end

subgraph group_exam["Exam delivery"]
  node_sessions["Exam scheduling"]
  node_attempts["Exam attempts"]
  node_camera["Camera monitoring"]
  node_proctoring["Proctoring services"]
end

subgraph group_operations["Results and operations"]
  node_results["Grading and results<br/>[results.service.ts]"]
  node_reports["Reports"]
  node_system["System settings"]
  node_database[("MySQL database<br/>[prisma.ts]")]
end

node_teacher(("Teacher"))
node_learner(("Learner"))

node_teacher -->|"uses"| node_webapp
node_learner -->|"uses"| node_webapp
node_webapp -->|"loads"| node_routes
node_routes -->|"registers"| node_screens
node_routes -->|"routes learners"| node_learnerlayout
node_routes -->|"routes staff"| node_stafflayout
node_webapp -->|"uses API"| node_api
node_api -.->|"authenticates"| node_auth
node_teacher -->|"configures school"| node_academic
node_teacher -->|"manages classes"| node_classes
node_learner -->|"joins class"| node_classes
node_teacher -->|"manages questions"| node_questions
node_teacher -->|"imports content"| node_imports
node_teacher -->|"requests assistance"| node_ai
node_teacher -->|"creates exams"| node_exams
node_teacher -->|"schedules exams"| node_sessions
node_learner -->|"provides consent"| node_consent
node_learner -->|"takes exam"| node_attempts
node_attempts -->|"grades automatically"| node_results
node_attempts -->|"uses webcam"| node_camera
node_attempts -->|"sends monitoring events"| node_proctoring
node_teacher -->|"reviews violations"| node_proctoring
node_teacher -->|"views reports"| node_reports
node_teacher -->|"administers system"| node_system
node_auth -->|"uses academic data"| node_academic
node_classes -->|"checks term status"| node_academic
node_sessions -->|"loads class access"| node_classes
node_sessions -->|"uses exams"| node_exams
node_sessions -->|"uses academic data"| node_academic
node_academic -.->|"persists settings"| node_database
node_attempts -.->|"stores attempts"| node_database

click node_webapp "https://github.com/adungm75/website/blob/main/client/src/main.tsx"
click node_routes "https://github.com/adungm75/website/blob/main/client/src/app/routes.tsx"
click node_learnerlayout "https://github.com/adungm75/website/blob/main/client/src/app/layouts/LearnerLayout.tsx"
click node_stafflayout "https://github.com/adungm75/website/blob/main/client/src/app/layouts/StaffLayout.tsx"
click node_screens "https://github.com/adungm75/website/blob/main/client/src/app/screens.ts"
click node_auth "https://github.com/adungm75/website/blob/main/server/src/auth/auth.service.ts"
click node_academic "https://github.com/adungm75/website/blob/main/server/src/academic/academic.service.ts"
click node_classes "https://github.com/adungm75/website/blob/main/server/src/classes/classes.service.ts"
click node_consent "https://github.com/adungm75/website/tree/main/server/src/consent"
click node_questions "https://github.com/adungm75/website/tree/main/server/src/questions"
click node_imports "https://github.com/adungm75/website/blob/main/server/src/imports/drafts.service.ts"
click node_ai "https://github.com/adungm75/website/tree/main/server/src/ai"
click node_exams "https://github.com/adungm75/website/blob/main/server/src/exams/exams.service.ts"
click node_sessions "https://github.com/adungm75/website/blob/main/server/src/exams/sessions.service.ts"
click node_attempts "https://github.com/adungm75/website/blob/main/server/src/attempts/attempts.service.ts"
click node_camera "https://github.com/adungm75/website/tree/main/client/src/features/attempt/camera"
click node_proctoring "https://github.com/adungm75/website/tree/main/server/src/proctoring"
click node_results "https://github.com/adungm75/website/blob/main/server/src/attempts/results.service.ts"
click node_reports "https://github.com/adungm75/website/tree/main/server/src/reports"
click node_system "https://github.com/adungm75/website/tree/main/server/src/system"
click node_database "https://github.com/adungm75/website/blob/main/server/src/common/prisma.ts"
click node_api "https://github.com/adungm75/website/blob/main/server/src/app.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_routes,node_learnerlayout,node_stafflayout,node_screens,node_api toneBlue
class node_auth,node_academic,node_classes,node_consent toneAmber
class node_questions,node_imports,node_ai,node_exams toneMint
class node_sessions,node_attempts,node_camera,node_proctoring toneRose
class node_results,node_reports,node_system,node_database,node_teacher,node_learner toneIndigo
```

## Components

### Web experience

- [React web app](https://github.com/adungm75/website/blob/main/client/src/main.tsx): `client/src/main.tsx`
- [Routes and screens](https://github.com/adungm75/website/blob/main/client/src/app/routes.tsx): `client/src/app/routes.tsx`
- [Learner layout](https://github.com/adungm75/website/blob/main/client/src/app/layouts/LearnerLayout.tsx): `client/src/app/layouts/LearnerLayout.tsx`
- [Staff layout](https://github.com/adungm75/website/blob/main/client/src/app/layouts/StaffLayout.tsx): `client/src/app/layouts/StaffLayout.tsx`
- [Screen registry](https://github.com/adungm75/website/blob/main/client/src/app/screens.ts): `client/src/app/screens.ts`
- [Express API](https://github.com/adungm75/website/blob/main/server/src/app.ts): `server/src/app.ts`

### School management

- [Accounts and roles](https://github.com/adungm75/website/blob/main/server/src/auth/auth.service.ts): `server/src/auth/auth.service.ts`
- [Academic setup](https://github.com/adungm75/website/blob/main/server/src/academic/academic.service.ts): `server/src/academic/academic.service.ts`
- [Classes and rosters](https://github.com/adungm75/website/blob/main/server/src/classes/classes.service.ts): `server/src/classes/classes.service.ts`
- [Monitoring consent](https://github.com/adungm75/website/tree/main/server/src/consent): `server/src/consent`

### Assessment authoring

- [Question bank](https://github.com/adungm75/website/tree/main/server/src/questions): `server/src/questions`
- [Import drafts](https://github.com/adungm75/website/blob/main/server/src/imports/drafts.service.ts): `server/src/imports/drafts.service.ts`
- [AI assistant](https://github.com/adungm75/website/tree/main/server/src/ai): `server/src/ai`
- [Exam authoring](https://github.com/adungm75/website/blob/main/server/src/exams/exams.service.ts): `server/src/exams/exams.service.ts`

### Exam delivery

- [Exam scheduling](https://github.com/adungm75/website/blob/main/server/src/exams/sessions.service.ts): `server/src/exams/sessions.service.ts`
- [Exam attempts](https://github.com/adungm75/website/blob/main/server/src/attempts/attempts.service.ts): `server/src/attempts/attempts.service.ts`
- [Camera monitoring](https://github.com/adungm75/website/tree/main/client/src/features/attempt/camera): `client/src/features/attempt/camera`
- [Proctoring services](https://github.com/adungm75/website/tree/main/server/src/proctoring): `server/src/proctoring`

### Results and operations

- [Grading and results](https://github.com/adungm75/website/blob/main/server/src/attempts/results.service.ts): `server/src/attempts/results.service.ts`
- [Reports](https://github.com/adungm75/website/tree/main/server/src/reports): `server/src/reports`
- [System settings](https://github.com/adungm75/website/tree/main/server/src/system): `server/src/system`
- [MySQL database](https://github.com/adungm75/website/blob/main/server/src/common/prisma.ts): `server/src/common/prisma.ts`

### Other components

- **Teacher**
- **Learner**

## Connections

- Teacher → React web app: uses
- Learner → React web app: uses
- React web app → Routes and screens: loads (evidence: `client/src/main.tsx`)
- Routes and screens → Screen registry: registers (evidence: `client/src/app/routes.tsx`)
- Routes and screens → Learner layout: routes learners (evidence: `client/src/app/routes.tsx`)
- Routes and screens → Staff layout: routes staff (evidence: `client/src/app/routes.tsx`)
- React web app → Express API: uses API
- Express API → Accounts and roles: authenticates
- Teacher → Academic setup: configures school
- Teacher → Classes and rosters: manages classes
- Learner → Classes and rosters: joins class
- Teacher → Question bank: manages questions
- Teacher → Import drafts: imports content
- Teacher → AI assistant: requests assistance
- Teacher → Exam authoring: creates exams
- Teacher → Exam scheduling: schedules exams
- Learner → Monitoring consent: provides consent
- Learner → Exam attempts: takes exam
- Exam attempts → Grading and results: grades automatically
- Exam attempts → Camera monitoring: uses webcam
- Exam attempts → Proctoring services: sends monitoring events
- Teacher → Proctoring services: reviews violations
- Teacher → Reports: views reports
- Teacher → System settings: administers system
- Accounts and roles → Academic setup: uses academic data (evidence: `server/src/auth/auth.service.ts`)
- Classes and rosters → Academic setup: checks term status (evidence: `server/src/classes/classes.service.ts`)
- Exam scheduling → Classes and rosters: loads class access (evidence: `server/src/exams/sessions.service.ts`)
- Exam scheduling → Exam authoring: uses exams (evidence: `server/src/exams/sessions.service.ts`)
- Exam scheduling → Academic setup: uses academic data (evidence: `server/src/exams/sessions.service.ts`)
- Academic setup → MySQL database: persists settings (evidence: `server/src/academic/academic.service.ts`)
- Exam attempts → MySQL database: stores attempts
