# im-rk/skilltrace architecture

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

- Interactive diagram: https://gitdiagram.com/im-rk/skilltrace
- Repository: https://github.com/im-rk/skilltrace

## Overview

SkillTrace is an adaptive-practice and timed-exam platform. Students answer practice or exam questions; answers are graded and update a shared Bayesian mastery estimate, which drives practice difficulty and student progress. Instructors manage skills and questions, configure exams, and review results and audit trails. The graph preserves documented capabilities while showing sampled backend calls where available; several frontend-to-API links and unsampled subsystems are documented or implied but not verified in the excerpts.

Main entry points: [`backend/app/modules/quiz_engine/service.py`](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/service.py) (Adaptive practice), [`backend/app/modules/question_bank/service.py`](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/question_bank/service.py) (Question bank), [`backend/app/modules/scheduling/service.py`](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/scheduling/service.py) (Exam scheduling), [`backend/app/modules/live_session_gateway/ws_routes.py`](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/live_session_gateway/ws_routes.py) (Exam WebSocket)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Student learning"]
  node_practice_ui["Practice and progress<br/>[page.tsx]"]
  node_practice_api["Practice API<br/>[api.py]"]
  node_practice_service["Adaptive practice<br/>[service.py]"]
  node_bkt["BKT mastery<br/>[engine.py]"]
  node_progress_ui["Progress views<br/>[page.tsx]"]
end

subgraph group_authoring["Instructor authoring"]
  node_authoring_ui["Question and skill admin<br/>[page.tsx]"]
  node_question_bank["Question bank<br/>[service.py]"]
  node_ai_generation["AI question drafts<br/>[llm_generation.py]"]
end

subgraph group_exams["Exam delivery"]
  node_exam_admin_ui["Exam administration<br/>[page.tsx]"]
  node_scheduling["Exam scheduling<br/>[service.py]"]
  node_enrollment["Code enrollment<br/>[service.py]"]
  node_exam_ui["Timed exam client<br/>[page.tsx]"]
  node_ws_routes["Exam WebSocket<br/>[ws_routes.py]"]
  node_ws_manager["Connection and broadcast"]
  node_evaluation["Answer evaluation<br/>[tasks.py]"]
  node_results["Exam results and analysis<br/>[service.py]"]
end

subgraph group_platform["Platform services"]
  node_iam["Identity and access<br/>[service.py]"]
  node_postgres[("PostgreSQL")]
  node_redis[("Redis")]
end

node_student(("Student"))
node_instructor(("Instructor"))

node_student -->|"answers"| node_practice_ui
node_practice_ui -.->|"requests practice"| node_practice_api
node_practice_api -.->|"routes to"| node_practice_service
node_practice_service -->|"updates mastery"| node_bkt
node_practice_service -->|"gets questions"| node_question_bank
node_practice_service -.->|"returns progress"| node_progress_ui
node_student -->|"views mastery"| node_progress_ui
node_instructor -->|"authors questions"| node_authoring_ui
node_authoring_ui -.->|"manages content"| node_question_bank
node_question_bank -.->|"offers drafts"| node_ai_generation
node_instructor -->|"configures exams"| node_exam_admin_ui
node_exam_admin_ui -.->|"schedules exams"| node_scheduling
node_scheduling -->|"retrieves questions"| node_question_bank
node_student -->|"takes exam"| node_exam_ui
node_exam_ui -.->|"opens session"| node_ws_routes
node_ws_routes -->|"registers connection"| node_ws_manager
node_ws_routes -->|"checks access"| node_enrollment
node_ws_routes -.->|"relays answers"| node_evaluation
node_scheduling -->|"requests refresh"| node_results
node_evaluation -->|"updates mastery"| node_bkt
node_evaluation -->|"loads questions"| node_question_bank
node_evaluation -.->|"uses streams"| node_redis
node_practice_service -.->|"persists state"| node_postgres
node_scheduling -->|"acquires locks"| node_redis
node_results -.->|"reads results"| node_postgres
node_iam -.->|"stores accounts"| node_postgres

