# ninja-ops-guy/techops-hero architecture

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

- Interactive diagram: https://gitdiagram.com/ninja-ops-guy/techops-hero
- Repository: https://github.com/ninja-ops-guy/techops-hero

## Overview

TechOps Hero is a browser-based roguelite help-desk RPG. The principal play loop moves from caller communication and investigation through evidence-based diagnosis, remediation, verification, documentation, and rewards; after 16:00, players can enter the separate Night Crawl platform-combat mode. The README also documents management, workforce, progression, home upgrades, and campaign/story content. The tree and sampled excerpts support the named modules, but most runtime source was not sampled, so subsystem wiring is shown only where the README describes a workflow or the sampled code documents ownership.

Main entry points: [`game.js`](https://github.com/ninja-ops-guy/techops-hero/blob/main/game.js) (Game Runtime), [`runtime_hud.js`](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_hud.js) (Management Console), [`runtime_night.js`](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_night.js) (Night Runtime), [`apt.js`](https://github.com/ninja-ops-guy/techops-hero/blob/main/apt.js) (Caller Tickets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Ticket Gameplay"]
  node_game["Game Runtime<br/>[game.js]"]
  node_call["Caller Tickets<br/>[apt.js]"]
  node_interview["Interview Process<br/>[state_validator.js]"]
  node_battle["Evidence Battles<br/>[night_combat.js]"]
  node_verification["Ticket Resolution"]
  node_teams["Teams Phone<br/>[ui_kit.js]"]
end

subgraph group_management["IT Management"]
  node_management_ui["Management Console<br/>[runtime_hud.js]"]
  node_workforce["Workforce<br/>[npcs.js]"]
  node_progression["Career Progression"]
  node_state[("Campaign State")]
  node_world["World Scenes<br/>[rooms.js]"]
end

subgraph group_night["Night Crawl"]
  node_mode["Mode Router"]
  node_night_runtime["Night Runtime<br/>[runtime_night.js]"]
  node_combat_input["Night Controls"]
  node_night_audio["Combat Audio"]
end

subgraph group_story["Story Campaign"]
  node_campaign["Story Campaign<br/>[campaign_story.js]"]
  node_cinematics["Cinematics"]
end

subgraph group_presentation["Presentation Assets"]
  node_campaign_assets["Campaign Assets<br/>[campaign_assets.js]"]
  node_asset_registry["Asset Registry"]
  node_visuals["Scene Art"]
end

node_player(("Player"))

node_player -->|"starts play"| node_game
node_game -->|"runs tickets"| node_call
node_call -->|"opens investigation"| node_interview
node_interview -->|"informs diagnosis"| node_battle
node_battle -->|"supports resolution"| node_verification
node_game -->|"opens phone"| node_teams
node_game -->|"opens console"| node_management_ui
node_management_ui -->|"manages staff"| node_workforce
node_management_ui -->|"unlocks perks"| node_progression
node_progression -->|"updates campaign"| node_state
node_game -->|"presents world"| node_world
node_player -->|"selects mode"| node_mode
node_mode -->|"routes night mode"| node_night_runtime
node_night_runtime -->|"reads controls"| node_combat_input
node_night_runtime -->|"plays combat audio"| node_night_audio
node_game -->|"runs story"| node_campaign
node_campaign -->|"presents scenes"| node_cinematics
node_game -->|"loads assets"| node_asset_registry
node_asset_registry -->|"indexes assets"| node_campaign_assets
node_game -->|"renders scenes"| node_visuals

click node_game "https://github.com/ninja-ops-guy/techops-hero/blob/main/game.js"
click node_call "https://github.com/ninja-ops-guy/techops-hero/blob/main/apt.js"
click node_interview "https://github.com/ninja-ops-guy/techops-hero/blob/main/state_validator.js"
click node_battle "https://github.com/ninja-ops-guy/techops-hero/blob/main/night_combat.js"
click node_verification "https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_runtime.js"
click node_teams "https://github.com/ninja-ops-guy/techops-hero/blob/main/ui_kit.js"
click node_management_ui "https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_hud.js"
click node_workforce "https://github.com/ninja-ops-guy/techops-hero/blob/main/npcs.js"
click node_progression "https://github.com/ninja-ops-guy/techops-hero/blob/main/good_boys_progression_authority.js"
click node_state "https://github.com/ninja-ops-guy/techops-hero/blob/main/good_dogs_campaign_state.js"
click node_world "https://github.com/ninja-ops-guy/techops-hero/blob/main/rooms.js"
click node_mode "https://github.com/ninja-ops-guy/techops-hero/blob/main/production_mode_router.js"
click node_night_runtime "https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_night.js"
click node_combat_input "https://github.com/ninja-ops-guy/techops-hero/blob/main/night_combat_input.js"
click node_night_audio "https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_combat_audio.js"
click node_campaign "https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_story.js"
click node_cinematics "https://github.com/ninja-ops-guy/techops-hero/blob/main/cinematic_systems.js"
click node_campaign_assets "https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_assets.js"
click node_asset_registry "https://github.com/ninja-ops-guy/techops-hero/blob/main/production_asset_registry.js"
click node_visuals "https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_scene_art.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_game,node_call,node_interview,node_battle,node_verification,node_teams toneBlue
class node_management_ui,node_workforce,node_progression,node_state,node_world toneAmber
class node_mode,node_night_runtime,node_combat_input,node_night_audio toneMint
class node_campaign,node_cinematics toneRose
class node_campaign_assets,node_asset_registry,node_visuals,node_player toneIndigo
```

## Components

### Ticket Gameplay

- [Game Runtime](https://github.com/ninja-ops-guy/techops-hero/blob/main/game.js): `game.js`
- [Caller Tickets](https://github.com/ninja-ops-guy/techops-hero/blob/main/apt.js): `apt.js`
- [Interview Process](https://github.com/ninja-ops-guy/techops-hero/blob/main/state_validator.js): `state_validator.js`
- [Evidence Battles](https://github.com/ninja-ops-guy/techops-hero/blob/main/night_combat.js): `night_combat.js`
- [Ticket Resolution](https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_runtime.js): `campaign_runtime.js`
- [Teams Phone](https://github.com/ninja-ops-guy/techops-hero/blob/main/ui_kit.js): `ui_kit.js`

### IT Management

- [Management Console](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_hud.js): `runtime_hud.js`
- [Workforce](https://github.com/ninja-ops-guy/techops-hero/blob/main/npcs.js): `npcs.js`
- [Career Progression](https://github.com/ninja-ops-guy/techops-hero/blob/main/good_boys_progression_authority.js): `good_boys_progression_authority.js`
- [Campaign State](https://github.com/ninja-ops-guy/techops-hero/blob/main/good_dogs_campaign_state.js): `good_dogs_campaign_state.js`
- [World Scenes](https://github.com/ninja-ops-guy/techops-hero/blob/main/rooms.js): `rooms.js`

### Night Crawl

- [Mode Router](https://github.com/ninja-ops-guy/techops-hero/blob/main/production_mode_router.js): `production_mode_router.js`
- [Night Runtime](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_night.js): `runtime_night.js`
- [Night Controls](https://github.com/ninja-ops-guy/techops-hero/blob/main/night_combat_input.js): `night_combat_input.js`
- [Combat Audio](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_combat_audio.js): `runtime_combat_audio.js`

### Story Campaign

- [Story Campaign](https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_story.js): `campaign_story.js`
- [Cinematics](https://github.com/ninja-ops-guy/techops-hero/blob/main/cinematic_systems.js): `cinematic_systems.js`

### Presentation Assets

- [Campaign Assets](https://github.com/ninja-ops-guy/techops-hero/blob/main/campaign_assets.js): `campaign_assets.js`
- [Asset Registry](https://github.com/ninja-ops-guy/techops-hero/blob/main/production_asset_registry.js): `production_asset_registry.js`
- [Scene Art](https://github.com/ninja-ops-guy/techops-hero/blob/main/runtime_scene_art.js): `runtime_scene_art.js`

### Other components

- **Player**

## Connections

- Player → Game Runtime: starts play
- Game Runtime → Caller Tickets: runs tickets
- Caller Tickets → Interview Process: opens investigation
- Interview Process → Evidence Battles: informs diagnosis
- Evidence Battles → Ticket Resolution: supports resolution
- Game Runtime → Teams Phone: opens phone
- Game Runtime → Management Console: opens console
- Management Console → Workforce: manages staff
- Management Console → Career Progression: unlocks perks
- Career Progression → Campaign State: updates campaign
- Game Runtime → World Scenes: presents world
- Player → Mode Router: selects mode
- Mode Router → Night Runtime: routes night mode
- Night Runtime → Night Controls: reads controls
- Night Runtime → Combat Audio: plays combat audio
- Game Runtime → Story Campaign: runs story
- Story Campaign → Cinematics: presents scenes
- Game Runtime → Asset Registry: loads assets
- Asset Registry → Campaign Assets: indexes assets
- Game Runtime → Scene Art: renders scenes
