# tdherring/ossat architecture

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

- Interactive diagram: https://gitdiagram.com/tdherring/ossat
- Repository: https://github.com/tdherring/ossat
- Video tour (about a minute): https://gitdiagram.com/tdherring/ossat/video

## Overview

OSSAT is a browser-based operating-systems learning app: users navigate to interactive CPU, memory, virtual-memory, and disk simulators, or to assessments and learning-group performance features. The sampled runtime shows the app shell, CPU and memory state providers, and memory allocation engine; README documents the broader assessment and organisation capabilities. API-backed account and organisation actions use GraphQL, with a local demo-data mode. Some page-to-provider and assessment wiring is represented only by the tree and product documentation, so uncertain call links are omitted.

Main entry points: [`src/components/Body.tsx`](https://github.com/tdherring/ossat/blob/master/src/components/Body.tsx) (Route content), [`src/index.tsx`](https://github.com/tdherring/ossat/blob/master/src/index.tsx) (React entry), [`src/App.tsx`](https://github.com/tdherring/ossat/blob/master/src/App.tsx) (App shell), [`src/components/body/simulator/cpu/CPUModule.tsx`](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/cpu/CPUModule.tsx) (CPU simulator UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_entry["React entry<br/>[index.tsx]"]
  node_app["App shell<br/>[App.tsx]"]
  node_header["Navigation<br/>[Header.tsx]"]
  node_body["Route content<br/>[Body.tsx]"]
  node_routes["Route paths<br/>[routes.ts]"]
end

subgraph group_sim["Simulators"]
  node_cpu_ui["CPU simulator UI<br/>[CPUModule.tsx]"]
  node_cpu_state["CPU state"]
  node_cpu_engine["CPU schedulers<br/>[cpu_scheduler.ts]"]
  node_memory_ui["Memory simulator UI<br/>[MemoryModule.tsx]"]
  node_memory_state["Memory state"]
  node_memory_engine["Allocation manager<br/>[memory_manager.ts]"]
  node_disk_ui["Disk simulator"]
  node_disk_engine["Disk scheduling"]
  node_vm_ui["Virtual memory"]
  node_vm_engine["Virtual memory logic"]
  node_playback["Trace playback"]
end

subgraph group_learning["Learning and groups"]
  node_assessment["Assessments"]
  node_quiz["Quiz experience<br/>[QuizModule.tsx]"]
  node_organisation["Learning groups"]
  node_performance["Performance data"]
end

subgraph group_integration["Data and identity"]
  node_user_state["Session state<br/>[UserContext.tsx]"]
  node_apollo["GraphQL client<br/>[index.tsx]"]
  node_api{{"OSSAT API"}}
  node_demo["Demo data<br/>[demoApolloLink.ts]"]
end

node_user(("Visitor"))

node_user -->|"opens app"| node_entry
node_entry -->|"mounts"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_body
node_header -->|"navigates"| node_routes
node_body -->|"matches paths"| node_routes
node_body -->|"renders route"| node_cpu_ui
node_body -->|"renders route"| node_memory_ui
node_body -->|"renders route"| node_disk_ui
node_body -->|"renders route"| node_vm_ui
node_body -->|"renders route"| node_assessment
node_body -->|"renders route"| node_organisation
node_cpu_ui -->|"uses state"| node_cpu_state
node_cpu_state -->|"queries schedules"| node_cpu_engine
node_memory_ui -->|"uses state"| node_memory_state
node_memory_state -->|"reads queues"| node_memory_engine
node_disk_ui -->|"runs simulation"| node_disk_engine
node_vm_ui -->|"runs simulation"| node_vm_engine
node_cpu_ui -.->|"uses playback"| node_playback
node_assessment -->|"opens quiz"| node_quiz
node_organisation -->|"shows results"| node_performance
node_app -->|"provides session"| node_user_state
node_entry -->|"configures client"| node_apollo
node_user_state -->|"queries and mutates"| node_apollo
node_organisation -.->|"requests group data"| node_apollo
node_apollo -.->|"sends GraphQL"| node_api
node_entry -.->|"selects demo link"| node_demo

click node_entry "https://github.com/tdherring/ossat/blob/master/src/index.tsx"
click node_app "https://github.com/tdherring/ossat/blob/master/src/App.tsx"
click node_header "https://github.com/tdherring/ossat/blob/master/src/components/Header.tsx"
click node_body "https://github.com/tdherring/ossat/blob/master/src/components/Body.tsx"
click node_routes "https://github.com/tdherring/ossat/blob/master/src/lib/routes.ts"
click node_cpu_ui "https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/cpu/CPUModule.tsx"
click node_cpu_state "https://github.com/tdherring/ossat/blob/master/src/contexts/CPUSimulatorContext.tsx"
click node_cpu_engine "https://github.com/tdherring/ossat/blob/master/src/simulator/cpu/cpu_scheduler.ts"
click node_memory_ui "https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/memory/MemoryModule.tsx"
click node_memory_state "https://github.com/tdherring/ossat/blob/master/src/contexts/MemoryManagerContext.tsx"
click node_memory_engine "https://github.com/tdherring/ossat/blob/master/src/simulator/memory/memory_manager.ts"
click node_disk_ui "https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/disk/DiskSchedulingModule.tsx"
click node_disk_engine "https://github.com/tdherring/ossat/blob/master/src/lib/diskSchedulingSimulation.ts"
click node_vm_ui "https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/virtual-memory/VirtualMemoryModule.tsx"
click node_vm_engine "https://github.com/tdherring/ossat/blob/master/src/lib/virtualMemorySimulation.ts"
click node_playback "https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/useTracePlayback.ts"
click node_assessment "https://github.com/tdherring/ossat/blob/master/src/components/body/assessment/landing/AssessmentLandingPage.tsx"
click node_quiz "https://github.com/tdherring/ossat/blob/master/src/components/body/assessment/quiz/QuizModule.tsx"
click node_organisation "https://github.com/tdherring/ossat/blob/master/src/components/body/organisation/landing/OrganisationLandingPage.tsx"
click node_performance "https://github.com/tdherring/ossat/blob/master/src/components/body/organisation/PerformanceData.tsx"
click node_user_state "https://github.com/tdherring/ossat/blob/master/src/contexts/UserContext.tsx"
click node_apollo "https://github.com/tdherring/ossat/blob/master/src/index.tsx"
click node_demo "https://github.com/tdherring/ossat/blob/master/src/lib/demoApolloLink.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_entry,node_app,node_header,node_body,node_routes toneBlue
class node_cpu_ui,node_cpu_state,node_cpu_engine,node_memory_ui,node_memory_state,node_memory_engine,node_disk_ui,node_disk_engine,node_vm_ui,node_vm_engine,node_playback toneAmber
class node_assessment,node_quiz,node_organisation,node_performance toneMint
class node_user_state,node_apollo,node_api,node_demo toneRose
class node_user toneIndigo
```

## Components

### App shell

- [React entry](https://github.com/tdherring/ossat/blob/master/src/index.tsx): `src/index.tsx`
- [App shell](https://github.com/tdherring/ossat/blob/master/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/tdherring/ossat/blob/master/src/components/Header.tsx): `src/components/Header.tsx`
- [Route content](https://github.com/tdherring/ossat/blob/master/src/components/Body.tsx): `src/components/Body.tsx`
- [Route paths](https://github.com/tdherring/ossat/blob/master/src/lib/routes.ts): `src/lib/routes.ts`

### Simulators

- [CPU simulator UI](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/cpu/CPUModule.tsx): `src/components/body/simulator/cpu/CPUModule.tsx`
- [CPU state](https://github.com/tdherring/ossat/blob/master/src/contexts/CPUSimulatorContext.tsx): `src/contexts/CPUSimulatorContext.tsx`
- [CPU schedulers](https://github.com/tdherring/ossat/blob/master/src/simulator/cpu/cpu_scheduler.ts): `src/simulator/cpu/cpu_scheduler.ts`
- [Memory simulator UI](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/memory/MemoryModule.tsx): `src/components/body/simulator/memory/MemoryModule.tsx`
- [Memory state](https://github.com/tdherring/ossat/blob/master/src/contexts/MemoryManagerContext.tsx): `src/contexts/MemoryManagerContext.tsx`
- [Allocation manager](https://github.com/tdherring/ossat/blob/master/src/simulator/memory/memory_manager.ts): `src/simulator/memory/memory_manager.ts`
- [Disk simulator](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/disk/DiskSchedulingModule.tsx): `src/components/body/simulator/disk/DiskSchedulingModule.tsx`
- [Disk scheduling](https://github.com/tdherring/ossat/blob/master/src/lib/diskSchedulingSimulation.ts): `src/lib/diskSchedulingSimulation.ts`
- [Virtual memory](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/virtual-memory/VirtualMemoryModule.tsx): `src/components/body/simulator/virtual-memory/VirtualMemoryModule.tsx`
- [Virtual memory logic](https://github.com/tdherring/ossat/blob/master/src/lib/virtualMemorySimulation.ts): `src/lib/virtualMemorySimulation.ts`
- [Trace playback](https://github.com/tdherring/ossat/blob/master/src/components/body/simulator/useTracePlayback.ts): `src/components/body/simulator/useTracePlayback.ts`

### Learning and groups

- [Assessments](https://github.com/tdherring/ossat/blob/master/src/components/body/assessment/landing/AssessmentLandingPage.tsx): `src/components/body/assessment/landing/AssessmentLandingPage.tsx`
- [Quiz experience](https://github.com/tdherring/ossat/blob/master/src/components/body/assessment/quiz/QuizModule.tsx): `src/components/body/assessment/quiz/QuizModule.tsx`
- [Learning groups](https://github.com/tdherring/ossat/blob/master/src/components/body/organisation/landing/OrganisationLandingPage.tsx): `src/components/body/organisation/landing/OrganisationLandingPage.tsx`
- [Performance data](https://github.com/tdherring/ossat/blob/master/src/components/body/organisation/PerformanceData.tsx): `src/components/body/organisation/PerformanceData.tsx`

### Data and identity

- [Session state](https://github.com/tdherring/ossat/blob/master/src/contexts/UserContext.tsx): `src/contexts/UserContext.tsx`
- [GraphQL client](https://github.com/tdherring/ossat/blob/master/src/index.tsx): `src/index.tsx`
- **OSSAT API**
- [Demo data](https://github.com/tdherring/ossat/blob/master/src/lib/demoApolloLink.ts): `src/lib/demoApolloLink.ts`

### Other components

- **Visitor**

## Connections

- Visitor → React entry: opens app
- React entry → App shell: mounts
- App shell → Navigation: renders
- App shell → Route content: renders
- Navigation → Route paths: navigates
- Route content → Route paths: matches paths
- Route content → CPU simulator UI: renders route
- Route content → Memory simulator UI: renders route
- Route content → Disk simulator: renders route
- Route content → Virtual memory: renders route
- Route content → Assessments: renders route
- Route content → Learning groups: renders route
- CPU simulator UI → CPU state: uses state
- CPU state → CPU schedulers: queries schedules
- Memory simulator UI → Memory state: uses state
- Memory state → Allocation manager: reads queues
- Disk simulator → Disk scheduling: runs simulation
- Virtual memory → Virtual memory logic: runs simulation
- CPU simulator UI → Trace playback: uses playback
- Assessments → Quiz experience: opens quiz
- Learning groups → Performance data: shows results
- App shell → Session state: provides session
- React entry → GraphQL client: configures client
- Session state → GraphQL client: queries and mutates
- Learning groups → GraphQL client: requests group data
- GraphQL client → OSSAT API: sends GraphQL
- React entry → Demo data: selects demo link
