# lutikri/web-3dgame1 architecture

> Architecture diagram of the GitHub repository lutikri/web-3dgame1, 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/lutikri/web-3dgame1
- Repository: https://github.com/lutikri/web-3dgame1

## Overview

OperatorGame is a browser-based first-person fusion-reactor operations game. The player enters through boot/preflight and the app’s shift-selection flow, explores Site-12, consults the in-world terminal, operates the physical FCU-16 panel, and receives a scored Shift Report; progression and saves support later shifts. The map also preserves the documented onboarding, bilingual UI, audio, lighting, and rendering capabilities. Paths come from the supplied tree; only selected modules were sampled, so unsampled subsystem wiring is shown only where README capabilities support the relationship.

Main entry points: [`src/scene/LevelSceneBuilder.js`](https://github.com/lutikri/web-3dgame1/blob/main/src/scene/LevelSceneBuilder.js) (Site-12 scenes), [`src/app/AppShell.js`](https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppShell.js) (App shell), [`src/runtime/LevelRuntimeManager.js`](https://github.com/lutikri/web-3dgame1/blob/main/src/runtime/LevelRuntimeManager.js) (Level lifecycle), [`src/FusionCoreSimulation.js`](https://github.com/lutikri/web-3dgame1/blob/main/src/FusionCoreSimulation.js) (Fusion simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and progression"]
  node_boot["Boot and preflight<br/>[main.js]"]
  node_shell["App shell<br/>[AppShell.js]"]
  node_router["App routing<br/>[AppRouter.js]"]
  node_persistence[("Progress and saves<br/>[AppPersistence.js]")]
end

subgraph group_world["Levels and world"]
  node_levels["Shift definitions<br/>[LevelRegistry.js]"]
  node_levelruntime["Level lifecycle"]
  node_scene["Site-12 scenes"]
  node_prefabs["World prefab behaviors"]
  node_player["First-person control"]
  node_interaction["World interactions"]
end

subgraph group_operation["Reactor operation"]
  node_simulation["Fusion simulation"]
  node_panel["Physical control panel"]
  node_shift["Shift lifecycle"]
  node_report["Shift report<br/>[ShiftReport.js]"]
end

subgraph group_presentation["UI and terminal"]
  node_results["Report presentation"]
  node_terminalinteraction["Terminal interaction"]
  node_terminalrenderer["Terminal renderer"]
  node_terminalcontent["Terminal content"]
  node_terminalconfig["Shift terminal data"]
end

subgraph group_runtime["Runtime presentation"]
  node_audio["Audio systems<br/>[AudioRuntime.js]"]
  node_lighting["Lighting systems<br/>[LightingRuntime.js]"]
  node_render["Post-processing"]
end

node_operator(("Operator"))

node_operator -->|"starts game"| node_boot
node_boot -->|"creates app"| node_shell
node_shell -->|"routes screens"| node_router
node_shell -->|"tracks progression"| node_persistence
node_operator -->|"selects shift"| node_shell
node_router -->|"transitions levels"| node_levelruntime
node_levels -->|"supplies shifts"| node_levelruntime
node_levelruntime -->|"loads scene"| node_scene
node_scene -->|"builds world"| node_prefabs
node_operator -->|"moves and looks"| node_player
node_player -->|"targets objects"| node_interaction
node_interaction -->|"activates controls"| node_panel
node_panel -->|"sets reactor inputs"| node_simulation
node_simulation -->|"updates instruments"| node_panel
node_shift -->|"evaluates operation"| node_simulation
node_shift -->|"builds outcome"| node_report
node_report -->|"renders metrics"| node_results
node_operator -->|"opens terminal"| node_terminalinteraction
node_terminalinteraction -->|"handles focus"| node_terminalrenderer
node_terminalrenderer -->|"requests content"| node_terminalcontent
node_terminalcontent -->|"reads shift data"| node_terminalconfig
node_scene -->|"presents spaces"| node_lighting
node_scene -->|"presents sound"| node_audio
node_scene -->|"renders scene"| node_render

click node_boot "https://github.com/lutikri/web-3dgame1/blob/main/src/main.js"
click node_shell "https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppShell.js"
click node_router "https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppRouter.js"
click node_persistence "https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppPersistence.js"
click node_levels "https://github.com/lutikri/web-3dgame1/blob/main/src/levels/LevelRegistry.js"
click node_levelruntime "https://github.com/lutikri/web-3dgame1/blob/main/src/runtime/LevelRuntimeManager.js"
click node_scene "https://github.com/lutikri/web-3dgame1/blob/main/src/scene/LevelSceneBuilder.js"
click node_prefabs "https://github.com/lutikri/web-3dgame1/tree/main/src/prefabs/behaviors"
click node_player "https://github.com/lutikri/web-3dgame1/blob/main/src/player/PlayerController.js"
click node_interaction "https://github.com/lutikri/web-3dgame1/blob/main/src/interactions/ItemInteractionRuntime.js"
click node_simulation "https://github.com/lutikri/web-3dgame1/blob/main/src/FusionCoreSimulation.js"
click node_panel "https://github.com/lutikri/web-3dgame1/blob/main/src/panels/OperatorPanelRuntime.js"
click node_shift "https://github.com/lutikri/web-3dgame1/blob/main/src/game/ShiftLifecycleRuntime.js"
click node_report "https://github.com/lutikri/web-3dgame1/blob/main/src/game/ShiftReport.js"
click node_results "https://github.com/lutikri/web-3dgame1/blob/main/src/ui/ShiftResultsController.js"
click node_terminalinteraction "https://github.com/lutikri/web-3dgame1/blob/main/src/prefabs/behaviors/ServiceTerminalInteractionRuntime.js"
click node_terminalrenderer "https://github.com/lutikri/web-3dgame1/blob/main/src/prefabs/behaviors/ServiceTerminalCanvasRenderer.js"
click node_terminalcontent "https://github.com/lutikri/web-3dgame1/blob/main/src/app/panels/ServiceTerminalContent.js"
click node_terminalconfig "https://github.com/lutikri/web-3dgame1/blob/main/src/app/panels/ServiceTerminalShiftConfig.js"
click node_audio "https://github.com/lutikri/web-3dgame1/blob/main/src/audio/AudioRuntime.js"
click node_lighting "https://github.com/lutikri/web-3dgame1/blob/main/src/lighting/LightingRuntime.js"
click node_render "https://github.com/lutikri/web-3dgame1/blob/main/src/postprocessing/PostProcessingRuntime.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_boot,node_shell,node_router,node_persistence toneBlue
class node_levels,node_levelruntime,node_scene,node_prefabs,node_player,node_interaction toneAmber
class node_simulation,node_panel,node_shift,node_report toneMint
class node_results,node_terminalinteraction,node_terminalrenderer,node_terminalcontent,node_terminalconfig toneRose
class node_audio,node_lighting,node_render,node_operator toneIndigo
```

## Components

### App and progression

- [Boot and preflight](https://github.com/lutikri/web-3dgame1/blob/main/src/main.js): `src/main.js`
- [App shell](https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppShell.js): `src/app/AppShell.js`
- [App routing](https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppRouter.js): `src/app/AppRouter.js`
- [Progress and saves](https://github.com/lutikri/web-3dgame1/blob/main/src/app/AppPersistence.js): `src/app/AppPersistence.js`

### Levels and world

- [Shift definitions](https://github.com/lutikri/web-3dgame1/blob/main/src/levels/LevelRegistry.js): `src/levels/LevelRegistry.js`
- [Level lifecycle](https://github.com/lutikri/web-3dgame1/blob/main/src/runtime/LevelRuntimeManager.js): `src/runtime/LevelRuntimeManager.js`
- [Site-12 scenes](https://github.com/lutikri/web-3dgame1/blob/main/src/scene/LevelSceneBuilder.js): `src/scene/LevelSceneBuilder.js`
- [World prefab behaviors](https://github.com/lutikri/web-3dgame1/tree/main/src/prefabs/behaviors): `src/prefabs/behaviors`
- [First-person control](https://github.com/lutikri/web-3dgame1/blob/main/src/player/PlayerController.js): `src/player/PlayerController.js`
- [World interactions](https://github.com/lutikri/web-3dgame1/blob/main/src/interactions/ItemInteractionRuntime.js): `src/interactions/ItemInteractionRuntime.js`

### Reactor operation

- [Fusion simulation](https://github.com/lutikri/web-3dgame1/blob/main/src/FusionCoreSimulation.js): `src/FusionCoreSimulation.js`
- [Physical control panel](https://github.com/lutikri/web-3dgame1/blob/main/src/panels/OperatorPanelRuntime.js): `src/panels/OperatorPanelRuntime.js`
- [Shift lifecycle](https://github.com/lutikri/web-3dgame1/blob/main/src/game/ShiftLifecycleRuntime.js): `src/game/ShiftLifecycleRuntime.js`
- [Shift report](https://github.com/lutikri/web-3dgame1/blob/main/src/game/ShiftReport.js): `src/game/ShiftReport.js`

### UI and terminal

- [Report presentation](https://github.com/lutikri/web-3dgame1/blob/main/src/ui/ShiftResultsController.js): `src/ui/ShiftResultsController.js`
- [Terminal interaction](https://github.com/lutikri/web-3dgame1/blob/main/src/prefabs/behaviors/ServiceTerminalInteractionRuntime.js): `src/prefabs/behaviors/ServiceTerminalInteractionRuntime.js`
- [Terminal renderer](https://github.com/lutikri/web-3dgame1/blob/main/src/prefabs/behaviors/ServiceTerminalCanvasRenderer.js): `src/prefabs/behaviors/ServiceTerminalCanvasRenderer.js`
- [Terminal content](https://github.com/lutikri/web-3dgame1/blob/main/src/app/panels/ServiceTerminalContent.js): `src/app/panels/ServiceTerminalContent.js`
- [Shift terminal data](https://github.com/lutikri/web-3dgame1/blob/main/src/app/panels/ServiceTerminalShiftConfig.js): `src/app/panels/ServiceTerminalShiftConfig.js`

### Runtime presentation

- [Audio systems](https://github.com/lutikri/web-3dgame1/blob/main/src/audio/AudioRuntime.js): `src/audio/AudioRuntime.js`
- [Lighting systems](https://github.com/lutikri/web-3dgame1/blob/main/src/lighting/LightingRuntime.js): `src/lighting/LightingRuntime.js`
- [Post-processing](https://github.com/lutikri/web-3dgame1/blob/main/src/postprocessing/PostProcessingRuntime.js): `src/postprocessing/PostProcessingRuntime.js`

### Other components

- **Operator**

## Connections

- Operator → Boot and preflight: starts game
- Boot and preflight → App shell: creates app
- App shell → App routing: routes screens
- App shell → Progress and saves: tracks progression
- Operator → App shell: selects shift
- App routing → Level lifecycle: transitions levels
- Shift definitions → Level lifecycle: supplies shifts
- Level lifecycle → Site-12 scenes: loads scene
- Site-12 scenes → World prefab behaviors: builds world
- Operator → First-person control: moves and looks
- First-person control → World interactions: targets objects
- World interactions → Physical control panel: activates controls
- Physical control panel → Fusion simulation: sets reactor inputs
- Fusion simulation → Physical control panel: updates instruments
- Shift lifecycle → Fusion simulation: evaluates operation
- Shift lifecycle → Shift report: builds outcome
- Shift report → Report presentation: renders metrics
- Operator → Terminal interaction: opens terminal
- Terminal interaction → Terminal renderer: handles focus
- Terminal renderer → Terminal content: requests content
- Terminal content → Shift terminal data: reads shift data
- Site-12 scenes → Lighting systems: presents spaces
- Site-12 scenes → Audio systems: presents sound
- Site-12 scenes → Post-processing: renders scene
