# ikigaiw0w/survivorio architecture

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

- Interactive diagram: https://gitdiagram.com/ikigaiw0w/survivorio
- Repository: https://github.com/ikigaiw0w/survivorio

## Overview

Hordefall is a dependency-free browser horde-survival roguelite. The player uses the hub to configure a run, then survives auto-attack combat, gathers XP and gold, chooses upgrades, completes quests and rolling objectives, and returns to persistent progression. The graph separates hub and progression, run systems, and presentation from shared runtime helpers. Relationships are limited to those shown in excerpts or documented in the README; some game-to-run wiring is not visible in the sampled engine excerpt.

Main entry points: [`hordefall/js/game.js`](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/game.js) (Game Engine), [`hordefall/js/ui.js`](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/ui.js) (Hub UI), [`hordefall/index.html`](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/index.html) (Game Page), [`hordefall/js/meta.js`](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/meta.js) (Meta Progression)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hub["Hub and Progression"]
  node_game_page["Game Page<br/>[index.html]"]
  node_hub_ui["Hub UI<br/>[ui.js]"]
  node_meta["Meta Progression<br/>[meta.js]"]
  node_save_store["Save Store<br/>[util.js]"]
  node_browser_storage[("Browser Storage")]
end

subgraph group_run["Run Systems"]
  node_engine["Game Engine<br/>[game.js]"]
  node_weapons["Weapons and Abilities<br/>[weapons.js]"]
  node_upgrades["Run Upgrades<br/>[upgrades.js]"]
  node_objectives["Quest and Objective Tracker<br/>[objectives.js]"]
end

subgraph group_presentation["Player Presentation"]
  node_audio["Synth Audio<br/>[audio.js]"]
  node_rpg_ui["Character Sheet and Log<br/>[rpgui.js]"]
end

subgraph group_runtime["Runtime Support"]
  node_utilities["Math and Collections<br/>[util.js]"]
end

node_player(("Player"))

node_player -->|"opens"| node_game_page
node_game_page -->|"hosts hub"| node_hub_ui
node_hub_ui -->|"manages loadout"| node_meta
node_meta -->|"loads and saves"| node_save_store
node_save_store -->|"reads and writes"| node_browser_storage
node_hub_ui -->|"starts run"| node_engine
node_engine -.->|"runs combat"| node_weapons
node_engine -.->|"offers powers"| node_upgrades
node_engine -.->|"tracks run goals"| node_objectives
node_engine -->|"plays effects"| node_audio
node_hub_ui -->|"plays UI sounds"| node_audio
node_player -->|"opens character sheet"| node_rpg_ui
node_rpg_ui -->|"reads weapon stats"| node_weapons
node_engine -->|"uses spatial hash"| node_utilities

click node_game_page "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/index.html"
click node_hub_ui "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/ui.js"
click node_meta "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/meta.js"
click node_save_store "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/util.js"
click node_engine "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/game.js"
click node_weapons "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/weapons.js"
click node_upgrades "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/upgrades.js"
click node_objectives "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/objectives.js"
click node_audio "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/audio.js"
click node_rpg_ui "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/rpgui.js"
click node_utilities "https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/util.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_page,node_hub_ui,node_meta,node_save_store,node_browser_storage toneBlue
class node_engine,node_weapons,node_upgrades,node_objectives toneAmber
class node_audio,node_rpg_ui toneMint
class node_utilities toneRose
class node_player toneIndigo
```

## Components

### Hub and Progression

- [Game Page](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/index.html): `hordefall/index.html`
- [Hub UI](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/ui.js): `hordefall/js/ui.js`
- [Meta Progression](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/meta.js): `hordefall/js/meta.js`
- [Save Store](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/util.js): `hordefall/js/util.js`
- **Browser Storage**

### Run Systems

- [Game Engine](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/game.js): `hordefall/js/game.js`
- [Weapons and Abilities](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/weapons.js): `hordefall/js/weapons.js`
- [Run Upgrades](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/upgrades.js): `hordefall/js/upgrades.js`
- [Quest and Objective Tracker](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/objectives.js): `hordefall/js/objectives.js`

### Player Presentation

- [Synth Audio](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/audio.js): `hordefall/js/audio.js`
- [Character Sheet and Log](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/rpgui.js): `hordefall/js/rpgui.js`

### Runtime Support

- [Math and Collections](https://github.com/ikigaiw0w/survivorio/blob/main/hordefall/js/util.js): `hordefall/js/util.js`

### Other components

- **Player**

## Connections

- Player → Game Page: opens (evidence: `README.md`)
- Game Page → Hub UI: hosts hub (evidence: `README.md`)
- Hub UI → Meta Progression: manages loadout (evidence: `hordefall/js/ui.js`)
- Meta Progression → Save Store: loads and saves (evidence: `hordefall/js/meta.js`)
- Save Store → Browser Storage: reads and writes (evidence: `hordefall/js/util.js`)
- Hub UI → Game Engine: starts run (evidence: `README.md`)
- Game Engine → Weapons and Abilities: runs combat
- Game Engine → Run Upgrades: offers powers
- Game Engine → Quest and Objective Tracker: tracks run goals
- Game Engine → Synth Audio: plays effects (evidence: `hordefall/js/game.js`)
- Hub UI → Synth Audio: plays UI sounds (evidence: `hordefall/js/ui.js`)
- Player → Character Sheet and Log: opens character sheet (evidence: `README.md`)
- Character Sheet and Log → Weapons and Abilities: reads weapon stats (evidence: `hordefall/js/rpgui.js`)
- Game Engine → Math and Collections: uses spatial hash (evidence: `hordefall/js/game.js`)
