# 23at/vr_demo architecture

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

- Interactive diagram: https://gitdiagram.com/23at/vr_demo
- Repository: https://github.com/23at/vr_demo

## Overview

This is a web-based training platform for administering users and training modules, assigning modules, and tracking scenario-based training progress. Users sign in, view assigned modules, and launch training; progress updates are recorded by session. Administrators manage users and modules, upload module files, and review progress. The graph separates the React interface, FastAPI request handling, domain persistence, and file delivery. Source excerpts show backend routes and selected frontend calls; connections from the API client to backend routes are not fully visible, so those links are dashed.

Main entry points: [`frontend/src/App.jsx`](https://github.com/23at/vr_demo/blob/main/frontend/src/App.jsx) (React app routes), [`backend/auth/auth_handler.py`](https://github.com/23at/vr_demo/blob/main/backend/auth/auth_handler.py) (Token and password logic), [`backend/main.py`](https://github.com/23at/vr_demo/blob/main/backend/main.py) (FastAPI application), [`frontend/src/services/api.js`](https://github.com/23at/vr_demo/blob/main/frontend/src/services/api.js) (HTTP API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["React app routes<br/>[App.jsx]"]
  node_login["Login page<br/>[login.jsx]"]
  node_dashboard["Training dashboard<br/>[dashboard.jsx]"]
  node_download["Download page<br/>[download.jsx]"]
  node_admin_home["Admin dashboard<br/>[admin.jsx]"]
  node_admin_users["User management<br/>[adminUsers.jsx]"]
  node_admin_modules["Module management<br/>[adminModules.jsx]"]
  node_api_client["HTTP API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_api_entry["FastAPI application<br/>[main.py]"]
  node_authentication["Authentication<br/>[auth.py]"]
  node_admin_routes["Admin operations<br/>[admin.py]"]
  node_module_routes["Module and scenario routes<br/>[mods.py]"]
  node_progress_routes["Progress updates<br/>[progress.py]"]
  node_user_routes["User routes<br/>[users.py]"]
end

subgraph group_domain["Training domain"]
  node_auth_logic["Token and password logic<br/>[auth_handler.py]"]
  node_domain_models["Training records<br/>[models.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_database[("Relational database<br/>[database.py]")]
end

subgraph group_delivery["Module delivery"]
  node_module_files["Module file storage<br/>[mods.py]"]
  node_object_storage[("S3-compatible storage")]
  node_static_files["Uploaded module serving<br/>[main.py]"]
end

node_trainee(("Trainee"))
node_administrator(("Administrator"))

node_trainee -->|"uses"| node_app
node_administrator -->|"uses"| node_app
node_app -->|"routes"| node_login
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_download
node_app -->|"routes"| node_admin_home
node_app -->|"routes"| node_admin_users
node_app -->|"routes"| node_admin_modules
node_login -->|"calls"| node_api_client
node_dashboard -->|"calls"| node_api_client
node_download -->|"calls"| node_api_client
node_admin_home -->|"calls"| node_api_client
node_admin_users -->|"calls"| node_api_client
node_admin_modules -->|"calls"| node_api_client
node_api_client -.->|"sends requests"| node_api_entry
node_api_entry -->|"registers"| node_authentication
node_api_entry -->|"registers"| node_module_routes
node_api_entry -->|"registers"| node_admin_routes
node_api_entry -->|"registers"| node_progress_routes
node_api_entry -->|"registers"| node_user_routes
node_authentication -->|"calls"| node_auth_logic
node_authentication -->|"queries"| node_database
node_authentication -->|"creates users"| node_domain_models
node_authentication -->|"validates"| node_schemas
node_admin_routes -->|"authenticates"| node_auth_logic
node_admin_routes -->|"queries"| node_database
node_admin_routes -->|"manages records"| node_domain_models
node_admin_routes -->|"validates"| node_schemas
node_module_routes -->|"authenticates"| node_auth_logic
node_module_routes -->|"queries"| node_database
node_module_routes -->|"manages training"| node_domain_models
node_module_routes -->|"validates"| node_schemas
node_progress_routes -->|"authenticates"| node_auth_logic
node_progress_routes -->|"queries"| node_database
node_progress_routes -->|"updates progress"| node_domain_models
node_progress_routes -->|"uses status"| node_schemas
node_user_routes -->|"authenticates"| node_auth_logic
node_user_routes -->|"uses sessions"| node_database
node_database -->|"initializes metadata"| node_domain_models
node_auth_logic -->|"queries users"| node_database
node_auth_logic -->|"loads users"| node_domain_models
node_auth_logic -->|"creates token data"| node_schemas
node_module_routes -->|"uploads and signs"| node_object_storage
node_api_entry -->|"mounts"| node_static_files
node_static_files -.->|"serves uploaded files"| node_module_files

click node_app "https://github.com/23at/vr_demo/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/login.jsx"
click node_dashboard "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/dashboard.jsx"
click node_download "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/download.jsx"
click node_admin_home "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/admin.jsx"
click node_admin_users "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/adminUsers.jsx"
click node_admin_modules "https://github.com/23at/vr_demo/blob/main/frontend/src/pages/adminModules.jsx"
click node_api_client "https://github.com/23at/vr_demo/blob/main/frontend/src/services/api.js"
click node_api_entry "https://github.com/23at/vr_demo/blob/main/backend/main.py"
click node_authentication "https://github.com/23at/vr_demo/blob/main/backend/routers/auth.py"
click node_admin_routes "https://github.com/23at/vr_demo/blob/main/backend/routers/admin.py"
click node_module_routes "https://github.com/23at/vr_demo/blob/main/backend/routers/mods.py"
click node_progress_routes "https://github.com/23at/vr_demo/blob/main/backend/routers/progress.py"
click node_user_routes "https://github.com/23at/vr_demo/blob/main/backend/routers/users.py"
click node_auth_logic "https://github.com/23at/vr_demo/blob/main/backend/auth/auth_handler.py"
click node_domain_models "https://github.com/23at/vr_demo/blob/main/backend/models.py"
click node_schemas "https://github.com/23at/vr_demo/blob/main/backend/schemas.py"
click node_database "https://github.com/23at/vr_demo/blob/main/backend/database.py"
click node_module_files "https://github.com/23at/vr_demo/blob/main/backend/routers/mods.py"
click node_static_files "https://github.com/23at/vr_demo/blob/main/backend/main.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_app,node_login,node_dashboard,node_download,node_admin_home,node_admin_users,node_admin_modules,node_api_client toneBlue
class node_api_entry,node_authentication,node_admin_routes,node_module_routes,node_progress_routes,node_user_routes toneAmber
class node_auth_logic,node_domain_models,node_schemas,node_database toneMint
class node_module_files,node_object_storage,node_static_files toneRose
class node_trainee,node_administrator toneIndigo
```

## Components

### Web interface

- [React app routes](https://github.com/23at/vr_demo/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login page](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/login.jsx): `frontend/src/pages/login.jsx`
- [Training dashboard](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/dashboard.jsx): `frontend/src/pages/dashboard.jsx`
- [Download page](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/download.jsx): `frontend/src/pages/download.jsx`
- [Admin dashboard](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/admin.jsx): `frontend/src/pages/admin.jsx`
- [User management](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/adminUsers.jsx): `frontend/src/pages/adminUsers.jsx`
- [Module management](https://github.com/23at/vr_demo/blob/main/frontend/src/pages/adminModules.jsx): `frontend/src/pages/adminModules.jsx`
- [HTTP API client](https://github.com/23at/vr_demo/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [FastAPI application](https://github.com/23at/vr_demo/blob/main/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/23at/vr_demo/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Admin operations](https://github.com/23at/vr_demo/blob/main/backend/routers/admin.py): `backend/routers/admin.py`
- [Module and scenario routes](https://github.com/23at/vr_demo/blob/main/backend/routers/mods.py): `backend/routers/mods.py`
- [Progress updates](https://github.com/23at/vr_demo/blob/main/backend/routers/progress.py): `backend/routers/progress.py`
- [User routes](https://github.com/23at/vr_demo/blob/main/backend/routers/users.py): `backend/routers/users.py`

### Training domain

- [Token and password logic](https://github.com/23at/vr_demo/blob/main/backend/auth/auth_handler.py): `backend/auth/auth_handler.py`
- [Training records](https://github.com/23at/vr_demo/blob/main/backend/models.py): `backend/models.py`
- [Request and response schemas](https://github.com/23at/vr_demo/blob/main/backend/schemas.py): `backend/schemas.py`
- [Relational database](https://github.com/23at/vr_demo/blob/main/backend/database.py): `backend/database.py`

### Module delivery

- [Module file storage](https://github.com/23at/vr_demo/blob/main/backend/routers/mods.py): `backend/routers/mods.py`
- **S3-compatible storage**
- [Uploaded module serving](https://github.com/23at/vr_demo/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Trainee**
- **Administrator**

## Connections

- Trainee → React app routes: uses (evidence: `frontend/src/App.jsx`)
- Administrator → React app routes: uses (evidence: `frontend/src/App.jsx`)
- React app routes → Login page: routes (evidence: `frontend/src/App.jsx`)
- React app routes → Training dashboard: routes (evidence: `frontend/src/App.jsx`)
- React app routes → Download page: routes (evidence: `frontend/src/App.jsx`)
- React app routes → Admin dashboard: routes (evidence: `frontend/src/App.jsx`)
- React app routes → User management: routes (evidence: `frontend/src/App.jsx`)
- React app routes → Module management: routes (evidence: `frontend/src/App.jsx`)
- Login page → HTTP API client: calls (evidence: `frontend/src/pages/login.jsx`)
- Training dashboard → HTTP API client: calls (evidence: `frontend/src/pages/dashboard.jsx`)
- Download page → HTTP API client: calls (evidence: `frontend/src/pages/download.jsx`)
- Admin dashboard → HTTP API client: calls (evidence: `frontend/src/pages/admin.jsx`)
- User management → HTTP API client: calls (evidence: `frontend/src/pages/adminUsers.jsx`)
- Module management → HTTP API client: calls (evidence: `frontend/src/pages/adminModules.jsx`)
- HTTP API client → FastAPI application: sends requests
- FastAPI application → Authentication: registers (evidence: `backend/main.py`)
- FastAPI application → Module and scenario routes: registers (evidence: `backend/main.py`)
- FastAPI application → Admin operations: registers (evidence: `backend/main.py`)
- FastAPI application → Progress updates: registers (evidence: `backend/main.py`)
- FastAPI application → User routes: registers (evidence: `backend/main.py`)
- Authentication → Token and password logic: calls (evidence: `backend/routers/auth.py`)
- Authentication → Relational database: queries (evidence: `backend/routers/auth.py`)
- Authentication → Training records: creates users (evidence: `backend/routers/auth.py`)
- Authentication → Request and response schemas: validates (evidence: `backend/routers/auth.py`)
- Admin operations → Token and password logic: authenticates (evidence: `backend/routers/admin.py`)
- Admin operations → Relational database: queries (evidence: `backend/routers/admin.py`)
- Admin operations → Training records: manages records (evidence: `backend/routers/admin.py`)
- Admin operations → Request and response schemas: validates (evidence: `backend/routers/admin.py`)
- Module and scenario routes → Token and password logic: authenticates (evidence: `backend/routers/mods.py`)
- Module and scenario routes → Relational database: queries (evidence: `backend/routers/mods.py`)
- Module and scenario routes → Training records: manages training (evidence: `backend/routers/mods.py`)
- Module and scenario routes → Request and response schemas: validates (evidence: `backend/routers/mods.py`)
- Progress updates → Token and password logic: authenticates (evidence: `backend/routers/progress.py`)
- Progress updates → Relational database: queries (evidence: `backend/routers/progress.py`)
- Progress updates → Training records: updates progress (evidence: `backend/routers/progress.py`)
- Progress updates → Request and response schemas: uses status (evidence: `backend/routers/progress.py`)
- User routes → Token and password logic: authenticates (evidence: `backend/routers/users.py`)
- User routes → Relational database: uses sessions (evidence: `backend/routers/users.py`)
- Relational database → Training records: initializes metadata (evidence: `backend/database.py`)
- Token and password logic → Relational database: queries users (evidence: `backend/auth/auth_handler.py`)
- Token and password logic → Training records: loads users (evidence: `backend/auth/auth_handler.py`)
- Token and password logic → Request and response schemas: creates token data (evidence: `backend/auth/auth_handler.py`)
- Module and scenario routes → S3-compatible storage: uploads and signs (evidence: `backend/routers/mods.py`)
- FastAPI application → Uploaded module serving: mounts (evidence: `backend/main.py`)
- Uploaded module serving → Module file storage: serves uploaded files (evidence: `backend/main.py`)
