# dukechristyd/bombaway architecture

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

- Interactive diagram: https://gitdiagram.com/dukechristyd/bombaway
- Repository: https://github.com/dukechristyd/bombaway

## Overview

Bombs Away 3D is a browser-based multiplayer Bomberman-style game. Players enter the arcade lobby, join or host a room, choose a map and role, then play or spectate while the Node.js server authoritatively updates arena state and broadcasts it to clients. The browser renders that state in Three.js and provides controls, HUD, and procedural audio. Firebase-backed profiles, career stats, avatars, and leaderboards complement local-mode play. The excerpts establish the main client/server and service boundaries; unsampled event handlers and renderer updates limit finer-grained wiring.

Main entry points: [`public/client.js`](https://github.com/dukechristyd/bombaway/blob/main/public/client.js) (Game Controller), [`public/firebase-service.js`](https://github.com/dukechristyd/bombaway/blob/main/public/firebase-service.js) (Profile and Stats Service), [`server.js`](https://github.com/dukechristyd/bombaway/blob/main/server.js) (WebSocket Server), [`public/index.html`](https://github.com/dukechristyd/bombaway/blob/main/public/index.html) (Arcade Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Arcade Play"]
  node_webapp["Arcade Interface<br/>[index.html]"]
  node_controller["Game Controller<br/>[client.js]"]
end

subgraph group_engine["Match Engine"]
  node_server["WebSocket Server<br/>[server.js]"]
  node_room["Room Simulation<br/>[server.js]"]
end

subgraph group_identity["Profiles and Records"]
  node_profile["Profile and Stats Service"]
  node_config["Firebase Configuration<br/>[firebase-config.js]"]
  node_firebase[("Firebase Services")]
  node_localstore[("Browser Local Storage")]
end

subgraph group_experience["Game Experience"]
  node_renderer["3D Arena Renderer<br/>[game3d.js]"]
  node_sound["Procedural Audio<br/>[audio.js]"]
end

node_player(("Player"))

node_player -->|"uses"| node_webapp
node_webapp -->|"hosts"| node_controller
node_controller -->|"sends game events"| node_server
node_server -->|"broadcasts room state"| node_controller
node_server -->|"updates matches"| node_room
node_controller -->|"initializes"| node_renderer
node_controller -->|"uses profile service"| node_profile
node_controller -->|"plays effects"| node_sound
node_profile -.->|"checks configuration"| node_config
node_profile -->|"syncs auth and records"| node_firebase
node_profile -->|"caches offline data"| node_localstore

click node_webapp "https://github.com/dukechristyd/bombaway/blob/main/public/index.html"
click node_controller "https://github.com/dukechristyd/bombaway/blob/main/public/client.js"
click node_server "https://github.com/dukechristyd/bombaway/blob/main/server.js"
click node_room "https://github.com/dukechristyd/bombaway/blob/main/server.js"
click node_renderer "https://github.com/dukechristyd/bombaway/blob/main/public/game3d.js"
click node_sound "https://github.com/dukechristyd/bombaway/blob/main/public/audio.js"
click node_profile "https://github.com/dukechristyd/bombaway/blob/main/public/firebase-service.js"
click node_config "https://github.com/dukechristyd/bombaway/blob/main/public/firebase-config.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_webapp,node_controller toneBlue
class node_server,node_room toneAmber
class node_profile,node_config,node_firebase,node_localstore toneMint
class node_renderer,node_sound toneRose
class node_player toneIndigo
```

## Components

### Arcade Play

- [Arcade Interface](https://github.com/dukechristyd/bombaway/blob/main/public/index.html): `public/index.html`
- [Game Controller](https://github.com/dukechristyd/bombaway/blob/main/public/client.js): `public/client.js`

### Match Engine

- [WebSocket Server](https://github.com/dukechristyd/bombaway/blob/main/server.js): `server.js`
- [Room Simulation](https://github.com/dukechristyd/bombaway/blob/main/server.js): `server.js`

### Profiles and Records

- [Profile and Stats Service](https://github.com/dukechristyd/bombaway/blob/main/public/firebase-service.js): `public/firebase-service.js`
- [Firebase Configuration](https://github.com/dukechristyd/bombaway/blob/main/public/firebase-config.js): `public/firebase-config.js`
- **Firebase Services**
- **Browser Local Storage**

### Game Experience

- [3D Arena Renderer](https://github.com/dukechristyd/bombaway/blob/main/public/game3d.js): `public/game3d.js`
- [Procedural Audio](https://github.com/dukechristyd/bombaway/blob/main/public/audio.js): `public/audio.js`

### Other components

- **Player**

## Connections

- Player → Arcade Interface: uses (evidence: `README.md`)
- Arcade Interface → Game Controller: hosts (evidence: `README.md`)
- Game Controller → WebSocket Server: sends game events (evidence: `public/client.js`)
- WebSocket Server → Game Controller: broadcasts room state (evidence: `server.js`)
- WebSocket Server → Room Simulation: updates matches (evidence: `server.js`)
- Game Controller → 3D Arena Renderer: initializes (evidence: `public/client.js`)
- Game Controller → Profile and Stats Service: uses profile service (evidence: `public/client.js`)
- Game Controller → Procedural Audio: plays effects (evidence: `public/client.js`)
- Profile and Stats Service → Firebase Configuration: checks configuration
- Profile and Stats Service → Firebase Services: syncs auth and records (evidence: `public/firebase-service.js`)
- Profile and Stats Service → Browser Local Storage: caches offline data (evidence: `public/firebase-service.js`)
