# wizzubi/rpg_districts architecture

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

- Interactive diagram: https://gitdiagram.com/wizzubi/rpg_districts
- Repository: https://github.com/wizzubi/rpg_districts

## Overview

Kenney City is a lightweight browser-based RPG city-map prototype. The user opens the React-rendered page, which mounts a Phaser game; the city scene draws the map and lets the player move with WASD/arrow keys or jump to a clicked location. The sampled files show the scene, rendering, and input behavior together in `src/game.ts`; no separate persistence or service layer is present.

Main entry points: [`src/game.ts`](https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts) (Game setup), [`src/main.tsx`](https://github.com/wizzubi/rpg_districts/blob/main/src/main.tsx) (React entry), [`src/App.tsx`](https://github.com/wizzubi/rpg_districts/blob/main/src/App.tsx) (Game page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React interface"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Game page<br/>[App.tsx]"]
end

subgraph group_game["Phaser game"]
  node_bootstrap["Game setup<br/>[game.ts]"]
  node_scene["City scene<br/>[game.ts]"]
  node_controls["Player controls<br/>[game.ts]"]
end

subgraph group_world["City map"]
  node_drawing["City drawing<br/>[game.ts]"]
end

node_player(("Page user"))
node_phaser["Phaser engine"]

node_player -.->|"opens page"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"creates game"| node_bootstrap
node_bootstrap -->|"configures"| node_phaser
node_bootstrap -->|"registers"| node_scene
node_scene -->|"draws map"| node_drawing
node_scene -->|"sets up input"| node_controls

click node_entry "https://github.com/wizzubi/rpg_districts/blob/main/src/main.tsx"
click node_app "https://github.com/wizzubi/rpg_districts/blob/main/src/App.tsx"
click node_bootstrap "https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts"
click node_scene "https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts"
click node_controls "https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts"
click node_drawing "https://github.com/wizzubi/rpg_districts/blob/main/src/game.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_entry,node_app,node_player toneBlue
class node_bootstrap,node_scene,node_controls toneAmber
class node_drawing toneMint
class node_phaser toneIndigo
```

## Components

### React interface

- [React entry](https://github.com/wizzubi/rpg_districts/blob/main/src/main.tsx): `src/main.tsx`
- [Game page](https://github.com/wizzubi/rpg_districts/blob/main/src/App.tsx): `src/App.tsx`

### Phaser game

- [Game setup](https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts): `src/game.ts`
- [City scene](https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts): `src/game.ts`
- [Player controls](https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts): `src/game.ts`

### City map

- [City drawing](https://github.com/wizzubi/rpg_districts/blob/main/src/game.ts): `src/game.ts`

### Other components

- **Page user**
- **Phaser engine**

## Connections

- Page user → React entry: opens page (evidence: `README.md`)
- React entry → Game page: renders (evidence: `src/main.tsx`)
- Game page → Game setup: creates game (evidence: `src/App.tsx`)
- Game setup → Phaser engine: configures (evidence: `src/game.ts`)
- Game setup → City scene: registers (evidence: `src/game.ts`)
- City scene → City drawing: draws map (evidence: `src/game.ts`)
- City scene → Player controls: sets up input (evidence: `src/game.ts`)