click node_practice_ui "https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/practice/page.tsx"
click node_practice_api "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/api.py"
click node_practice_service "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/service.py"
click node_bkt "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/domain/bkt/engine.py"
click node_progress_ui "https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/progress/page.tsx"
click node_authoring_ui "https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/admin/skills/page.tsx"
click node_question_bank "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/question_bank/service.py"
click node_ai_generation "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/question_bank/llm_generation.py"
click node_exam_admin_ui "https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/admin/exams/page.tsx"
click node_scheduling "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/scheduling/service.py"
click node_enrollment "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/enrollment/service.py"
click node_exam_ui "https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/exams/%5BexamId%5D/page.tsx"
click node_ws_routes "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/live_session_gateway/ws_routes.py"
click node_ws_manager "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/live_session_gateway/websocket_manager.py"
click node_evaluation "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/evaluation_pipeline/tasks.py"
click node_results "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/results/service.py"
click node_iam "https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/iam/service.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_practice_ui,node_practice_api,node_practice_service,node_bkt,node_progress_ui toneBlue
class node_authoring_ui,node_question_bank,node_ai_generation toneAmber
class node_exam_admin_ui,node_scheduling,node_enrollment,node_exam_ui,node_ws_routes,node_ws_manager,node_evaluation,node_results toneMint
class node_iam,node_postgres,node_redis toneRose
class node_student,node_instructor toneIndigo
```

## Components

### Student learning

- [Practice and progress](https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/practice/page.tsx): `frontend/src/app/practice/page.tsx`
- [Practice API](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/api.py): `backend/app/modules/quiz_engine/api.py`
- [Adaptive practice](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/service.py): `backend/app/modules/quiz_engine/service.py`
- [BKT mastery](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/quiz_engine/domain/bkt/engine.py): `backend/app/modules/quiz_engine/domain/bkt/engine.py`
- [Progress views](https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/progress/page.tsx): `frontend/src/app/progress/page.tsx`

### Instructor authoring

- [Question and skill admin](https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/admin/skills/page.tsx): `frontend/src/app/admin/skills/page.tsx`
- [Question bank](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/question_bank/service.py): `backend/app/modules/question_bank/service.py`
- [AI question drafts](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/question_bank/llm_generation.py): `backend/app/modules/question_bank/llm_generation.py`

### Exam delivery

- [Exam administration](https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/admin/exams/page.tsx): `frontend/src/app/admin/exams/page.tsx`
- [Exam scheduling](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/scheduling/service.py): `backend/app/modules/scheduling/service.py`
- [Code enrollment](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/enrollment/service.py): `backend/app/modules/enrollment/service.py`
- [Timed exam client](https://github.com/im-rk/skilltrace/blob/development/frontend/src/app/exams/%5BexamId%5D/page.tsx): `frontend/src/app/exams/[examId]/page.tsx`
- [Exam WebSocket](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/live_session_gateway/ws_routes.py): `backend/app/modules/live_session_gateway/ws_routes.py`
- [Connection and broadcast](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/live_session_gateway/websocket_manager.py): `backend/app/modules/live_session_gateway/websocket_manager.py`
- [Answer evaluation](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/evaluation_pipeline/tasks.py): `backend/app/modules/evaluation_pipeline/tasks.py`
- [Exam results and analysis](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/results/service.py): `backend/app/modules/results/service.py`

### Platform services

- [Identity and access](https://github.com/im-rk/skilltrace/blob/development/backend/app/modules/iam/service.py): `backend/app/modules/iam/service.py`
- **PostgreSQL**
- **Redis**

### Other components

- **Student**
- **Instructor**

## Connections

- Student → Practice and progress: answers
- Practice and progress → Practice API: requests practice
- Practice API → Adaptive practice: routes to
- Adaptive practice → BKT mastery: updates mastery (evidence: `backend/app/modules/quiz_engine/service.py`)
- Adaptive practice → Question bank: gets questions (evidence: `backend/app/modules/quiz_engine/service.py`)
- Adaptive practice → Progress views: returns progress
- Student → Progress views: views mastery
- Instructor → Question and skill admin: authors questions
- Question and skill admin → Question bank: manages content
- Question bank → AI question drafts: offers drafts
- Instructor → Exam administration: configures exams
- Exam administration → Exam scheduling: schedules exams
- Exam scheduling → Question bank: retrieves questions (evidence: `backend/app/modules/scheduling/service.py`)
- Student → Timed exam client: takes exam
- Timed exam client → Exam WebSocket: opens session
- Exam WebSocket → Connection and broadcast: registers connection (evidence: `backend/app/modules/live_session_gateway/ws_routes.py`)
- Exam WebSocket → Code enrollment: checks access (evidence: `backend/app/modules/live_session_gateway/ws_routes.py`)
- Exam WebSocket → Answer evaluation: relays answers (evidence: `backend/app/modules/live_session_gateway/ws_routes.py`)
- Exam scheduling → Exam results and analysis: requests refresh (evidence: `backend/app/modules/scheduling/service.py`)
- Answer evaluation → BKT mastery: updates mastery (evidence: `backend/app/modules/evaluation_pipeline/tasks.py`)
- Answer evaluation → Question bank: loads questions (evidence: `backend/app/modules/evaluation_pipeline/tasks.py`)
- Answer evaluation → Redis: uses streams (evidence: `backend/app/modules/evaluation_pipeline/tasks.py`)
- Adaptive practice → PostgreSQL: persists state
- Exam scheduling → Redis: acquires locks (evidence: `backend/app/modules/scheduling/service.py`)
- Exam results and analysis → PostgreSQL: reads results
- Identity and access → PostgreSQL: stores accounts
