# dil5hodbek/rgn-exam.uz architecture

> Architecture diagram of the GitHub repository dil5hodbek/rgn-exam.uz, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dil5hodbek/rgn-exam.uz
- Repository: https://github.com/dil5hodbek/rgn-exam.uz

## Overview

ExamFlow is an English exam platform: students browse level-based tests, take and review attempts, while staff manage content, grading, and supervised sessions. DOCX imports and Telegram account linking are additional capabilities. The graph follows only relationships explicit in the README or shown in the supplied excerpts and SOURCE INDEX; unsampled implementation is represented at its existing directory or route path, without inferred call chains.

Main entry points: [`backend/app/api/v1/router.py`](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/router.py) (API routes), [`backend/app/api/v1/attempts.py`](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/attempts.py) (Test attempts), [`backend/app/core/database.py`](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/core/database.py) (PostgreSQL data), [`backend/app/api/v1/admin.py`](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/admin.py) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_frontend["Web application"]
  node_exam_runner["Exam runner<br/>[exam-runner.tsx]"]
  node_catalog["Test catalog<br/>[catalog.py]"]
end

subgraph group_assessment["Assessment operations"]
  node_attempts["Test attempts<br/>[attempts.py]"]
  node_grading["Grading<br/>[grading.py]"]
  node_ai_grading["AI grading<br/>[ai_grading.py]"]
  node_sessions["Proctored sessions<br/>[exam_sessions.py]"]
  node_teacher_routes["Teacher review<br/>[teacher.py]"]
end

subgraph group_content["Content management"]
  node_admin_routes["Admin operations<br/>[admin.py]"]
  node_content_service["Test authoring<br/>[admin_content.py]"]
  node_docx["DOCX import<br/>[docx_import.py]"]
  node_import_tasks["Import worker<br/>[import_tasks.py]"]
end

