# anuvindh23/proxi-app architecture

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

- Interactive diagram: https://gitdiagram.com/anuvindh23/proxi-app
- Repository: https://github.com/anuvindh23/proxi-app

## Overview

#### Purpose and runtime
This is a browser game frontend built with React, Vite, and Phaser. The README is the uncustomized React/Vite template, but the source layout and assets indicate a tile/map-based Phaser game. It has no backend, API layer, or server-side application code in the repository.

#### Application bootstrap
Vite loads the HTML shell at `index.html`, then executes the React entry point at `src/main.jsx`. The React root renders the top-level application component in `src/App.jsx`.

Key paths:
- `index.html`
- `src/main.jsx`
- `src/App.jsx`

#### React-to-game boundary
React appears to act primarily as the page/container layer, while Phaser owns real-time game rendering and simulation. `src/PhaserGame.jsx` is the architectural boundary where React mounts, configures, and/or tears down the Phaser game instance rather than modeling gameplay through React state.

Key paths:
- `src/App.jsx`
- `src/PhaserGame.jsx`

#### Phaser configuration and scene registration
The game engine configuration is centralized in `src/game/config.js`. This is the likely location for Phaser renderer, canvas sizing, physics, scene registration, and startup settings. It connects the React host to the scene-based Phaser runtime.

Key paths:
- `src/PhaserGame.jsx`
- `src/game/config.js`
- `src/game/scenes/GameScene.js`

#### Gameplay scene
`GameScene` is the primary gameplay lifecycle unit. Phaser invokes its preload/create/update-style scene hooks to load resources, build the world, process input or movement, and render each frame. Future gameplay systems should generally be added as scene-owned entities or extracted modules invoked by this scene, avoiding coupling them directly to React components.

Key path:
- `src/game/scenes/GameScene.js`

#### World data and rendering assets
The game includes a map definition and tile assets served directly as Vite public files. Phaser can load these by URL at runtime; they are not imported into the JavaScript module graph. The map data is likely consumed by `GameScene` during preload/create, with tiles used to construct a tilemap layer.

Key paths:
- `public/assets/maps/proxiland.json`
- `public/assets/tiles`
- `src/game/scenes/GameScene.js`

#### Control flow and deployment boundary
Browser startup follows: Vite HTML shell → React mount → `App` → Phaser host → Phaser config → `GameScene` lifecycle → public map/tile asset loading. Runtime state is expected to remain inside Phaser scenes and engine objects. Vite provides local development/HMR and produces static build output; deployment requires only static hosting for the built client and public assets.

Key paths:
- `vite.config.js`
- `package.json`
- `public/assets`

