# jhohanguadalupe/trashman architecture

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

- Interactive diagram: https://gitdiagram.com/jhohanguadalupe/trashman
- Repository: https://github.com/jhohanguadalupe/trashman

## Overview

TrashMan is a browser-based 3D cleanup adventure game, with solo story/adventure play and shared online rooms. The player enters through the browser game, plays in a rendered world, and progresses through cleanup or Titan combat; inventory, companions, and shops support that loop. The graph highlights these domain stages and the game engine that renders and updates them. The README is empty, and source excerpts are partial, so links are limited to relationships visible in excerpts; unsampled capabilities are represented without guessed wiring.

Main entry points: [`TrashMan-main/js/ui/uiController.js`](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/ui/uiController.js) (Game interface), [`TrashMan-main/js/modes/onlineRoom.js`](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/onlineRoom.js) (Online room client), [`TrashMan-main/js/main.js`](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/main.js) (Game orchestrator), [`TrashMan-main/js/modes/adventureMode.js`](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/adventureMode.js) (Titan adventure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game modes"]
  node_story["Story mode<br/>[storyMode.js]"]
  node_adventure["Titan adventure<br/>[adventureMode.js]"]
  node_titanstory["Titan story<br/>[titanStory.js]"]
end

subgraph group_engine["Game engine"]
  node_game["Game orchestrator<br/>[main.js]"]
  node_graphics["Graphics pipeline<br/>[graphics.js]"]
  node_camera["Camera control<br/>[camera.js]"]
  node_character["Character builder<br/>[character.js]"]
  node_emotes["Emote animation<br/>[emotes.js]"]
  node_gamepad["Gamepad input<br/>[gamepad.js]"]
  node_humans["Character animation<br/>[humans.js]"]
  node_textures["Texture system<br/>[textures.js]"]
  node_assetloader["Asset loader<br/>[assetLoader.js]"]
end

subgraph group_world["World simulation"]
  node_mapdata["Map definitions<br/>[mapsData.js]"]
  node_maps["Map builder<br/>[maps.js]"]
  node_monsters["Monsters<br/>[monsters.js]"]
  node_boss["Boss encounter<br/>[boss.js]"]
  node_trash["Trash collection<br/>[trash.js]"]
  node_worldlife["Living ecosystem<br/>[worldLife.js]"]
end

subgraph group_progress["Player progression"]
  node_ui["Game interface<br/>[uiController.js]"]
  node_shop["Recycling shop<br/>[recyclingShop.js]"]
  node_items["Item catalog<br/>[items.js]"]
  node_state["Player state<br/>[state.js]"]
end

subgraph group_online["Online rooms"]
  node_onlineclient["Online room client<br/>[onlineRoom.js]"]
  node_multiplayer["Remote players<br/>[multiplayerMode.js]"]
  node_roomserver["Room server<br/>[room-server.js]"]
  node_roomworker["Room worker<br/>[worker.js]"]
end

node_player(("Player"))

node_player -->|"plays"| node_game
node_game -->|"creates composer"| node_graphics
node_game -->|"updates"| node_onlineclient
node_game -->|"reads input"| node_gamepad
node_maps -->|"reads definitions"| node_mapdata
node_maps -->|"gets textures"| node_textures
node_adventure -->|"attacks"| node_monsters
node_adventure -->|"awards progress"| node_state
node_adventure -->|"shows feedback"| node_ui
node_adventure -.->|"faces"| node_boss
node_ui -->|"rebuilds hero"| node_character
node_ui -->|"reads equipment"| node_state
node_ui -.->|"renders catalog"| node_items
node_ui -.->|"opens shop"| node_shop
node_onlineclient -->|"updates players"| node_multiplayer
node_onlineclient -->|"applies deposits"| node_story
node_onlineclient -->|"requests lobby"| node_game
node_onlineclient -.->|"connects by WebSocket"| node_roomworker
node_roomworker -.->|"routes rooms"| node_roomserver

click node_game "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/main.js"
click node_graphics "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/graphics.js"
click node_camera "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/camera.js"
click node_character "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/character.js"
click node_emotes "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/emotes.js"
click node_gamepad "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/gamepad.js"
click node_humans "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/humans.js"
click node_textures "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/textures.js"
click node_assetloader "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/assetLoader.js"
click node_mapdata "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/mapsData.js"
click node_maps "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/maps.js"
click node_monsters "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/monsters.js"
click node_boss "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/boss.js"
click node_trash "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/trash.js"
click node_worldlife "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/worldLife.js"
click node_story "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/storyMode.js"
click node_adventure "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/adventureMode.js"
click node_titanstory "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/titanStory.js"
click node_ui "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/ui/uiController.js"
click node_shop "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/ui/recyclingShop.js"
click node_items "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/items.js"
click node_state "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/state.js"
click node_onlineclient "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/onlineRoom.js"
click node_multiplayer "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/multiplayerMode.js"
click node_roomserver "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/server/room-server.js"
click node_roomworker "https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/worker.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_story,node_adventure,node_titanstory toneBlue
class node_game,node_graphics,node_camera,node_character,node_emotes,node_gamepad,node_humans,node_textures,node_assetloader toneAmber
class node_mapdata,node_maps,node_monsters,node_boss,node_trash,node_worldlife toneMint
class node_ui,node_shop,node_items,node_state toneRose
class node_onlineclient,node_multiplayer,node_roomserver,node_roomworker,node_player toneIndigo
```

## Components

### Game modes

- [Story mode](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/storyMode.js): `TrashMan-main/js/modes/storyMode.js`
- [Titan adventure](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/adventureMode.js): `TrashMan-main/js/modes/adventureMode.js`
- [Titan story](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/titanStory.js): `TrashMan-main/js/modes/titanStory.js`

### Game engine

- [Game orchestrator](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/main.js): `TrashMan-main/js/main.js`
- [Graphics pipeline](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/graphics.js): `TrashMan-main/js/engine/graphics.js`
- [Camera control](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/camera.js): `TrashMan-main/js/engine/camera.js`
- [Character builder](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/character.js): `TrashMan-main/js/engine/character.js`
- [Emote animation](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/emotes.js): `TrashMan-main/js/engine/emotes.js`
- [Gamepad input](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/gamepad.js): `TrashMan-main/js/engine/gamepad.js`
- [Character animation](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/humans.js): `TrashMan-main/js/engine/humans.js`
- [Texture system](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/textures.js): `TrashMan-main/js/engine/textures.js`
- [Asset loader](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/engine/assetLoader.js): `TrashMan-main/js/engine/assetLoader.js`

### World simulation

- [Map definitions](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/mapsData.js): `TrashMan-main/js/data/mapsData.js`
- [Map builder](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/maps.js): `TrashMan-main/js/world/maps.js`
- [Monsters](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/monsters.js): `TrashMan-main/js/world/monsters.js`
- [Boss encounter](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/boss.js): `TrashMan-main/js/world/boss.js`
- [Trash collection](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/trash.js): `TrashMan-main/js/world/trash.js`
- [Living ecosystem](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/world/worldLife.js): `TrashMan-main/js/world/worldLife.js`

### Player progression

- [Game interface](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/ui/uiController.js): `TrashMan-main/js/ui/uiController.js`
- [Recycling shop](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/ui/recyclingShop.js): `TrashMan-main/js/ui/recyclingShop.js`
- [Item catalog](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/items.js): `TrashMan-main/js/data/items.js`
- [Player state](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/data/state.js): `TrashMan-main/js/data/state.js`

### Online rooms

- [Online room client](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/onlineRoom.js): `TrashMan-main/js/modes/onlineRoom.js`
- [Remote players](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/js/modes/multiplayerMode.js): `TrashMan-main/js/modes/multiplayerMode.js`
- [Room server](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/server/room-server.js): `TrashMan-main/server/room-server.js`
- [Room worker](https://github.com/jhohanguadalupe/trashman/blob/main/TrashMan-main/worker.js): `TrashMan-main/worker.js`

### Other components

- **Player**

## Connections

- Player → Game orchestrator: plays
- Game orchestrator → Graphics pipeline: creates composer (evidence: `TrashMan-main/js/main.js`)
- Game orchestrator → Online room client: updates (evidence: `TrashMan-main/js/main.js`)
- Game orchestrator → Gamepad input: reads input (evidence: `TrashMan-main/js/main.js`)
- Map builder → Map definitions: reads definitions (evidence: `TrashMan-main/js/world/maps.js`)
- Map builder → Texture system: gets textures (evidence: `TrashMan-main/js/world/maps.js`)
- Titan adventure → Monsters: attacks (evidence: `TrashMan-main/js/modes/adventureMode.js`)
- Titan adventure → Player state: awards progress (evidence: `TrashMan-main/js/modes/adventureMode.js`)
- Titan adventure → Game interface: shows feedback (evidence: `TrashMan-main/js/modes/adventureMode.js`)
- Titan adventure → Boss encounter: faces
- Game interface → Character builder: rebuilds hero (evidence: `TrashMan-main/js/ui/uiController.js`)
- Game interface → Player state: reads equipment (evidence: `TrashMan-main/js/ui/uiController.js`)
- Game interface → Item catalog: renders catalog
- Game interface → Recycling shop: opens shop
- Online room client → Remote players: updates players (evidence: `TrashMan-main/js/modes/onlineRoom.js`)
- Online room client → Story mode: applies deposits (evidence: `TrashMan-main/js/modes/onlineRoom.js`)
- Online room client → Game orchestrator: requests lobby (evidence: `TrashMan-main/js/modes/onlineRoom.js`)
- Online room client → Room worker: connects by WebSocket
- Room worker → Room server: routes rooms
