# shadany7824/playgta5 architecture

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

- Interactive diagram: https://gitdiagram.com/shadany7824/playgta5
- Repository: https://github.com/shadany7824/playgta5

## Overview

This repository packages an archival, locally runnable browser port of Grand Theft Auto V. The principal workflow is to launch the local server, open the game in a browser, load the engine, and run the game using the separately supplied asset mirror. Runtime code includes engine hosting, persistent asset reads, and a WebGPU worker; the repository also contains a resumable asset-snapshot tool. The README documents the launch flow, while sampled source clarifies server behavior and runtime responsibilities; some worker wiring and browser execution remain unverified.

Main entry points: [`game.js`](https://github.com/shadany7824/playgta5/blob/main/game.js) (Game engine), [`Launch-Local.cmd`](https://github.com/shadany7824/playgta5/blob/main/Launch-Local.cmd) (Local launcher), [`serve_local.py`](https://github.com/shadany7824/playgta5/blob/main/serve_local.py) (Local HTTP server), [`io_worker.js`](https://github.com/shadany7824/playgta5/blob/main/io_worker.js) (Asset I/O worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Local Launch"]
  node_launcher["Local launcher<br/>[Launch-Local.cmd]"]
  node_webserver["Local HTTP server<br/>[serve_local.py]"]
  node_page["Game page<br/>[homepage.html]"]
end

subgraph group_runtime["Game Runtime"]
  node_enginehost["Engine host<br/>[loader.js]"]
  node_gameengine["Game engine<br/>[game.js]"]
  node_gpuworker["WebGPU renderer<br/>[wgpu_worker.js]"]
end

subgraph group_assets["Asset Access"]
  node_ioworker["Asset I/O worker<br/>[io_worker.js]"]
  node_assetmirror[("Game asset mirror")]
  node_batchio["Batch range service<br/>[serve_local.py]"]
end

subgraph group_archive["Snapshot Archive"]
  node_snapshottool["Snapshot downloader<br/>[mirror_site.py]"]
  node_inventory["Snapshot inventory<br/>[files.jsonl]"]
end

node_player(("Player"))
node_browser["Browser"]

node_player -->|"runs"| node_launcher
node_launcher -->|"starts"| node_webserver
node_webserver -->|"opens local URL"| node_browser
node_browser -.->|"loads"| node_page
node_enginehost -->|"imports"| node_gameengine
node_gameengine -.->|"dispatches rendering"| node_gpuworker
node_gameengine -.->|"requests asset reads"| node_ioworker
node_ioworker -.->|"reads ranges"| node_assetmirror
node_browser -.->|"posts batch ranges"| node_batchio
node_batchio -->|"reads files"| node_assetmirror
node_snapshottool -->|"records downloads"| node_inventory

click node_launcher "https://github.com/shadany7824/playgta5/blob/main/Launch-Local.cmd"
click node_webserver "https://github.com/shadany7824/playgta5/blob/main/serve_local.py"
click node_page "https://github.com/shadany7824/playgta5/blob/main/homepage.html"
click node_enginehost "https://github.com/shadany7824/playgta5/blob/main/loader.js"
click node_gameengine "https://github.com/shadany7824/playgta5/blob/main/game.js"
click node_gpuworker "https://github.com/shadany7824/playgta5/blob/main/wgpu_worker.js"
click node_ioworker "https://github.com/shadany7824/playgta5/blob/main/io_worker.js"
click node_batchio "https://github.com/shadany7824/playgta5/blob/main/serve_local.py"
click node_snapshottool "https://github.com/shadany7824/playgta5/blob/main/mirror_site.py"
click node_inventory "https://github.com/shadany7824/playgta5/blob/main/snapshot/files.jsonl"

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_launcher,node_webserver,node_page,node_browser toneBlue
class node_enginehost,node_gameengine,node_gpuworker toneAmber
class node_ioworker,node_assetmirror,node_batchio toneMint
class node_snapshottool,node_inventory toneRose
class node_player toneIndigo
```

## Components

### Local Launch

- [Local launcher](https://github.com/shadany7824/playgta5/blob/main/Launch-Local.cmd): `Launch-Local.cmd`
- [Local HTTP server](https://github.com/shadany7824/playgta5/blob/main/serve_local.py): `serve_local.py`
- [Game page](https://github.com/shadany7824/playgta5/blob/main/homepage.html): `homepage.html`

### Game Runtime

- [Engine host](https://github.com/shadany7824/playgta5/blob/main/loader.js): `loader.js`
- [Game engine](https://github.com/shadany7824/playgta5/blob/main/game.js): `game.js`
- [WebGPU renderer](https://github.com/shadany7824/playgta5/blob/main/wgpu_worker.js): `wgpu_worker.js`

### Asset Access

- [Asset I/O worker](https://github.com/shadany7824/playgta5/blob/main/io_worker.js): `io_worker.js`
- **Game asset mirror**
- [Batch range service](https://github.com/shadany7824/playgta5/blob/main/serve_local.py): `serve_local.py`

### Snapshot Archive

- [Snapshot downloader](https://github.com/shadany7824/playgta5/blob/main/mirror_site.py): `mirror_site.py`
- [Snapshot inventory](https://github.com/shadany7824/playgta5/blob/main/snapshot/files.jsonl): `snapshot/files.jsonl`

### Other components

- **Player**
- **Browser**

## Connections

- Player → Local launcher: runs (evidence: `README.md`)
- Local launcher → Local HTTP server: starts (evidence: `README.md`)
- Local HTTP server → Browser: opens local URL (evidence: `README.md`)
- Browser → Game page: loads
- Engine host → Game engine: imports (evidence: `loader.js`)
- Game engine → WebGPU renderer: dispatches rendering
- Game engine → Asset I/O worker: requests asset reads
- Asset I/O worker → Game asset mirror: reads ranges
- Browser → Batch range service: posts batch ranges
- Batch range service → Game asset mirror: reads files (evidence: `serve_local.py`)
- Snapshot downloader → Snapshot inventory: records downloads (evidence: `mirror_site.py`)