Main entry points: [`vite.config.js`](https://github.com/anuvindh23/proxi-app/blob/main/vite.config.js) (Vite), [`src/game/scenes/GameScene.js`](https://github.com/anuvindh23/proxi-app/blob/main/src/game/scenes/GameScene.js) (Game Scene), [`public/assets`](https://github.com/anuvindh23/proxi-app/tree/main/public/assets) (Public Assets), [`index.html`](https://github.com/anuvindh23/proxi-app/blob/main/index.html) (HTML Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Browser Startup"]
  node_vite{{"Vite<br/>build and dev server<br/>[vite.config.js]"}}
  node_package["Package Scripts<br/>project manifest<br/>[package.json]"]
  node_html["HTML Shell<br/>browser entry<br/>[index.html]"]
end

subgraph group_react["React Host"]
  node_main["React Entry<br/>React bootstrap<br/>[main.jsx]"]
  node_app["App<br/>React root component<br/>[App.jsx]"]
  node_phaser_host["Phaser Game Host<br/>React-to-Phaser boundary<br/>[PhaserGame.jsx]"]
end

subgraph group_phaser["Phaser Runtime"]
  node_config["Game Config<br/>Phaser configuration<br/>[config.js]"]
  node_scene["Game Scene<br/>Phaser scene<br/>[GameScene.js]"]
end

subgraph group_assets["Public Game Assets"]
  node_map["Proxiland Map<br/>tilemap data<br/>[proxiland.json]"]
  node_tiles["Tile Assets<br/>tileset files"]
  node_public_assets["Public Assets<br/>static asset root"]
end

node_static_host{{"Static Hosting<br/>deployment target"}}

node_package -->|"runs"| node_vite
node_vite -->|"serves/builds"| node_html
node_html -->|"loads"| node_main
node_main -->|"renders"| node_app
node_app -->|"hosts"| node_phaser_host
node_phaser_host -->|"starts with"| node_config
node_config -->|"registers"| node_scene
node_scene -->|"loads by URL"| node_map
node_scene -->|"loads by URL"| node_tiles
node_public_assets -->|"contains"| node_map
node_public_assets -->|"contains"| node_tiles
node_vite -.->|"build output deployed to"| node_static_host

click node_vite "https://github.com/anuvindh23/proxi-app/blob/main/vite.config.js"
click node_package "https://github.com/anuvindh23/proxi-app/blob/main/package.json"
click node_html "https://github.com/anuvindh23/proxi-app/blob/main/index.html"
click node_main "https://github.com/anuvindh23/proxi-app/blob/main/src/main.jsx"
click node_app "https://github.com/anuvindh23/proxi-app/blob/main/src/App.jsx"
click node_phaser_host "https://github.com/anuvindh23/proxi-app/blob/main/src/PhaserGame.jsx"
click node_config "https://github.com/anuvindh23/proxi-app/blob/main/src/game/config.js"
click node_scene "https://github.com/anuvindh23/proxi-app/blob/main/src/game/scenes/GameScene.js"
click node_map "https://github.com/anuvindh23/proxi-app/blob/main/public/assets/maps/proxiland.json"
click node_tiles "https://github.com/anuvindh23/proxi-app/tree/main/public/assets/tiles"
click node_public_assets "https://github.com/anuvindh23/proxi-app/tree/main/public/assets"

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_vite,node_package,node_html toneBlue
class node_main,node_app,node_phaser_host toneAmber
class node_config,node_scene toneMint
class node_map,node_tiles,node_public_assets toneRose
class node_static_host toneNeutral
```

## Components

### Browser Startup

- [Vite](https://github.com/anuvindh23/proxi-app/blob/main/vite.config.js): build and dev server · Serves development files and produces the static client build. · `vite.config.js`
- [Package Scripts](https://github.com/anuvindh23/proxi-app/blob/main/package.json): project manifest · `package.json`
- [HTML Shell](https://github.com/anuvindh23/proxi-app/blob/main/index.html): browser entry · `index.html`

### React Host

- [React Entry](https://github.com/anuvindh23/proxi-app/blob/main/src/main.jsx): React bootstrap · `src/main.jsx`
- [App](https://github.com/anuvindh23/proxi-app/blob/main/src/App.jsx): React root component · `src/App.jsx`
- [Phaser Game Host](https://github.com/anuvindh23/proxi-app/blob/main/src/PhaserGame.jsx): React-to-Phaser boundary · Mounts and tears down the Phaser game instance. · `src/PhaserGame.jsx`

### Phaser Runtime

- [Game Config](https://github.com/anuvindh23/proxi-app/blob/main/src/game/config.js): Phaser configuration · Defines Phaser startup settings and scene registration. · `src/game/config.js`
- [Game Scene](https://github.com/anuvindh23/proxi-app/blob/main/src/game/scenes/GameScene.js): Phaser scene · Owns gameplay lifecycle, world creation, input, and frame updates. · `src/game/scenes/GameScene.js`

### Public Game Assets

- [Proxiland Map](https://github.com/anuvindh23/proxi-app/blob/main/public/assets/maps/proxiland.json): tilemap data · `public/assets/maps/proxiland.json`
- [Tile Assets](https://github.com/anuvindh23/proxi-app/tree/main/public/assets/tiles): tileset files · `public/assets/tiles`
- [Public Assets](https://github.com/anuvindh23/proxi-app/tree/main/public/assets): static asset root · Served by Vite as runtime URLs rather than JavaScript imports. · `public/assets`

### Other components

- **Static Hosting**: deployment target · Hosts the built client and public assets; no application backend is required.

## Connections

- Package Scripts → Vite: runs
- Vite → HTML Shell: serves/builds
- HTML Shell → React Entry: loads
- React Entry → App: renders
- App → Phaser Game Host: hosts
- Phaser Game Host → Game Config: starts with
- Game Config → Game Scene: registers
- Game Scene → Proxiland Map: loads by URL
- Game Scene → Tile Assets: loads by URL
- Public Assets → Proxiland Map: contains
- Public Assets → Tile Assets: contains
- Vite → Static Hosting: build output deployed to
