# maiklvas-bot/dns-sim-temp3 architecture

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

- Interactive diagram: https://gitdiagram.com/maiklvas-bot/dns-sim-temp3
- Repository: https://github.com/maiklvas-bot/dns-sim-temp3

## Overview

DNS SimCenter is a browser-based business simulation with SQLite-backed content and session results, plus staff administration and assessment. The main workflow loads simulation content, lets a participant complete cases and make decisions, and stores answers and results for review. A separate ZRD strategy-game experience has its own client, domain engines, and persistence modules. The graph follows documented capabilities and excerpted calls; where runtime wiring is not shown, links are dashed and marked unverified.

Main entry points: [`server/session-storage.ts`](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/session-storage.ts) (Session storage), [`server/db.ts`](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/db.ts) (SQLite database), [`client/src/App.tsx`](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/App.tsx) (App routing), [`server/content-storage.ts`](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/content-storage.ts) (Content storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["App routing<br/>[App.tsx]"]
  node_content_client["Content snapshot<br/>[runtime-content.ts]"]
end

subgraph group_simulation["Case simulation"]
  node_simulation_ui["Simulation workspace"]
  node_simulation_runtime["Simulation runtime"]
  node_case_content["Case content"]
end

subgraph group_staff["Staff workflows"]
  node_admin_ui["Admin workspace"]
  node_assessor_ui["Assessor workspace"]
  node_results_ui["Results review<br/>[results.tsx]"]
end

subgraph group_zrd["ZRD game"]
  node_zrd_ui["ZRD workspace"]
  node_zrd_game_hook["Game actions<br/>[useZrdGame.ts]"]
  node_zrd_match_hook["Match actions<br/>[useZrdMatch.ts]"]
  node_zrd_engine["Game engine<br/>[engine.ts]"]
  node_zrd_match_engine["Match engine<br/>[match-engine.ts]"]
  node_zrd_api["Game API client<br/>[zrd-api.ts]"]
  node_zrd_match_api["Match API client<br/>[zrd-match-api.ts]"]
end

subgraph group_data["Persistence"]
  node_content_storage["Content storage<br/>[content-storage.ts]"]
  node_session_storage["Session storage<br/>[session-storage.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
  node_zrd_storage["ZRD persistence<br/>[zrd-storage.ts]"]
  node_zrd_match_storage["Match persistence"]
end

node_participant(("Participant"))

node_app -->|"sets snapshot"| node_content_client
node_app -.->|"routes to"| node_participant
node_participant -.->|"starts session"| node_simulation_ui
node_simulation_ui -.->|"runs through"| node_simulation_runtime
node_simulation_runtime -.->|"persists results"| node_session_storage
node_app -.->|"loads content"| node_content_storage
node_content_storage -->|"reads and writes"| node_database
node_session_storage -->|"reads and writes"| node_database
node_admin_ui -.->|"manages cases"| node_content_storage
node_assessor_ui -.->|"reviews sessions"| node_session_storage
node_results_ui -.->|"views results"| node_session_storage
node_zrd_ui -.->|"uses actions"| node_zrd_game_hook
node_zrd_ui -.->|"uses match actions"| node_zrd_match_hook
node_zrd_game_hook -->|"calls"| node_zrd_api
node_zrd_match_hook -->|"calls"| node_zrd_match_api
node_zrd_engine -->|"uses content"| node_case_content
node_zrd_match_engine -->|"uses content"| node_case_content
node_zrd_api -.->|"sends requests"| node_zrd_storage
node_zrd_match_api -.->|"sends requests"| node_zrd_match_storage
node_zrd_storage -->|"reads and writes"| node_database
node_zrd_match_storage -->|"reads and writes"| node_database

click node_app "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/App.tsx"
click node_content_client "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/lib/runtime-content.ts"
click node_simulation_ui "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/simulation/SimulationWorkspace.tsx"
click node_simulation_runtime "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/simulation-engine/SimulationProviderRuntime.tsx"
click node_case_content "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/simulation-content.ts"
click node_admin_ui "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/admin/AdminWorkspaceRuntime.tsx"
click node_assessor_ui "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/assessor/AssessorWorkspaceRuntime.tsx"
click node_results_ui "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/pages/results.tsx"
click node_content_storage "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/content-storage.ts"
click node_session_storage "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/session-storage.ts"
click node_database "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/db.ts"
click node_zrd_ui "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/ZrdGameWorkspace.tsx"
click node_zrd_game_hook "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/useZrdGame.ts"
click node_zrd_match_hook "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/useZrdMatch.ts"
click node_zrd_engine "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/zrd/engine.ts"
click node_zrd_match_engine "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/zrd/match-engine.ts"
click node_zrd_api "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/zrd-api.ts"
click node_zrd_match_api "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/zrd-match-api.ts"
click node_zrd_storage "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/zrd-storage.ts"
click node_zrd_match_storage "https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/zrd-match-storage.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_app,node_content_client toneBlue
class node_simulation_ui,node_simulation_runtime,node_case_content toneAmber
class node_admin_ui,node_assessor_ui,node_results_ui toneMint
class node_zrd_ui,node_zrd_game_hook,node_zrd_match_hook,node_zrd_engine,node_zrd_match_engine,node_zrd_api,node_zrd_match_api toneRose
class node_content_storage,node_session_storage,node_database,node_zrd_storage,node_zrd_match_storage,node_participant toneIndigo
```

## Components

### App entry

- [App routing](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Content snapshot](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/lib/runtime-content.ts): `client/src/lib/runtime-content.ts`

### Case simulation

- [Simulation workspace](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/simulation/SimulationWorkspace.tsx): `client/src/features/simulation/SimulationWorkspace.tsx`
- [Simulation runtime](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/simulation-engine/SimulationProviderRuntime.tsx): `client/src/features/simulation-engine/SimulationProviderRuntime.tsx`
- [Case content](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/simulation-content.ts): `shared/simulation-content.ts`

### Staff workflows

- [Admin workspace](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/admin/AdminWorkspaceRuntime.tsx): `client/src/features/admin/AdminWorkspaceRuntime.tsx`
- [Assessor workspace](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/assessor/AssessorWorkspaceRuntime.tsx): `client/src/features/assessor/AssessorWorkspaceRuntime.tsx`
- [Results review](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/pages/results.tsx): `client/src/pages/results.tsx`

### ZRD game

- [ZRD workspace](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/ZrdGameWorkspace.tsx): `client/src/features/zrd/ZrdGameWorkspace.tsx`
- [Game actions](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/useZrdGame.ts): `client/src/features/zrd/useZrdGame.ts`
- [Match actions](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/useZrdMatch.ts): `client/src/features/zrd/useZrdMatch.ts`
- [Game engine](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/zrd/engine.ts): `shared/zrd/engine.ts`
- [Match engine](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/shared/zrd/match-engine.ts): `shared/zrd/match-engine.ts`
- [Game API client](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/zrd-api.ts): `client/src/features/zrd/zrd-api.ts`
- [Match API client](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/client/src/features/zrd/zrd-match-api.ts): `client/src/features/zrd/zrd-match-api.ts`

### Persistence

- [Content storage](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/content-storage.ts): `server/content-storage.ts`
- [Session storage](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/session-storage.ts): `server/session-storage.ts`
- [SQLite database](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/db.ts): `server/db.ts`
- [ZRD persistence](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/zrd-storage.ts): `server/zrd-storage.ts`
- [Match persistence](https://github.com/maiklvas-bot/dns-sim-temp3/blob/main/server/zrd-match-storage.ts): `server/zrd-match-storage.ts`

### Other components

- **Participant**

## Connections

- App routing → Content snapshot: sets snapshot (evidence: `client/src/App.tsx`)
- App routing → Participant: routes to
- Participant → Simulation workspace: starts session
- Simulation workspace → Simulation runtime: runs through
- Simulation runtime → Session storage: persists results
- App routing → Content storage: loads content
- Content storage → SQLite database: reads and writes (evidence: `server/content-storage.ts`)
- Session storage → SQLite database: reads and writes (evidence: `server/session-storage.ts`)
- Admin workspace → Content storage: manages cases (evidence: `README.md`)
- Assessor workspace → Session storage: reviews sessions (evidence: `README.md`)
- Results review → Session storage: views results (evidence: `README.md`)
- ZRD workspace → Game actions: uses actions
- ZRD workspace → Match actions: uses match actions
- Game actions → Game API client: calls (evidence: `client/src/features/zrd/useZrdGame.ts`)
- Match actions → Match API client: calls (evidence: `client/src/features/zrd/useZrdMatch.ts`)
- Game engine → Case content: uses content (evidence: `shared/zrd/engine.ts`)
- Match engine → Case content: uses content (evidence: `shared/zrd/match-engine.ts`)
- Game API client → ZRD persistence: sends requests
- Match API client → Match persistence: sends requests
- ZRD persistence → SQLite database: reads and writes (evidence: `server/zrd-storage.ts`)
- Match persistence → SQLite database: reads and writes (evidence: `server/zrd-match-storage.ts`)