subgraph group_platform["Platform services"]
  node_api["API application<br/>[main.py]"]
  node_api_routes["API routes<br/>[router.py]"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_security["Token security<br/>[security.py]"]
  node_database[("PostgreSQL data<br/>[database.py]")]
  node_models["Domain models<br/>[domain.py]"]
  node_redis[("Redis")]
end

subgraph group_telegram["Telegram access"]
  node_telegram_bot["Telegram bot<br/>[main.py]"]
  node_telegram_service["Telegram linking<br/>[telegram.py]"]
end

node_student(("Student"))
node_staff(("Exam staff"))

node_student -->|"uses"| node_frontend
node_staff -->|"uses"| node_frontend
node_frontend -.->|"requests"| node_api
node_api -->|"routes"| node_api_routes
node_api_routes -->|"registers"| node_auth_routes
node_api_routes -->|"registers"| node_catalog
node_api_routes -->|"registers"| node_attempts
node_api_routes -->|"registers"| node_admin_routes
node_api_routes -->|"registers"| node_sessions
node_api_routes -->|"registers"| node_teacher_routes
node_auth_routes -->|"uses"| node_security
node_catalog -->|"queries"| node_database
node_attempts -->|"reads and writes"| node_database
node_catalog -->|"loads attempt content"| node_attempts
node_attempts -->|"uses"| node_grading
node_attempts -->|"uses"| node_ai_grading
node_sessions -->|"creates attempts"| node_attempts
node_sessions -->|"reads and writes"| node_database
node_teacher_routes -->|"uses"| node_grading
node_admin_routes -->|"delegates"| node_content_service
node_admin_routes -->|"imports content"| node_docx
node_admin_routes -->|"queues imports"| node_import_tasks
node_import_tasks -->|"parses documents"| node_docx
node_content_service -->|"persists content"| node_database
node_database -.->|"maps records"| node_models
node_import_tasks -->|"queues jobs"| node_redis
node_telegram_bot -->|"links accounts"| node_telegram_service
node_telegram_service -->|"supports sign-in"| node_auth_routes
node_exam_runner -.->|"submits answers"| node_attempts

click node_frontend "https://github.com/dil5hodbek/rgn-exam.uz/tree/main/frontend/app"
click node_exam_runner "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/frontend/components/exam/exam-runner.tsx"
click node_api "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/router.py"
click node_auth_routes "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/auth.py"
click node_security "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/core/security.py"
click node_catalog "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/catalog.py"
click node_attempts "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/attempts.py"
click node_grading "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/grading.py"
click node_ai_grading "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/ai_grading.py"
click node_sessions "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/exam_sessions.py"
click node_teacher_routes "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/teacher.py"
click node_admin_routes "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/admin.py"
click node_content_service "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/admin_content.py"
click node_docx "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/docx_import.py"
click node_import_tasks "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/tasks/import_tasks.py"
click node_database "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/core/database.py"
click node_models "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/models/domain.py"
click node_telegram_bot "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/bot/main.py"
click node_telegram_service "https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/telegram.py"

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_frontend,node_exam_runner,node_catalog toneBlue
class node_attempts,node_grading,node_ai_grading,node_sessions,node_teacher_routes toneAmber
class node_admin_routes,node_content_service,node_docx,node_import_tasks toneMint
class node_api,node_api_routes,node_auth_routes,node_security,node_database,node_models,node_redis toneRose
class node_telegram_bot,node_telegram_service,node_student,node_staff toneIndigo
```

## Components

### Student experience

- [Web application](https://github.com/dil5hodbek/rgn-exam.uz/tree/main/frontend/app): `frontend/app`
- [Exam runner](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/frontend/components/exam/exam-runner.tsx): `frontend/components/exam/exam-runner.tsx`
- [Test catalog](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/catalog.py): `backend/app/api/v1/catalog.py`

### Assessment operations

- [Test attempts](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/attempts.py): `backend/app/api/v1/attempts.py`
- [Grading](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/grading.py): `backend/app/services/grading.py`
- [AI grading](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/ai_grading.py): `backend/app/services/ai_grading.py`
- [Proctored sessions](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/exam_sessions.py): `backend/app/api/v1/exam_sessions.py`
- [Teacher review](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/teacher.py): `backend/app/api/v1/teacher.py`

### Content management

- [Admin operations](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/admin.py): `backend/app/api/v1/admin.py`
- [Test authoring](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/admin_content.py): `backend/app/services/admin_content.py`
- [DOCX import](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/docx_import.py): `backend/app/services/docx_import.py`
- [Import worker](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/tasks/import_tasks.py): `backend/app/tasks/import_tasks.py`

### Platform services

- [API application](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Authentication](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Token security](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [PostgreSQL data](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Domain models](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/models/domain.py): `backend/app/models/domain.py`
- **Redis**

### Telegram access

- [Telegram bot](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/bot/main.py): `bot/main.py`
- [Telegram linking](https://github.com/dil5hodbek/rgn-exam.uz/blob/main/backend/app/services/telegram.py): `backend/app/services/telegram.py`

### Other components

- **Student**
- **Exam staff**

## Connections

- Student → Web application: uses
- Exam staff → Web application: uses
- Web application → API application: requests
- API application → API routes: routes (evidence: `backend/app/main.py`)
- API routes → Authentication: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Test catalog: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Test attempts: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Admin operations: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Proctored sessions: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Teacher review: registers (evidence: `backend/app/api/v1/router.py`)
- Authentication → Token security: uses (evidence: `backend/app/api/v1/auth.py`)
- Test catalog → PostgreSQL data: queries (evidence: `backend/app/api/v1/catalog.py`)
- Test attempts → PostgreSQL data: reads and writes (evidence: `backend/app/api/v1/attempts.py`)
- Test catalog → Test attempts: loads attempt content (evidence: `backend/app/api/v1/catalog.py`)
- Test attempts → Grading: uses (evidence: `backend/app/api/v1/attempts.py`)
- Test attempts → AI grading: uses (evidence: `backend/app/api/v1/attempts.py`)
- Proctored sessions → Test attempts: creates attempts (evidence: `backend/app/api/v1/exam_sessions.py`)
- Proctored sessions → PostgreSQL data: reads and writes (evidence: `backend/app/api/v1/exam_sessions.py`)
- Teacher review → Grading: uses (evidence: `backend/app/api/v1/teacher.py`)
- Admin operations → Test authoring: delegates (evidence: `backend/app/api/v1/admin.py`)
- Admin operations → DOCX import: imports content (evidence: `backend/app/api/v1/admin.py`)
- Admin operations → Import worker: queues imports
- Import worker → DOCX import: parses documents (evidence: `backend/app/tasks/import_tasks.py`)
- Test authoring → PostgreSQL data: persists content (evidence: `backend/app/services/admin_content.py`)
- PostgreSQL data → Domain models: maps records
- Import worker → Redis: queues jobs
- Telegram bot → Telegram linking: links accounts
- Telegram linking → Authentication: supports sign-in (evidence: `backend/app/api/v1/auth.py`)
- Exam runner → Test attempts: submits answers
