# belheroth/the-verity architecture

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

- Interactive diagram: https://gitdiagram.com/belheroth/the-verity
- Repository: https://github.com/belheroth/the-verity

## Overview

The Verity is presented in the package metadata as a secure examination and learning-management platform. Its visible user workflow is authentication, role-specific classroom and course activity, assignment submissions, and teacher grading or proctoring; administrators have separate management screens. The frontend is routed through App, while server/server.js owns HTTP endpoints and uses a database abstraction. The tree also shows offline mutation syncing and Electron exam lockdown. The README is only the Vite template, and sampled source is partial, so some feature wiring and integrations are not represented.

Main entry points: [`frontend/src/App.jsx`](https://github.com/belheroth/the-verity/blob/main/frontend/src/App.jsx) (App router), [`frontend/src/utils/api.js`](https://github.com/belheroth/the-verity/blob/main/frontend/src/utils/api.js) (HTTP client), [`frontend/src/services/syncService.js`](https://github.com/belheroth/the-verity/blob/main/frontend/src/services/syncService.js) (Offline sync), [`electron/main.cjs`](https://github.com/belheroth/the-verity/blob/main/electron/main.cjs) (Electron runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App router<br/>[App.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
end

subgraph group_learning["Learning workflow"]
  node_auth["Sign in / register<br/>[Login.jsx]"]
  node_student["Student workspace"]
  node_teacher["Teacher workspace"]
  node_classroom["Classroom activity<br/>[ClassroomView.jsx]"]
  node_classwork["Assignments"]
  node_grading["Submissions and grading<br/>[TeacherGrading.jsx]"]
  node_proctoring["Exam proctoring<br/>[TeacherView.jsx]"]
  node_admin["Admin management<br/>[AdminLayout.jsx]"]
end

subgraph group_operations["Platform services"]
  node_server["API server<br/>[server.js]"]
  node_dbapi["Database adapter<br/>[index.js]"]
  node_database[("Application database<br/>[database.js]")]
  node_sync["Offline sync<br/>[syncService.js]"]
  node_localstore["Local store<br/>[localStore.js]"]
  node_email["Email delivery<br/>[emailService.js]"]
end

subgraph group_desktop["Desktop security"]
  node_desktop["Electron runtime<br/>[main.cjs]"]
  node_localdb[("Desktop local DB<br/>[local-db.cjs]")]
  node_native["Kiosk lock hook<br/>[KioskLockHook.cs]"]
end

node_user(("Student / teacher"))
node_mailservice(("SMTP service"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_student
node_app -->|"routes to"| node_teacher
node_app -->|"routes to"| node_classroom
node_app -->|"routes to"| node_proctoring
node_app -->|"routes to"| node_admin
node_app -->|"calls"| node_api
node_api -->|"sends requests"| node_server
node_server -->|"queries"| node_dbapi
node_dbapi -->|"reads / writes"| node_database
node_sync -->|"reads queue"| node_localstore
node_sync -->|"replays requests"| node_api
node_desktop -->|"handles IPC"| node_localdb
node_desktop -->|"controls lockdown"| node_native
node_email -.->|"sends mail"| node_mailservice

click node_app "https://github.com/belheroth/the-verity/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/Login.jsx"
click node_student "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/StudentDashboard.jsx"
click node_teacher "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherDashboard.jsx"
click node_classroom "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/ClassroomView.jsx"
click node_classwork "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherClasswork.jsx"
click node_grading "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherGrading.jsx"
click node_proctoring "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherView.jsx"
click node_admin "https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/admin/AdminLayout.jsx"
click node_api "https://github.com/belheroth/the-verity/blob/main/frontend/src/utils/api.js"
click node_server "https://github.com/belheroth/the-verity/blob/main/server/server.js"
click node_dbapi "https://github.com/belheroth/the-verity/blob/main/server/db/index.js"
click node_database "https://github.com/belheroth/the-verity/blob/main/server/database.js"
click node_sync "https://github.com/belheroth/the-verity/blob/main/frontend/src/services/syncService.js"
click node_localstore "https://github.com/belheroth/the-verity/blob/main/frontend/src/services/localStore.js"
click node_desktop "https://github.com/belheroth/the-verity/blob/main/electron/main.cjs"
click node_localdb "https://github.com/belheroth/the-verity/blob/main/electron/local-db.cjs"
click node_native "https://github.com/belheroth/the-verity/blob/main/native/KioskLockHook.cs"
click node_email "https://github.com/belheroth/the-verity/blob/main/server/utils/emailService.js"

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_api toneBlue
class node_auth,node_student,node_teacher,node_classroom,node_classwork,node_grading,node_proctoring,node_admin toneAmber
class node_server,node_dbapi,node_database,node_sync,node_localstore,node_email toneMint
class node_desktop,node_localdb,node_native toneRose
class node_user,node_mailservice toneIndigo
```

## Components

### Web application

- [App router](https://github.com/belheroth/the-verity/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP client](https://github.com/belheroth/the-verity/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Learning workflow

- [Sign in / register](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Student workspace](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/StudentDashboard.jsx): `frontend/src/pages/StudentDashboard.jsx`
- [Teacher workspace](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherDashboard.jsx): `frontend/src/pages/TeacherDashboard.jsx`
- [Classroom activity](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/ClassroomView.jsx): `frontend/src/pages/ClassroomView.jsx`
- [Assignments](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherClasswork.jsx): `frontend/src/pages/TeacherClasswork.jsx`
- [Submissions and grading](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherGrading.jsx): `frontend/src/pages/TeacherGrading.jsx`
- [Exam proctoring](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/TeacherView.jsx): `frontend/src/pages/TeacherView.jsx`
- [Admin management](https://github.com/belheroth/the-verity/blob/main/frontend/src/pages/admin/AdminLayout.jsx): `frontend/src/pages/admin/AdminLayout.jsx`

### Platform services

- [API server](https://github.com/belheroth/the-verity/blob/main/server/server.js): `server/server.js`
- [Database adapter](https://github.com/belheroth/the-verity/blob/main/server/db/index.js): `server/db/index.js`
- [Application database](https://github.com/belheroth/the-verity/blob/main/server/database.js): `server/database.js`
- [Offline sync](https://github.com/belheroth/the-verity/blob/main/frontend/src/services/syncService.js): `frontend/src/services/syncService.js`
- [Local store](https://github.com/belheroth/the-verity/blob/main/frontend/src/services/localStore.js): `frontend/src/services/localStore.js`
- [Email delivery](https://github.com/belheroth/the-verity/blob/main/server/utils/emailService.js): `server/utils/emailService.js`

### Desktop security

- [Electron runtime](https://github.com/belheroth/the-verity/blob/main/electron/main.cjs): `electron/main.cjs`
- [Desktop local DB](https://github.com/belheroth/the-verity/blob/main/electron/local-db.cjs): `electron/local-db.cjs`
- [Kiosk lock hook](https://github.com/belheroth/the-verity/blob/main/native/KioskLockHook.cs): `native/KioskLockHook.cs`

### Other components

- **Student / teacher**
- **SMTP service**

## Connections

- Student / teacher → App router: uses
- App router → Sign in / register: routes to
- App router → Student workspace: routes to
- App router → Teacher workspace: routes to
- App router → Classroom activity: routes to
- App router → Exam proctoring: routes to
- App router → Admin management: routes to
- App router → HTTP client: calls
- HTTP client → API server: sends requests
- API server → Database adapter: queries
- Database adapter → Application database: reads / writes
- Offline sync → Local store: reads queue
- Offline sync → HTTP client: replays requests
- Electron runtime → Desktop local DB: handles IPC
- Electron runtime → Kiosk lock hook: controls lockdown
- Email delivery → SMTP service: sends mail
