# meettoast5578/overreach architecture

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

- Interactive diagram: https://gitdiagram.com/meettoast5578/overreach
- Repository: https://github.com/meettoast5578/overreach

## Overview

OpenFront.io is a browser-based real-time strategy game. Players enter through the client, issue gameplay commands, and see the evolving map and match state; the README describes territorial expansion, alliances, resource management, and geographically themed maps. The repository separates client presentation, deterministic simulation, and server-side match coordination. The source index supports several client/core and server call or import relationships; where it does not expose runtime wiring, the graph avoids asserting it.

Main entry points: [`src/core/game/Game.ts`](https://github.com/meettoast5578/overreach/blob/main/src/core/game/Game.ts) (Game state), [`src/server/GameServer.ts`](https://github.com/meettoast5578/overreach/blob/main/src/server/GameServer.ts) (Match server), [`src/client/Transport.ts`](https://github.com/meettoast5578/overreach/blob/main/src/client/Transport.ts) (Game transport), [`src/client/Main.ts`](https://github.com/meettoast5578/overreach/blob/main/src/client/Main.ts) (Client interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Game client"]
  node_client_app["Client interface<br/>[Main.ts]"]
  node_input["Gameplay input<br/>[InputHandler.ts]"]
  node_transport["Game transport<br/>[Transport.ts]"]
  node_client_runner["Client game runner"]
  node_renderer["Map renderer<br/>[Renderer.ts]"]
end

subgraph group_simulation["Game simulation"]
  node_game["Game state<br/>[Game.ts]"]
  node_execution["Game actions"]
  node_map["Map and terrain<br/>[GameMap.ts]"]
  node_updates["Tick updates<br/>[GameUpdates.ts]"]
  node_map_data["Geographic maps<br/>[Maps.gen.ts]"]
end

subgraph group_server["Match services"]
  node_manager["Match manager<br/>[GameManager.ts]"]
  node_game_server["Match server<br/>[GameServer.ts]"]
  node_worker["Server worker<br/>[Worker.ts]"]
end

subgraph group_protocol["Shared game data"]
  node_schemas["Game schemas<br/>[Schemas.ts]"]
  node_event_bus["Game event bus<br/>[EventBus.ts]"]
end

node_player(("Player"))

node_player -->|"plays through"| node_client_app
node_client_app -->|"starts"| node_client_runner
node_input -->|"reads state"| node_game
node_input -->|"uses events"| node_event_bus
node_transport -->|"uses state"| node_game
node_transport -->|"uses schemas"| node_schemas
node_transport -->|"notifies"| node_client_runner
node_client_runner -.->|"renders through"| node_renderer
node_game -->|"uses map"| node_map
node_game -->|"produces updates"| node_updates
node_game -->|"uses maps"| node_map_data
node_execution -->|"updates state"| node_game
node_game_server -->|"uses simulation"| node_game
node_manager -->|"creates matches"| node_game_server
node_worker -->|"routes to"| node_game_server
node_game_server -->|"uses schemas"| node_schemas
node_client_app -->|"uses events"| node_event_bus
node_player -.->|"joins match"| node_game_server

click node_client_app "https://github.com/meettoast5578/overreach/blob/main/src/client/Main.ts"
click node_input "https://github.com/meettoast5578/overreach/blob/main/src/client/InputHandler.ts"
click node_transport "https://github.com/meettoast5578/overreach/blob/main/src/client/Transport.ts"
click node_client_runner "https://github.com/meettoast5578/overreach/blob/main/src/client/ClientGameRunner.ts"
click node_renderer "https://github.com/meettoast5578/overreach/blob/main/src/client/render/gl/Renderer.ts"
click node_game "https://github.com/meettoast5578/overreach/blob/main/src/core/game/Game.ts"
click node_execution "https://github.com/meettoast5578/overreach/blob/main/src/core/execution/ExecutionManager.ts"
click node_map "https://github.com/meettoast5578/overreach/blob/main/src/core/game/GameMap.ts"
click node_updates "https://github.com/meettoast5578/overreach/blob/main/src/core/game/GameUpdates.ts"
click node_map_data "https://github.com/meettoast5578/overreach/blob/main/src/core/game/Maps.gen.ts"
click node_manager "https://github.com/meettoast5578/overreach/blob/main/src/server/GameManager.ts"
click node_game_server "https://github.com/meettoast5578/overreach/blob/main/src/server/GameServer.ts"
click node_worker "https://github.com/meettoast5578/overreach/blob/main/src/server/Worker.ts"
click node_schemas "https://github.com/meettoast5578/overreach/blob/main/src/core/Schemas.ts"
click node_event_bus "https://github.com/meettoast5578/overreach/blob/main/src/core/EventBus.ts"

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_client_app,node_input,node_transport,node_client_runner,node_renderer toneBlue
class node_game,node_execution,node_map,node_updates,node_map_data toneAmber
class node_manager,node_game_server,node_worker toneMint
class node_schemas,node_event_bus toneRose
class node_player toneIndigo
```

## Components

### Game client

- [Client interface](https://github.com/meettoast5578/overreach/blob/main/src/client/Main.ts): `src/client/Main.ts`
- [Gameplay input](https://github.com/meettoast5578/overreach/blob/main/src/client/InputHandler.ts): `src/client/InputHandler.ts`
- [Game transport](https://github.com/meettoast5578/overreach/blob/main/src/client/Transport.ts): `src/client/Transport.ts`
- [Client game runner](https://github.com/meettoast5578/overreach/blob/main/src/client/ClientGameRunner.ts): `src/client/ClientGameRunner.ts`
- [Map renderer](https://github.com/meettoast5578/overreach/blob/main/src/client/render/gl/Renderer.ts): `src/client/render/gl/Renderer.ts`

### Game simulation

- [Game state](https://github.com/meettoast5578/overreach/blob/main/src/core/game/Game.ts): `src/core/game/Game.ts`
- [Game actions](https://github.com/meettoast5578/overreach/blob/main/src/core/execution/ExecutionManager.ts): `src/core/execution/ExecutionManager.ts`
- [Map and terrain](https://github.com/meettoast5578/overreach/blob/main/src/core/game/GameMap.ts): `src/core/game/GameMap.ts`
- [Tick updates](https://github.com/meettoast5578/overreach/blob/main/src/core/game/GameUpdates.ts): `src/core/game/GameUpdates.ts`
- [Geographic maps](https://github.com/meettoast5578/overreach/blob/main/src/core/game/Maps.gen.ts): `src/core/game/Maps.gen.ts`

### Match services

- [Match manager](https://github.com/meettoast5578/overreach/blob/main/src/server/GameManager.ts): `src/server/GameManager.ts`
- [Match server](https://github.com/meettoast5578/overreach/blob/main/src/server/GameServer.ts): `src/server/GameServer.ts`
- [Server worker](https://github.com/meettoast5578/overreach/blob/main/src/server/Worker.ts): `src/server/Worker.ts`

### Shared game data

- [Game schemas](https://github.com/meettoast5578/overreach/blob/main/src/core/Schemas.ts): `src/core/Schemas.ts`
- [Game event bus](https://github.com/meettoast5578/overreach/blob/main/src/core/EventBus.ts): `src/core/EventBus.ts`

### Other components

- **Player**

## Connections

- Player → Client interface: plays through
- Client interface → Client game runner: starts (evidence: `src/client/Main.ts`)
- Gameplay input → Game state: reads state (evidence: `src/client/InputHandler.ts`)
- Gameplay input → Game event bus: uses events (evidence: `src/client/InputHandler.ts`)
- Game transport → Game state: uses state (evidence: `src/client/Transport.ts`)
- Game transport → Game schemas: uses schemas (evidence: `src/client/Transport.ts`)
- Game transport → Client game runner: notifies (evidence: `src/client/Transport.ts`)
- Client game runner → Map renderer: renders through
- Game state → Map and terrain: uses map (evidence: `src/core/game/Game.ts`)
- Game state → Tick updates: produces updates (evidence: `src/core/game/Game.ts`)
- Game state → Geographic maps: uses maps (evidence: `src/core/game/Game.ts`)
- Game actions → Game state: updates state (evidence: `src/core/execution/ExecutionManager.ts`)
- Match server → Game state: uses simulation (evidence: `src/server/GameServer.ts`)
- Match manager → Match server: creates matches (evidence: `src/server/GameManager.ts`)
- Server worker → Match server: routes to (evidence: `src/server/Worker.ts`)
- Match server → Game schemas: uses schemas (evidence: `src/server/GameServer.ts`)
- Client interface → Game event bus: uses events (evidence: `src/client/Main.ts`)
- Player → Match server: joins match
