# hasan-wolf/geekednet architecture

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

- Interactive diagram: https://gitdiagram.com/hasan-wolf/geekednet
- Repository: https://github.com/hasan-wolf/geekednet

## Overview

GeekedNet is a browser networking game: learners build or inspect a network, configure it, send packets, and diagnose failures; lab objectives determine mission completion. The graph separates the React experience, shared app state, simulation/mission engine, and phone/topology experiences. The README documents the shared engine and read-only phone flow; edges from sampled source are limited to references listed in the SOURCE INDEX, so unsampled wiring is not inferred.

Main entry points: [`src/store.ts`](https://github.com/hasan-wolf/geekednet/blob/main/src/store.ts) (Game state), [`engine/index.ts`](https://github.com/hasan-wolf/geekednet/blob/main/engine/index.ts) (Engine API), [`src/topologies/index.ts`](https://github.com/hasan-wolf/geekednet/blob/main/src/topologies/index.ts) (Topology registry), [`src/components/Canvas.tsx`](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Canvas.tsx) (Network canvas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_canvas["Network canvas<br/>[Canvas.tsx]"]
  node_palette["Device palette<br/>[Palette.tsx]"]
  node_device_catalog["Device catalogue<br/>[devices.ts]"]
  node_config["Config panel<br/>[ConfigPanel.tsx]"]
  node_terminal["Terminal UI<br/>[Terminal.tsx]"]
  node_terminal_engine["Command parser<br/>[terminalEngine.ts]"]
  node_objectives["Objectives view<br/>[Objectives.tsx]"]
  node_companion["Companion hints<br/>[CompanionBot.tsx]"]
  node_winbar["Mission results<br/>[WinBar.tsx]"]
  node_progress["Progress tracking<br/>[progress.ts]"]
end

subgraph group_state["App state"]
  node_store["Game state<br/>[store.ts]"]
end

subgraph group_engine["Network engine"]
  node_engine_api["Engine API<br/>[index.ts]"]
  node_ip["IP addressing<br/>[ip.ts]"]
  node_simulation["Packet simulation<br/>[simulate.ts]"]
  node_link_state["Link state<br/>[linkState.ts]"]
  node_mission["Mission evaluation<br/>[missionRunner.ts]"]
  node_validation["Lab validation<br/>[validate.ts]"]
end

subgraph group_content["Labs and topology data"]
  node_lab_registry["Lab registry<br/>[index.ts]"]
  node_lab_data["Lab definitions"]
  node_topology_view["Topology demos<br/>[Topology.tsx]"]
  node_topology_registry["Topology registry<br/>[index.ts]"]
  node_topology_data["Topology definitions<br/>[topologies.json]"]
end

subgraph group_phone["Phone experience"]
  node_phone_layout["Phone layout switch<br/>[usePhoneLayout.ts]"]
  node_phone_app["Read-only phone view<br/>[PhoneApp.tsx]"]
  node_phone_canvas["Phone network view<br/>[PhoneCanvas.tsx]"]
  node_phone_ping["Phone packet demo<br/>[phonePing.ts]"]
  node_phone_solve["Solved lab state<br/>[solveLab.ts]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"reads and updates"| node_store
node_app -->|"derives progress"| node_progress
node_app -->|"selects layout"| node_phone_layout
node_canvas -->|"reads and updates"| node_store
node_canvas -->|"uses simulation API"| node_engine_api
node_canvas -->|"renders devices"| node_device_catalog
node_canvas -->|"reads topology"| node_topology_registry
node_canvas -.->|"supports topology mode"| node_topology_view
node_palette -->|"lists devices"| node_device_catalog
node_config -->|"reads and updates"| node_store
node_terminal -->|"reads and updates"| node_store
node_terminal_engine -->|"runs commands"| node_engine_api
node_objectives -->|"reads objectives"| node_store
node_companion -->|"reads state"| node_store
node_companion -->|"uses engine results"| node_engine_api
node_winbar -->|"reads results"| node_store
node_winbar -->|"shows progress"| node_progress
node_progress -->|"selects progress state"| node_store
node_store -->|"evaluates objectives"| node_engine_api
node_store -->|"creates devices"| node_device_catalog
node_store -->|"runs terminal"| node_terminal_engine
node_store -->|"loads topology"| node_topology_registry
node_store -->|"derives phone lab state"| node_phone_solve
node_engine_api -->|"exports addressing"| node_ip
node_engine_api -->|"exports simulation"| node_simulation
node_engine_api -->|"exports link state"| node_link_state
node_engine_api -->|"exports mission runner"| node_mission
node_engine_api -->|"exports validation"| node_validation
node_engine_api -->|"exports labs"| node_lab_registry
node_simulation -->|"uses address math"| node_ip
node_mission -->|"checks packet reachability"| node_simulation
node_mission -->|"uses lab validation"| node_validation
node_lab_registry -->|"validates lab data"| node_validation
node_lab_registry -->|"loads definitions"| node_lab_data
node_topology_view -->|"selects topology"| node_store
node_topology_view -->|"reads topology data"| node_topology_registry
node_topology_registry -->|"loads definitions"| node_topology_data
node_topology_registry -->|"uses engine types"| node_engine_api
node_topology_registry -.->|"provides demos"| node_topology_view
node_phone_app -->|"uses shared engine"| node_engine_api
node_phone_app -->|"reads app state"| node_store
node_phone_app -->|"offers packet demo"| node_phone_ping
node_phone_app -.->|"renders network"| node_phone_canvas
node_phone_app -.->|"derives solved state"| node_phone_solve
node_phone_canvas -->|"uses shared engine"| node_engine_api
node_phone_canvas -->|"reads app state"| node_store
node_phone_ping -->|"simulates packet"| node_engine_api

click node_app "https://github.com/hasan-wolf/geekednet/blob/main/src/App.tsx"
click node_canvas "https://github.com/hasan-wolf/geekednet/blob/main/src/components/Canvas.tsx"
click node_palette "https://github.com/hasan-wolf/geekednet/blob/main/src/components/Palette.tsx"
click node_device_catalog "https://github.com/hasan-wolf/geekednet/blob/main/src/devices.ts"
click node_config "https://github.com/hasan-wolf/geekednet/blob/main/src/components/ConfigPanel.tsx"
click node_terminal "https://github.com/hasan-wolf/geekednet/blob/main/src/components/Terminal.tsx"
click node_terminal_engine "https://github.com/hasan-wolf/geekednet/blob/main/src/terminalEngine.ts"
click node_objectives "https://github.com/hasan-wolf/geekednet/blob/main/src/components/Objectives.tsx"
click node_companion "https://github.com/hasan-wolf/geekednet/blob/main/src/components/CompanionBot.tsx"
click node_winbar "https://github.com/hasan-wolf/geekednet/blob/main/src/components/WinBar.tsx"
click node_progress "https://github.com/hasan-wolf/geekednet/blob/main/src/progress.ts"
click node_store "https://github.com/hasan-wolf/geekednet/blob/main/src/store.ts"
click node_engine_api "https://github.com/hasan-wolf/geekednet/blob/main/engine/index.ts"
click node_ip "https://github.com/hasan-wolf/geekednet/blob/main/engine/ip.ts"
click node_simulation "https://github.com/hasan-wolf/geekednet/blob/main/engine/simulate.ts"
click node_link_state "https://github.com/hasan-wolf/geekednet/blob/main/engine/linkState.ts"
click node_mission "https://github.com/hasan-wolf/geekednet/blob/main/engine/missionRunner.ts"
click node_validation "https://github.com/hasan-wolf/geekednet/blob/main/engine/validate.ts"
click node_lab_registry "https://github.com/hasan-wolf/geekednet/blob/main/engine/labs/index.ts"
click node_lab_data "https://github.com/hasan-wolf/geekednet/tree/main/engine/labs"
click node_topology_view "https://github.com/hasan-wolf/geekednet/blob/main/src/components/Topology.tsx"
click node_topology_registry "https://github.com/hasan-wolf/geekednet/blob/main/src/topologies/index.ts"
click node_topology_data "https://github.com/hasan-wolf/geekednet/blob/main/src/topologies/topologies.json"
click node_phone_layout "https://github.com/hasan-wolf/geekednet/blob/main/src/phone/usePhoneLayout.ts"
click node_phone_app "https://github.com/hasan-wolf/geekednet/blob/main/src/phone/PhoneApp.tsx"
click node_phone_canvas "https://github.com/hasan-wolf/geekednet/blob/main/src/phone/PhoneCanvas.tsx"
click node_phone_ping "https://github.com/hasan-wolf/geekednet/blob/main/src/phone/phonePing.ts"
click node_phone_solve "https://github.com/hasan-wolf/geekednet/blob/main/src/phone/solveLab.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_canvas,node_palette,node_device_catalog,node_config,node_terminal,node_terminal_engine,node_objectives,node_companion,node_winbar,node_progress toneBlue
class node_store toneAmber
class node_engine_api,node_ip,node_simulation,node_link_state,node_mission,node_validation toneMint
class node_lab_registry,node_lab_data,node_topology_view,node_topology_registry,node_topology_data toneRose
class node_phone_layout,node_phone_app,node_phone_canvas,node_phone_ping,node_phone_solve,node_learner toneIndigo
```

## Components

### Learning experience

- [Application shell](https://github.com/hasan-wolf/geekednet/blob/main/src/App.tsx): `src/App.tsx`
- [Network canvas](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Canvas.tsx): `src/components/Canvas.tsx`
- [Device palette](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Palette.tsx): `src/components/Palette.tsx`
- [Device catalogue](https://github.com/hasan-wolf/geekednet/blob/main/src/devices.ts): `src/devices.ts`
- [Config panel](https://github.com/hasan-wolf/geekednet/blob/main/src/components/ConfigPanel.tsx): `src/components/ConfigPanel.tsx`
- [Terminal UI](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Terminal.tsx): `src/components/Terminal.tsx`
- [Command parser](https://github.com/hasan-wolf/geekednet/blob/main/src/terminalEngine.ts): `src/terminalEngine.ts`
- [Objectives view](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Objectives.tsx): `src/components/Objectives.tsx`
- [Companion hints](https://github.com/hasan-wolf/geekednet/blob/main/src/components/CompanionBot.tsx): `src/components/CompanionBot.tsx`
- [Mission results](https://github.com/hasan-wolf/geekednet/blob/main/src/components/WinBar.tsx): `src/components/WinBar.tsx`
- [Progress tracking](https://github.com/hasan-wolf/geekednet/blob/main/src/progress.ts): `src/progress.ts`

### App state

- [Game state](https://github.com/hasan-wolf/geekednet/blob/main/src/store.ts): `src/store.ts`

### Network engine

- [Engine API](https://github.com/hasan-wolf/geekednet/blob/main/engine/index.ts): `engine/index.ts`
- [IP addressing](https://github.com/hasan-wolf/geekednet/blob/main/engine/ip.ts): `engine/ip.ts`
- [Packet simulation](https://github.com/hasan-wolf/geekednet/blob/main/engine/simulate.ts): `engine/simulate.ts`
- [Link state](https://github.com/hasan-wolf/geekednet/blob/main/engine/linkState.ts): `engine/linkState.ts`
- [Mission evaluation](https://github.com/hasan-wolf/geekednet/blob/main/engine/missionRunner.ts): `engine/missionRunner.ts`
- [Lab validation](https://github.com/hasan-wolf/geekednet/blob/main/engine/validate.ts): `engine/validate.ts`

### Labs and topology data

- [Lab registry](https://github.com/hasan-wolf/geekednet/blob/main/engine/labs/index.ts): `engine/labs/index.ts`
- [Lab definitions](https://github.com/hasan-wolf/geekednet/tree/main/engine/labs): `engine/labs`
- [Topology demos](https://github.com/hasan-wolf/geekednet/blob/main/src/components/Topology.tsx): `src/components/Topology.tsx`
- [Topology registry](https://github.com/hasan-wolf/geekednet/blob/main/src/topologies/index.ts): `src/topologies/index.ts`
- [Topology definitions](https://github.com/hasan-wolf/geekednet/blob/main/src/topologies/topologies.json): `src/topologies/topologies.json`

### Phone experience

- [Phone layout switch](https://github.com/hasan-wolf/geekednet/blob/main/src/phone/usePhoneLayout.ts): `src/phone/usePhoneLayout.ts`
- [Read-only phone view](https://github.com/hasan-wolf/geekednet/blob/main/src/phone/PhoneApp.tsx): `src/phone/PhoneApp.tsx`
- [Phone network view](https://github.com/hasan-wolf/geekednet/blob/main/src/phone/PhoneCanvas.tsx): `src/phone/PhoneCanvas.tsx`
- [Phone packet demo](https://github.com/hasan-wolf/geekednet/blob/main/src/phone/phonePing.ts): `src/phone/phonePing.ts`
- [Solved lab state](https://github.com/hasan-wolf/geekednet/blob/main/src/phone/solveLab.ts): `src/phone/solveLab.ts`

### Other components

- **Learner**

## Connections

- Learner → Application shell: uses (evidence: `README.md`)
- Application shell → Game state: reads and updates (evidence: `src/App.tsx`)
- Application shell → Progress tracking: derives progress (evidence: `src/App.tsx`)
- Application shell → Phone layout switch: selects layout (evidence: `src/App.tsx`)
- Network canvas → Game state: reads and updates (evidence: `src/components/Canvas.tsx`)
- Network canvas → Engine API: uses simulation API (evidence: `src/components/Canvas.tsx`)
- Network canvas → Device catalogue: renders devices (evidence: `src/components/Canvas.tsx`)
- Network canvas → Topology registry: reads topology (evidence: `src/components/Canvas.tsx`)
- Network canvas → Topology demos: supports topology mode
- Device palette → Device catalogue: lists devices (evidence: `src/components/Palette.tsx`)
- Config panel → Game state: reads and updates (evidence: `src/components/ConfigPanel.tsx`)
- Terminal UI → Game state: reads and updates (evidence: `src/components/Terminal.tsx`)
- Command parser → Engine API: runs commands (evidence: `src/terminalEngine.ts`)
- Objectives view → Game state: reads objectives (evidence: `src/components/Objectives.tsx`)
- Companion hints → Game state: reads state (evidence: `src/components/CompanionBot.tsx`)
- Companion hints → Engine API: uses engine results (evidence: `src/components/CompanionBot.tsx`)
- Mission results → Game state: reads results (evidence: `src/components/WinBar.tsx`)
- Mission results → Progress tracking: shows progress (evidence: `src/components/WinBar.tsx`)
- Progress tracking → Game state: selects progress state (evidence: `src/progress.ts`)
- Game state → Engine API: evaluates objectives (evidence: `src/store.ts`)
- Game state → Device catalogue: creates devices (evidence: `src/store.ts`)
- Game state → Command parser: runs terminal (evidence: `src/store.ts`)
- Game state → Topology registry: loads topology (evidence: `src/store.ts`)
- Game state → Solved lab state: derives phone lab state (evidence: `src/store.ts`)
- Engine API → IP addressing: exports addressing (evidence: `engine/index.ts`)
- Engine API → Packet simulation: exports simulation (evidence: `engine/index.ts`)
- Engine API → Link state: exports link state (evidence: `engine/index.ts`)
- Engine API → Mission evaluation: exports mission runner (evidence: `engine/index.ts`)
- Engine API → Lab validation: exports validation (evidence: `engine/index.ts`)
- Engine API → Lab registry: exports labs (evidence: `engine/index.ts`)
- Packet simulation → IP addressing: uses address math (evidence: `engine/simulate.ts`)
- Mission evaluation → Packet simulation: checks packet reachability (evidence: `engine/missionRunner.ts`)
- Mission evaluation → Lab validation: uses lab validation (evidence: `engine/missionRunner.ts`)
- Lab registry → Lab validation: validates lab data (evidence: `engine/labs/index.ts`)
- Lab registry → Lab definitions: loads definitions (evidence: `engine/labs/index.ts`)
- Topology demos → Game state: selects topology (evidence: `src/components/Topology.tsx`)
- Topology demos → Topology registry: reads topology data (evidence: `src/components/Topology.tsx`)
- Topology registry → Topology definitions: loads definitions (evidence: `src/topologies/index.ts`)
- Topology registry → Engine API: uses engine types (evidence: `src/topologies/index.ts`)
- Topology registry → Topology demos: provides demos (evidence: `src/components/Topology.tsx`)
- Read-only phone view → Engine API: uses shared engine (evidence: `src/phone/PhoneApp.tsx`)
- Read-only phone view → Game state: reads app state (evidence: `src/phone/PhoneApp.tsx`)
- Read-only phone view → Phone packet demo: offers packet demo (evidence: `src/phone/PhoneApp.tsx`)
- Read-only phone view → Phone network view: renders network
- Read-only phone view → Solved lab state: derives solved state
- Phone network view → Engine API: uses shared engine (evidence: `src/phone/PhoneCanvas.tsx`)
- Phone network view → Game state: reads app state (evidence: `src/phone/PhoneCanvas.tsx`)
- Phone packet demo → Engine API: simulates packet (evidence: `src/phone/phonePing.ts`)
