# marwan-6455/dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/marwan-6455/dashboard
- Repository: https://github.com/marwan-6455/dashboard

## Overview

Cindermarch Engine Hub is an internal development-management platform for Terminal 6. Developers and reviewers use its dashboard or Discord commands to manage tasks, submit reviews and verification evidence, and track completion; six backend gates enforce verified completion. The graph includes the documented project, team, asset, knowledge, reporting, and administration capabilities. Several route and service relationships are shown only where the excerpts, SOURCE INDEX, or README establish them; unsampled subsystem internals are represented at their exact directories.

Main entry points: [`backend/src/routes/botRoutes.ts`](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/botRoutes.ts) (Bot endpoints), [`backend/src/services/taskService.ts`](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/taskService.ts) (Task management), [`frontend/src/pages`](https://github.com/marwan-6455/dashboard/tree/main/frontend/src/pages) (Dashboard pages), [`backend/src/app.ts`](https://github.com/marwan-6455/dashboard/blob/main/backend/src/app.ts) (HTTP application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Dashboard"]
  node_dashboard["Dashboard pages"]
  node_webclient["API client<br/>[client.ts]"]
end

subgraph group_api["Hub API"]
  node_apiapp["HTTP application<br/>[app.ts]"]
  node_auth["Sessions and roles<br/>[auth.ts]"]
  node_authroutes["Authentication<br/>[authRoutes.ts]"]
  node_database[("SQLite database<br/>[connection.ts]")]
  node_botroutes["Bot endpoints<br/>[botRoutes.ts]"]
end

subgraph group_workflow["Verification Workflow"]
  node_tasks["Task management<br/>[taskService.ts]"]
  node_gates["Completion gates<br/>[gateService.ts]"]
  node_reviews["Peer reviews<br/>[reviewService.ts]"]
  node_evidence["Evidence artifacts<br/>[evidenceRoutes.ts]"]
  node_testreports["Test reports"]
  node_uvcs["UVCS changesets<br/>[uvcsService.ts]"]
end

subgraph group_operations["Studio Operations"]
  node_activity["Audit activity<br/>[activityService.ts]"]
  node_projects["Projects and teams<br/>[projectRoutes.ts]"]
  node_assets["Asset vault<br/>[assetRoutes.ts]"]
  node_knowledge["Wiki and stories<br/>[wikiRoutes.ts]"]
  node_reports["Dashboard statistics<br/>[statsRoutes.ts]"]
  node_administration["Studio administration<br/>[adminService.ts]"]
  node_reminders["Reminder scheduler"]
  node_outbox["Discord event outbox"]
end

subgraph group_discord["Discord Service"]
  node_commands["Slash commands"]
  node_hubclient["Hub API client<br/>[hubClient.ts]"]
  node_dispatcher["Outbox dispatcher"]
  node_reminderworker["Reminder worker<br/>[reminderWorker.ts]"]
end

node_developer(("Studio user"))
node_botuser(("Discord user"))

node_developer -->|"uses"| node_dashboard
node_dashboard -->|"requests through"| node_webclient
node_webclient -.->|"calls API"| node_apiapp
node_apiapp -->|"mounts"| node_authroutes
node_apiapp -->|"mounts"| node_botroutes
node_authroutes -->|"uses sessions"| node_auth
node_auth -->|"reads sessions"| node_database
node_developer -->|"manages tasks"| node_tasks
node_tasks -->|"checks completion"| node_gates
node_developer -->|"requests review"| node_reviews
node_reviews -->|"records decisions"| node_activity
node_reviews -->|"queues events"| node_outbox
node_developer -->|"attaches evidence"| node_evidence
node_developer -->|"records test results"| node_testreports
node_developer -->|"links changesets"| node_uvcs
node_tasks -->|"reads and writes"| node_database
node_botuser -->|"uses"| node_commands
node_commands -->|"requests through"| node_hubclient
node_hubclient -->|"calls API"| node_botroutes
node_botroutes -->|"gets tasks"| node_tasks
node_botroutes -->|"acknowledges reminders"| node_reminders
node_outbox -.->|"delivers events"| node_dispatcher
node_reminders -.->|"supplies reminders"| node_reminderworker
node_developer -->|"manages studio work"| node_projects
node_developer -->|"manages assets"| node_assets
node_developer -->|"uses documentation"| node_knowledge
node_dashboard -->|"shows metrics"| node_reports
node_developer -->|"configures studio"| node_administration

click node_dashboard "https://github.com/marwan-6455/dashboard/tree/main/frontend/src/pages"
click node_webclient "https://github.com/marwan-6455/dashboard/blob/main/frontend/src/api/client.ts"
click node_apiapp "https://github.com/marwan-6455/dashboard/blob/main/backend/src/app.ts"
click node_auth "https://github.com/marwan-6455/dashboard/blob/main/backend/src/middleware/auth.ts"
click node_authroutes "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/authRoutes.ts"
click node_tasks "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/taskService.ts"
click node_gates "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/gateService.ts"
click node_reviews "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/reviewService.ts"
click node_evidence "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/evidenceRoutes.ts"
click node_testreports "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/testReportService.ts"
click node_uvcs "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/uvcsService.ts"
click node_activity "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/activityService.ts"
click node_projects "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/projectRoutes.ts"
click node_assets "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/assetRoutes.ts"
click node_knowledge "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/wikiRoutes.ts"
click node_reports "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/statsRoutes.ts"
click node_administration "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/adminService.ts"
click node_database "https://github.com/marwan-6455/dashboard/blob/main/backend/src/db/connection.ts"
click node_commands "https://github.com/marwan-6455/dashboard/tree/main/services/discord-bot/src/commands"
click node_hubclient "https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/api/hubClient.ts"
click node_botroutes "https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/botRoutes.ts"
click node_reminders "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/reminderScheduler.ts"
click node_outbox "https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/discordOutboxService.ts"
click node_dispatcher "https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/worker/outboxDispatcher.ts"
click node_reminderworker "https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/worker/reminderWorker.ts"

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_dashboard,node_webclient,node_developer,node_botuser toneBlue
class node_apiapp,node_auth,node_authroutes,node_database,node_botroutes toneAmber
class node_tasks,node_gates,node_reviews,node_evidence,node_testreports,node_uvcs toneMint
class node_activity,node_projects,node_assets,node_knowledge,node_reports,node_administration,node_reminders,node_outbox toneRose
class node_commands,node_hubclient,node_dispatcher,node_reminderworker toneIndigo
```

## Components

### Dashboard

- [Dashboard pages](https://github.com/marwan-6455/dashboard/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/marwan-6455/dashboard/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### Hub API

- [HTTP application](https://github.com/marwan-6455/dashboard/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Sessions and roles](https://github.com/marwan-6455/dashboard/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`
- [Authentication](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/authRoutes.ts): `backend/src/routes/authRoutes.ts`
- [SQLite database](https://github.com/marwan-6455/dashboard/blob/main/backend/src/db/connection.ts): `backend/src/db/connection.ts`
- [Bot endpoints](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/botRoutes.ts): `backend/src/routes/botRoutes.ts`

### Verification Workflow

- [Task management](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/taskService.ts): `backend/src/services/taskService.ts`
- [Completion gates](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/gateService.ts): `backend/src/services/gateService.ts`
- [Peer reviews](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/reviewService.ts): `backend/src/services/reviewService.ts`
- [Evidence artifacts](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/evidenceRoutes.ts): `backend/src/routes/evidenceRoutes.ts`
- [Test reports](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/testReportService.ts): `backend/src/services/testReportService.ts`
- [UVCS changesets](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/uvcsService.ts): `backend/src/services/uvcsService.ts`

### Studio Operations

- [Audit activity](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/activityService.ts): `backend/src/services/activityService.ts`
- [Projects and teams](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/projectRoutes.ts): `backend/src/routes/projectRoutes.ts`
- [Asset vault](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/assetRoutes.ts): `backend/src/routes/assetRoutes.ts`
- [Wiki and stories](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/wikiRoutes.ts): `backend/src/routes/wikiRoutes.ts`
- [Dashboard statistics](https://github.com/marwan-6455/dashboard/blob/main/backend/src/routes/statsRoutes.ts): `backend/src/routes/statsRoutes.ts`
- [Studio administration](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/adminService.ts): `backend/src/services/adminService.ts`
- [Reminder scheduler](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/reminderScheduler.ts): `backend/src/services/reminderScheduler.ts`
- [Discord event outbox](https://github.com/marwan-6455/dashboard/blob/main/backend/src/services/discordOutboxService.ts): `backend/src/services/discordOutboxService.ts`

### Discord Service

- [Slash commands](https://github.com/marwan-6455/dashboard/tree/main/services/discord-bot/src/commands): `services/discord-bot/src/commands`
- [Hub API client](https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/api/hubClient.ts): `services/discord-bot/src/api/hubClient.ts`
- [Outbox dispatcher](https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/worker/outboxDispatcher.ts): `services/discord-bot/src/worker/outboxDispatcher.ts`
- [Reminder worker](https://github.com/marwan-6455/dashboard/blob/main/services/discord-bot/src/worker/reminderWorker.ts): `services/discord-bot/src/worker/reminderWorker.ts`

### Other components

- **Studio user**
- **Discord user**

## Connections

- Studio user → Dashboard pages: uses (evidence: `README.md`)
- Dashboard pages → API client: requests through (evidence: `frontend/src/pages/TasksPage.tsx`)
- API client → HTTP application: calls API
- HTTP application → Authentication: mounts (evidence: `backend/src/app.ts`)
- HTTP application → Bot endpoints: mounts (evidence: `backend/src/app.ts`)
- Authentication → Sessions and roles: uses sessions (evidence: `backend/src/routes/authRoutes.ts`)
- Sessions and roles → SQLite database: reads sessions (evidence: `backend/src/middleware/auth.ts`)
- Studio user → Task management: manages tasks (evidence: `README.md`)
- Task management → Completion gates: checks completion (evidence: `backend/src/services/taskService.ts`)
- Studio user → Peer reviews: requests review (evidence: `README.md`)
- Peer reviews → Audit activity: records decisions (evidence: `backend/src/services/reviewService.ts`)
- Peer reviews → Discord event outbox: queues events (evidence: `backend/src/services/reviewService.ts`)
- Studio user → Evidence artifacts: attaches evidence (evidence: `README.md`)
- Studio user → Test reports: records test results (evidence: `README.md`)
- Studio user → UVCS changesets: links changesets (evidence: `README.md`)
- Task management → SQLite database: reads and writes (evidence: `backend/src/services/taskService.ts`)
- Discord user → Slash commands: uses (evidence: `README.md`)
- Slash commands → Hub API client: requests through (evidence: `services/discord-bot/src/commands/myTasks.ts`)
- Hub API client → Bot endpoints: calls API (evidence: `services/discord-bot/src/api/hubClient.ts`)
- Bot endpoints → Task management: gets tasks (evidence: `backend/src/routes/botRoutes.ts`)
- Bot endpoints → Reminder scheduler: acknowledges reminders (evidence: `backend/src/routes/botRoutes.ts`)
- Discord event outbox → Outbox dispatcher: delivers events
- Reminder scheduler → Reminder worker: supplies reminders
- Studio user → Projects and teams: manages studio work (evidence: `README.md`)
- Studio user → Asset vault: manages assets (evidence: `README.md`)
- Studio user → Wiki and stories: uses documentation (evidence: `README.md`)
- Dashboard pages → Dashboard statistics: shows metrics (evidence: `README.md`)
- Studio user → Studio administration: configures studio (evidence: `README.md`)
