# pranaypr9/nexus-2097 architecture

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

- Interactive diagram: https://gitdiagram.com/pranaypr9/nexus-2097
- Repository: https://github.com/pranaypr9/nexus-2097

## Overview

NEXUS: 2097 is a browser-based cyberpunk action game. The player starts or continues a campaign, controls UNIT-07 through combat and district encounters, explores story records, and ultimately fights ARCHON; victory leads to the chapter-ending reveal. The graph separates runtime orchestration, combat, campaign/story, and player-facing systems, with progression and saved state as an internal layer. Edges follow sampled calls or README statements; unsampled runtime wiring is omitted rather than inferred.

Main entry points: [`game.js`](https://github.com/pranaypr9/nexus-2097/blob/main/game.js) (Game Controller), [`main.js`](https://github.com/pranaypr9/nexus-2097/blob/main/main.js) (Input and Startup), [`boss.js`](https://github.com/pranaypr9/nexus-2097/blob/main/boss.js) (ARCHON Boss), [`ui.js`](https://github.com/pranaypr9/nexus-2097/blob/main/ui.js) (HUD and Menus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_entry["Input and Startup<br/>[main.js]"]
  node_game["Game Controller<br/>[game.js]"]
end

subgraph group_combat["Combat Systems"]
  node_archon["ARCHON Boss<br/>[boss.js]"]
  node_player_unit["UNIT-07<br/>[player.js]"]
  node_enemies["Enemy AI<br/>[enemies.js]"]
  node_weapons["Weapons and Projectiles<br/>[weapons.js]"]
  node_effects["Combat Effects<br/>[effects.js]"]
end

subgraph group_campaign["Campaign and Story"]
  node_level["District Builder<br/>[levels.js]"]
  node_story["Story Records<br/>[story.js]"]
end

subgraph group_player["Player Experience"]
  node_scene["Game Canvas and Panels<br/>[index.html]"]
  node_ui["HUD and Menus<br/>[ui.js]"]
  node_audio["Synthesized Audio<br/>[audio.js]"]
end

subgraph group_persistence["Progression and Saves"]
  node_progression["Upgrade Catalog<br/>[progression.js]"]
  node_save[("Local Save Data<br/>[saveSystem.js]")]
end

node_player_actor(("Player"))
node_browser["Browser"]
node_three["Three.js"]

node_player_actor -->|"provides input"| node_entry
node_browser -.->|"loads scripts"| node_entry
node_entry -->|"initializes"| node_ui
node_entry -->|"initializes"| node_game
node_entry -->|"routes controls"| node_weapons
node_entry -->|"routes abilities"| node_player_unit
node_entry -->|"routes interaction"| node_story
node_game -->|"builds districts"| node_level
node_game -->|"initializes"| node_effects
node_game -->|"initializes"| node_weapons
node_game -->|"initializes"| node_player_unit
node_game -->|"initializes"| node_enemies
node_game -->|"initializes"| node_archon
node_game -->|"starts transmissions"| node_story
node_ui -->|"starts campaign"| node_game
node_ui -->|"purchases upgrades"| node_progression
node_ui -->|"loads settings"| node_save
node_ui -->|"toggles audio"| node_audio
node_story -->|"reads terminals"| node_level
node_story -->|"saves fragments"| node_save
node_story -->|"shows dialogue"| node_ui
node_story -->|"plays cues"| node_audio
node_player_unit -->|"applies EMP"| node_enemies
node_player_unit -->|"damages boss"| node_archon
node_player_unit -->|"creates effects"| node_effects
node_weapons -->|"creates feedback"| node_effects
node_weapons -->|"damages boss"| node_archon
node_archon -->|"starts boss state"| node_game
node_archon -->|"updates boss display"| node_ui
node_archon -->|"triggers effects"| node_effects
node_archon -->|"plays cues"| node_audio
node_three -.->|"renders scene"| node_game
node_scene -.->|"hosts canvas"| node_game
node_progression -.->|"stores upgrade levels"| node_save

click node_entry "https://github.com/pranaypr9/nexus-2097/blob/main/main.js"
click node_game "https://github.com/pranaypr9/nexus-2097/blob/main/game.js"
click node_scene "https://github.com/pranaypr9/nexus-2097/blob/main/index.html"
click node_ui "https://github.com/pranaypr9/nexus-2097/blob/main/ui.js"
click node_level "https://github.com/pranaypr9/nexus-2097/blob/main/levels.js"
click node_story "https://github.com/pranaypr9/nexus-2097/blob/main/story.js"
click node_archon "https://github.com/pranaypr9/nexus-2097/blob/main/boss.js"
click node_player_unit "https://github.com/pranaypr9/nexus-2097/blob/main/player.js"
click node_enemies "https://github.com/pranaypr9/nexus-2097/blob/main/enemies.js"
click node_weapons "https://github.com/pranaypr9/nexus-2097/blob/main/weapons.js"
click node_effects "https://github.com/pranaypr9/nexus-2097/blob/main/effects.js"
click node_audio "https://github.com/pranaypr9/nexus-2097/blob/main/audio.js"
click node_progression "https://github.com/pranaypr9/nexus-2097/blob/main/progression.js"
click node_save "https://github.com/pranaypr9/nexus-2097/blob/main/saveSystem.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_entry,node_game,node_browser toneBlue
class node_archon,node_player_unit,node_enemies,node_weapons,node_effects toneAmber
class node_level,node_story toneMint
class node_scene,node_ui,node_audio toneRose
class node_progression,node_save,node_player_actor,node_three toneIndigo
```

## Components

### Game Runtime

- [Input and Startup](https://github.com/pranaypr9/nexus-2097/blob/main/main.js): `main.js`
- [Game Controller](https://github.com/pranaypr9/nexus-2097/blob/main/game.js): `game.js`

### Combat Systems

- [ARCHON Boss](https://github.com/pranaypr9/nexus-2097/blob/main/boss.js): `boss.js`
- [UNIT-07](https://github.com/pranaypr9/nexus-2097/blob/main/player.js): `player.js`
- [Enemy AI](https://github.com/pranaypr9/nexus-2097/blob/main/enemies.js): `enemies.js`
- [Weapons and Projectiles](https://github.com/pranaypr9/nexus-2097/blob/main/weapons.js): `weapons.js`
- [Combat Effects](https://github.com/pranaypr9/nexus-2097/blob/main/effects.js): `effects.js`

### Campaign and Story

- [District Builder](https://github.com/pranaypr9/nexus-2097/blob/main/levels.js): `levels.js`
- [Story Records](https://github.com/pranaypr9/nexus-2097/blob/main/story.js): `story.js`

### Player Experience

- [Game Canvas and Panels](https://github.com/pranaypr9/nexus-2097/blob/main/index.html): `index.html`
- [HUD and Menus](https://github.com/pranaypr9/nexus-2097/blob/main/ui.js): `ui.js`
- [Synthesized Audio](https://github.com/pranaypr9/nexus-2097/blob/main/audio.js): `audio.js`

### Progression and Saves

- [Upgrade Catalog](https://github.com/pranaypr9/nexus-2097/blob/main/progression.js): `progression.js`
- [Local Save Data](https://github.com/pranaypr9/nexus-2097/blob/main/saveSystem.js): `saveSystem.js`

### Other components

- **Player**
- **Browser**
- **Three.js**

## Connections

- Player → Input and Startup: provides input (evidence: `main.js`)
- Browser → Input and Startup: loads scripts (evidence: `README.md`)
- Input and Startup → HUD and Menus: initializes (evidence: `main.js`)
- Input and Startup → Game Controller: initializes (evidence: `main.js`)
- Input and Startup → Weapons and Projectiles: routes controls (evidence: `main.js`)
- Input and Startup → UNIT-07: routes abilities (evidence: `main.js`)
- Input and Startup → Story Records: routes interaction (evidence: `main.js`)
- Game Controller → District Builder: builds districts (evidence: `game.js`)
- Game Controller → Combat Effects: initializes (evidence: `game.js`)
- Game Controller → Weapons and Projectiles: initializes (evidence: `game.js`)
- Game Controller → UNIT-07: initializes (evidence: `game.js`)
- Game Controller → Enemy AI: initializes (evidence: `game.js`)
- Game Controller → ARCHON Boss: initializes (evidence: `game.js`)
- Game Controller → Story Records: starts transmissions (evidence: `game.js`)
- HUD and Menus → Game Controller: starts campaign (evidence: `ui.js`)
- HUD and Menus → Upgrade Catalog: purchases upgrades (evidence: `ui.js`)
- HUD and Menus → Local Save Data: loads settings (evidence: `ui.js`)
- HUD and Menus → Synthesized Audio: toggles audio (evidence: `ui.js`)
- Story Records → District Builder: reads terminals (evidence: `story.js`)
- Story Records → Local Save Data: saves fragments (evidence: `story.js`)
- Story Records → HUD and Menus: shows dialogue (evidence: `story.js`)
- Story Records → Synthesized Audio: plays cues (evidence: `story.js`)
- UNIT-07 → Enemy AI: applies EMP (evidence: `player.js`)
- UNIT-07 → ARCHON Boss: damages boss (evidence: `player.js`)
- UNIT-07 → Combat Effects: creates effects (evidence: `player.js`)
- Weapons and Projectiles → Combat Effects: creates feedback (evidence: `weapons.js`)
- Weapons and Projectiles → ARCHON Boss: damages boss (evidence: `weapons.js`)
- ARCHON Boss → Game Controller: starts boss state (evidence: `boss.js`)
- ARCHON Boss → HUD and Menus: updates boss display (evidence: `boss.js`)
- ARCHON Boss → Combat Effects: triggers effects (evidence: `boss.js`)
- ARCHON Boss → Synthesized Audio: plays cues (evidence: `boss.js`)
- Three.js → Game Controller: renders scene (evidence: `README.md`)
- Game Canvas and Panels → Game Controller: hosts canvas (evidence: `README.md`)
- Upgrade Catalog → Local Save Data: stores upgrade levels (evidence: `README.md`)
