# anddr28/112-project architecture

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

- Interactive diagram: https://gitdiagram.com/anddr28/112-project
- Repository: https://github.com/anddr28/112-project

## Overview

This is a role-based training simulator for emergency dispatchers: teachers manage scenarios and lessons, students complete assigned exercises in a simulated 112 workstation, and results are evaluated for review. The graph preserves the documented AI call simulation, scenario management, dispatch workflow, service-status handling, and assessment/reporting capabilities. Frontend routing and selected API calls are evidenced by excerpts; backend domain links and some UI-to-feature relationships are not sampled, so those connections are omitted or marked unverified.

Main entry points: [`frontend/src/app/router.tsx`](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/app/router.tsx) (Role Routes), [`frontend/src/shared/api/index.ts`](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/shared/api/index.ts) (API Selector), [`frontend/src/pages/student/Arm112Page.tsx`](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/Arm112Page.tsx) (112 Workstation), [`go-core/internal/evaluation`](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/evaluation) (Evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and API"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_role_routes["Role Routes<br/>[router.tsx]"]
  node_api["API Selector<br/>[index.ts]"]
  node_http_api["HTTP API<br/>[httpApi.ts]"]
end

subgraph group_teaching["Training Management"]
  node_scenario_editor["Scenario Editor<br/>[ScenarioEditor.tsx]"]
  node_scenario_service["Scenario Management"]
  node_lesson_pages["Lesson Management<br/>[LessonListPage.tsx]"]
  node_lesson_service["Lesson Service"]
  node_student_lesson["Student Lessons"]
end

subgraph group_dispatch["Dispatch Simulation"]
  node_incoming_call["Incoming Call"]
  node_workstation["112 Workstation<br/>[Arm112Page.tsx]"]
  node_incident_card["Incident Card<br/>[IncidentCard.tsx]"]
  node_attempt_runtime["Attempt Runtime"]
  node_service_status["Service Status<br/>[ServicesBar.tsx]"]
  node_dds_workspace["DDS Workspace<br/>[DdsWorkspace.tsx]"]
  node_dialogue["Dialogue Engine"]
  node_ai_jobs["AI Jobs"]
end

subgraph group_assessment["Assessment and Operations"]
  node_evaluation["Evaluation"]
  node_evaluation_view["Evaluation View<br/>[EvaluationView.tsx]"]
  node_attempt_report["Attempt Report"]
  node_scoring["Scoring"]
  node_database[("Persistent Data")]
end

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

node_teacher -->|"opens workspace"| node_role_routes
node_student -->|"opens workspace"| node_role_routes
node_admin -->|"opens workspace"| node_role_routes
node_role_routes -.->|"routes to"| node_scenario_editor
node_role_routes -->|"routes to"| node_lesson_pages
node_role_routes -->|"routes to"| node_student_lesson
node_role_routes -->|"routes to"| node_incoming_call
node_role_routes -->|"routes to"| node_workstation
node_role_routes -->|"routes to"| node_attempt_report
node_role_routes -->|"checks role"| node_auth
node_auth -->|"requests session"| node_api
node_api -->|"selects HTTP"| node_http_api
node_workstation -.->|"presents dispatch"| node_incident_card
node_workstation -.->|"tracks attempt"| node_attempt_runtime
node_attempt_runtime -->|"saves draft"| node_api
node_attempt_runtime -->|"posts events"| node_api
node_service_status -->|"updates status"| node_api
node_dds_workspace -->|"uses status panel"| node_service_status
node_student -->|"receives simulated call"| node_incoming_call
node_scenario_editor -.->|"manages scenarios"| node_scenario_service
node_lesson_pages -.->|"manages lessons"| node_lesson_service
node_incoming_call -.->|"simulates dialogue"| node_dialogue
node_dialogue -.->|"requests AI work"| node_ai_jobs
node_workstation -.->|"submits work for assessment"| node_evaluation
node_evaluation -.->|"scores actions"| node_scoring
node_evaluation -.->|"persists results"| node_database
node_evaluation -.->|"provides results"| node_evaluation_view
node_evaluation_view -.->|"supports review"| node_attempt_report
node_teacher -->|"reviews results"| node_attempt_report

click node_auth "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/app/auth.ts"
click node_role_routes "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/app/router.tsx"
click node_api "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/shared/api/index.ts"
click node_http_api "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/shared/api/httpApi.ts"
click node_scenario_editor "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/scenario/ScenarioEditor.tsx"
click node_scenario_service "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/scenarios"
click node_lesson_pages "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/teacher/LessonListPage.tsx"
click node_lesson_service "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/lessons"
click node_student_lesson "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/StudentLessonPage.tsx"
click node_incoming_call "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/IncomingCallPage.tsx"
click node_workstation "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/Arm112Page.tsx"
click node_incident_card "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/incident-card/IncidentCard.tsx"
click node_attempt_runtime "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/attempt-runtime/useAttemptRuntime.ts"
click node_service_status "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/incident-card/ServicesBar.tsx"
click node_dds_workspace "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/dds/DdsWorkspace.tsx"
click node_dialogue "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/dialogue"
click node_ai_jobs "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/aijobs"
click node_evaluation "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/evaluation"
click node_evaluation_view "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/evaluation/EvaluationView.tsx"
click node_attempt_report "https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/teacher/AttemptReportPage.tsx"
click node_scoring "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/scoring"
click node_database "https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/store"

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_auth,node_role_routes,node_api,node_http_api toneBlue
class node_scenario_editor,node_scenario_service,node_lesson_pages,node_lesson_service,node_student_lesson toneAmber
class node_incoming_call,node_workstation,node_incident_card,node_attempt_runtime,node_service_status,node_dds_workspace,node_dialogue,node_ai_jobs toneMint
class node_evaluation,node_evaluation_view,node_attempt_report,node_scoring,node_database toneRose
class node_teacher,node_student,node_admin toneIndigo
```

## Components

### Access and API

- [Authentication](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/app/auth.ts): `frontend/src/app/auth.ts`
- [Role Routes](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [API Selector](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/shared/api/index.ts): `frontend/src/shared/api/index.ts`
- [HTTP API](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/shared/api/httpApi.ts): `frontend/src/shared/api/httpApi.ts`

### Training Management

- [Scenario Editor](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/scenario/ScenarioEditor.tsx): `frontend/src/features/scenario/ScenarioEditor.tsx`
- [Scenario Management](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/scenarios): `go-core/internal/scenarios`
- [Lesson Management](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/teacher/LessonListPage.tsx): `frontend/src/pages/teacher/LessonListPage.tsx`
- [Lesson Service](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/lessons): `go-core/internal/lessons`
- [Student Lessons](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/StudentLessonPage.tsx): `frontend/src/pages/student/StudentLessonPage.tsx`

### Dispatch Simulation

- [Incoming Call](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/IncomingCallPage.tsx): `frontend/src/pages/student/IncomingCallPage.tsx`
- [112 Workstation](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/student/Arm112Page.tsx): `frontend/src/pages/student/Arm112Page.tsx`
- [Incident Card](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/incident-card/IncidentCard.tsx): `frontend/src/features/incident-card/IncidentCard.tsx`
- [Attempt Runtime](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/attempt-runtime/useAttemptRuntime.ts): `frontend/src/features/attempt-runtime/useAttemptRuntime.ts`
- [Service Status](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/incident-card/ServicesBar.tsx): `frontend/src/features/incident-card/ServicesBar.tsx`
- [DDS Workspace](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/dds/DdsWorkspace.tsx): `frontend/src/features/dds/DdsWorkspace.tsx`
- [Dialogue Engine](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/dialogue): `go-core/internal/dialogue`
- [AI Jobs](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/aijobs): `go-core/internal/aijobs`

### Assessment and Operations

- [Evaluation](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/evaluation): `go-core/internal/evaluation`
- [Evaluation View](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/features/evaluation/EvaluationView.tsx): `frontend/src/features/evaluation/EvaluationView.tsx`
- [Attempt Report](https://github.com/anddr28/112-project/blob/feat/frontend-arm112/frontend/src/pages/teacher/AttemptReportPage.tsx): `frontend/src/pages/teacher/AttemptReportPage.tsx`
- [Scoring](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/scoring): `go-core/internal/scoring`
- [Persistent Data](https://github.com/anddr28/112-project/tree/feat/frontend-arm112/go-core/internal/store): `go-core/internal/store`

### Other components

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

## Connections

- Teacher → Role Routes: opens workspace (evidence: `frontend/src/app/router.tsx`)
- Student → Role Routes: opens workspace (evidence: `frontend/src/app/router.tsx`)
- Administrator → Role Routes: opens workspace (evidence: `frontend/src/app/router.tsx`)
- Role Routes → Scenario Editor: routes to
- Role Routes → Lesson Management: routes to (evidence: `frontend/src/app/router.tsx`)
- Role Routes → Student Lessons: routes to (evidence: `frontend/src/app/router.tsx`)
- Role Routes → Incoming Call: routes to (evidence: `frontend/src/app/router.tsx`)
- Role Routes → 112 Workstation: routes to (evidence: `frontend/src/app/router.tsx`)
- Role Routes → Attempt Report: routes to (evidence: `frontend/src/app/router.tsx`)
- Role Routes → Authentication: checks role (evidence: `frontend/src/app/router.tsx`)
- Authentication → API Selector: requests session (evidence: `frontend/src/app/auth.ts`)
- API Selector → HTTP API: selects HTTP (evidence: `frontend/src/shared/api/index.ts`)
- 112 Workstation → Incident Card: presents dispatch
- 112 Workstation → Attempt Runtime: tracks attempt
- Attempt Runtime → API Selector: saves draft (evidence: `frontend/src/features/attempt-runtime/useAttemptRuntime.ts`)
- Attempt Runtime → API Selector: posts events (evidence: `frontend/src/features/attempt-runtime/useAttemptRuntime.ts`)
- Service Status → API Selector: updates status (evidence: `frontend/src/features/incident-card/ServicesBar.tsx`)
- DDS Workspace → Service Status: uses status panel
- Student → Incoming Call: receives simulated call
- Scenario Editor → Scenario Management: manages scenarios
- Lesson Management → Lesson Service: manages lessons
- Incoming Call → Dialogue Engine: simulates dialogue
- Dialogue Engine → AI Jobs: requests AI work
- 112 Workstation → Evaluation: submits work for assessment
- Evaluation → Scoring: scores actions
- Evaluation → Persistent Data: persists results
- Evaluation → Evaluation View: provides results
- Evaluation View → Attempt Report: supports review
- Teacher → Attempt Report: reviews results
