# h-xx-d/scrapper architecture

> Architecture diagram of the GitHub repository h-xx-d/scrapper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/h-xx-d/scrapper
- Repository: https://github.com/h-xx-d/scrapper

## Overview

Scrapper is a browser-based first-person salvage and infestation shooter. The player selects a chapter, deploys, navigates a station, restores chapter systems, fights hostile organisms and a guardian, then extracts and records campaign choices. The graph preserves the documented navigation, combat, puzzle, campaign, co-op, controller, and rendering capabilities. Several runtime files are unsampled; edges between those systems are included only where the README documents the relationship or the source index supports a direct reference.

Main entry points: [`src/app.js`](https://github.com/h-xx-d/scrapper/blob/master/src/app.js) (Game runtime), [`src/campaign.js`](https://github.com/h-xx-d/scrapper/blob/master/src/campaign.js) (Chapter campaign), [`src/combat.js`](https://github.com/h-xx-d/scrapper/blob/master/src/combat.js) (Combat), [`src/world.js`](https://github.com/h-xx-d/scrapper/blob/master/src/world.js) (Station layouts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Play loop"]
  node_app["Game runtime<br/>[app.js]"]
  node_campaign["Chapter campaign<br/>[campaign.js]"]
  node_story["Contract journal<br/>[campaign-story.js]"]
  node_save["Campaign saves<br/>[campaign-save.js]"]
end

subgraph group_world["Station world"]
  node_worldgen["Station layouts<br/>[world.js]"]
  node_chapterlayouts["Chapter topology<br/>[chapter-layouts.js]"]
  node_navigation["Route guidance<br/>[navigation.js]"]
  node_compass["Compass HUD<br/>[compass.js]"]
end

subgraph group_systems["Mission systems"]
  node_tasks["Mission tasks<br/>[mission-tasks.js]"]
  node_puzzles["Chapter puzzles<br/>[puzzle-systems.js]"]
  node_combat["Combat<br/>[combat.js]"]
  node_parasites["Parasite systems<br/>[parasites.js]"]
  node_pods["Clinger pods<br/>[clinger-pods.js]"]
  node_grab["Capture recovery<br/>[grabs.js]"]
  node_catalog["Game catalog<br/>[catalog.js]"]
end

subgraph group_presentation["Game presentation"]
  node_renderer["Level renderer<br/>[level-renderer.js]"]
  node_assets["Art atlas<br/>[atlas.js]"]
  node_audio["Sound<br/>[audio.js]"]
  node_visor["Visor effects<br/>[visor.js]"]
end

subgraph group_online["Crew and online"]
  node_network["Room networking<br/>[network.js]"]
  node_crew["Crew state<br/>[crew.js]"]
  node_controller["Controller input<br/>[controller.js]"]
  node_controllerui["Controller menus<br/>[controller-menu.js]"]
end

node_player(("Player"))

node_player -->|"plays"| node_app
node_app -->|"starts missions"| node_campaign
node_campaign -->|"uses chapter stories"| node_story
node_campaign -->|"records progress"| node_save
node_app -->|"builds station"| node_worldgen
node_worldgen -->|"loads topology"| node_chapterlayouts
node_player -->|"follows route"| node_navigation
node_navigation -->|"guides movement"| node_compass
node_player -->|"uses equipment"| node_tasks
node_tasks -->|"delegates chapter tasks"| node_puzzles
node_player -->|"fights hostiles"| node_combat
node_combat -->|"uses parasite definitions"| node_parasites
node_app -->|"launches clingers"| node_pods
node_player -->|"escapes capture"| node_grab
node_player -->|"joins room"| node_network
node_network -->|"uses crew state"| node_crew
node_player -->|"controls game"| node_controller
node_controllerui -->|"reads controller state"| node_controller
node_app -.->|"renders station"| node_renderer
node_renderer -->|"uses atlas"| node_assets
node_player -->|"views visor effects"| node_visor
node_app -.->|"plays sound"| node_audio
node_combat -->|"reads actor data"| node_catalog

click node_app "https://github.com/h-xx-d/scrapper/blob/master/src/app.js"
click node_campaign "https://github.com/h-xx-d/scrapper/blob/master/src/campaign.js"
click node_story "https://github.com/h-xx-d/scrapper/blob/master/src/campaign-story.js"
click node_save "https://github.com/h-xx-d/scrapper/blob/master/src/campaign-save.js"
click node_worldgen "https://github.com/h-xx-d/scrapper/blob/master/src/world.js"
click node_chapterlayouts "https://github.com/h-xx-d/scrapper/blob/master/src/chapter-layouts.js"
click node_navigation "https://github.com/h-xx-d/scrapper/blob/master/src/navigation.js"
click node_compass "https://github.com/h-xx-d/scrapper/blob/master/src/compass.js"
click node_tasks "https://github.com/h-xx-d/scrapper/blob/master/src/mission-tasks.js"
click node_puzzles "https://github.com/h-xx-d/scrapper/blob/master/src/puzzle-systems.js"
click node_combat "https://github.com/h-xx-d/scrapper/blob/master/src/combat.js"
click node_parasites "https://github.com/h-xx-d/scrapper/blob/master/src/parasites.js"
click node_pods "https://github.com/h-xx-d/scrapper/blob/master/src/clinger-pods.js"
click node_grab "https://github.com/h-xx-d/scrapper/blob/master/src/grabs.js"
click node_network "https://github.com/h-xx-d/scrapper/blob/master/src/network.js"
click node_crew "https://github.com/h-xx-d/scrapper/blob/master/src/crew.js"
click node_controller "https://github.com/h-xx-d/scrapper/blob/master/src/controller.js"
click node_controllerui "https://github.com/h-xx-d/scrapper/blob/master/src/controller-menu.js"
click node_renderer "https://github.com/h-xx-d/scrapper/blob/master/src/level-renderer.js"
click node_assets "https://github.com/h-xx-d/scrapper/blob/master/src/atlas.js"
click node_audio "https://github.com/h-xx-d/scrapper/blob/master/src/audio.js"
click node_visor "https://github.com/h-xx-d/scrapper/blob/master/src/visor.js"
click node_catalog "https://github.com/h-xx-d/scrapper/blob/master/src/catalog.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_app,node_campaign,node_story,node_save toneBlue
class node_worldgen,node_chapterlayouts,node_navigation,node_compass toneAmber
class node_tasks,node_puzzles,node_combat,node_parasites,node_pods,node_grab,node_catalog toneMint
class node_renderer,node_assets,node_audio,node_visor toneRose
class node_network,node_crew,node_controller,node_controllerui,node_player toneIndigo
```

## Components

### Play loop

- [Game runtime](https://github.com/h-xx-d/scrapper/blob/master/src/app.js): `src/app.js`
- [Chapter campaign](https://github.com/h-xx-d/scrapper/blob/master/src/campaign.js): `src/campaign.js`
- [Contract journal](https://github.com/h-xx-d/scrapper/blob/master/src/campaign-story.js): `src/campaign-story.js`
- [Campaign saves](https://github.com/h-xx-d/scrapper/blob/master/src/campaign-save.js): `src/campaign-save.js`

### Station world

- [Station layouts](https://github.com/h-xx-d/scrapper/blob/master/src/world.js): `src/world.js`
- [Chapter topology](https://github.com/h-xx-d/scrapper/blob/master/src/chapter-layouts.js): `src/chapter-layouts.js`
- [Route guidance](https://github.com/h-xx-d/scrapper/blob/master/src/navigation.js): `src/navigation.js`
- [Compass HUD](https://github.com/h-xx-d/scrapper/blob/master/src/compass.js): `src/compass.js`

### Mission systems

- [Mission tasks](https://github.com/h-xx-d/scrapper/blob/master/src/mission-tasks.js): `src/mission-tasks.js`
- [Chapter puzzles](https://github.com/h-xx-d/scrapper/blob/master/src/puzzle-systems.js): `src/puzzle-systems.js`
- [Combat](https://github.com/h-xx-d/scrapper/blob/master/src/combat.js): `src/combat.js`
- [Parasite systems](https://github.com/h-xx-d/scrapper/blob/master/src/parasites.js): `src/parasites.js`
- [Clinger pods](https://github.com/h-xx-d/scrapper/blob/master/src/clinger-pods.js): `src/clinger-pods.js`
- [Capture recovery](https://github.com/h-xx-d/scrapper/blob/master/src/grabs.js): `src/grabs.js`
- [Game catalog](https://github.com/h-xx-d/scrapper/blob/master/src/catalog.js): `src/catalog.js`

### Game presentation

- [Level renderer](https://github.com/h-xx-d/scrapper/blob/master/src/level-renderer.js): `src/level-renderer.js`
- [Art atlas](https://github.com/h-xx-d/scrapper/blob/master/src/atlas.js): `src/atlas.js`
- [Sound](https://github.com/h-xx-d/scrapper/blob/master/src/audio.js): `src/audio.js`
- [Visor effects](https://github.com/h-xx-d/scrapper/blob/master/src/visor.js): `src/visor.js`

### Crew and online

- [Room networking](https://github.com/h-xx-d/scrapper/blob/master/src/network.js): `src/network.js`
- [Crew state](https://github.com/h-xx-d/scrapper/blob/master/src/crew.js): `src/crew.js`
- [Controller input](https://github.com/h-xx-d/scrapper/blob/master/src/controller.js): `src/controller.js`
- [Controller menus](https://github.com/h-xx-d/scrapper/blob/master/src/controller-menu.js): `src/controller-menu.js`

### Other components

- **Player**

## Connections

- Player → Game runtime: plays (evidence: `README.md`)
- Game runtime → Chapter campaign: starts missions (evidence: `README.md`)
- Chapter campaign → Contract journal: uses chapter stories (evidence: `src/campaign.js`)
- Chapter campaign → Campaign saves: records progress (evidence: `README.md`)
- Game runtime → Station layouts: builds station (evidence: `src/app.js`)
- Station layouts → Chapter topology: loads topology (evidence: `src/world.js`)
- Player → Route guidance: follows route (evidence: `README.md`)
- Route guidance → Compass HUD: guides movement (evidence: `src/compass.js`)
- Player → Mission tasks: uses equipment (evidence: `README.md`)
- Mission tasks → Chapter puzzles: delegates chapter tasks (evidence: `src/mission-tasks.js`)
- Player → Combat: fights hostiles (evidence: `README.md`)
- Combat → Parasite systems: uses parasite definitions (evidence: `src/combat.js`)
- Game runtime → Clinger pods: launches clingers (evidence: `src/app.js`)
- Player → Capture recovery: escapes capture (evidence: `README.md`)
- Player → Room networking: joins room (evidence: `README.md`)
- Room networking → Crew state: uses crew state (evidence: `src/network.js`)
- Player → Controller input: controls game (evidence: `README.md`)
- Controller menus → Controller input: reads controller state (evidence: `src/controller-menu.js`)
- Game runtime → Level renderer: renders station (evidence: `src/app.js`)
- Level renderer → Art atlas: uses atlas (evidence: `src/level-renderer.js`)
- Player → Visor effects: views visor effects (evidence: `README.md`)
- Game runtime → Sound: plays sound (evidence: `src/app.js`)
- Combat → Game catalog: reads actor data (evidence: `src/combat.js`)
