Git City is a data-driven 3D web experience that visualizes GitHub users as an explorable city world. The project combines a frontend game-like renderer, runtime CSV datasets, and a notebook-based data pipeline.
- Convert GitHub profile/activity data into city entities and interactive scene content.
- Keep runtime assets optimized for browser loading.
- Keep source data and generated app data clearly separated.
The web application is built with Next.js + React + TypeScript and runs fully client-side for 3D rendering.
web/src/app/page.tsxorchestrates the app lifecycle:- boot phase (load CSV + compute layout + preload assets)
- car selection/showroom
- transition and gameplay phase
web/src/components/CityCanvas.tsxowns scene rendering and simulation coordination.web/src/components/contains rendering and UI pieces such as city scene, selectors, building primitives, loading UI, and showroom.
Core simulation modules live under web/src/game/:
- Input management (
input/) - Vehicle movement/physics (
physics/VehicleController.ts) - Road graph + routing (
world/RoadGraph.ts,routing/aStar.ts) - NPC traffic behavior (
ai/NpcTraffic.ts) - In-game state and game loop integration (
Game.ts,state.ts) - UI overlays like minimap (
ui/Minimap.tsx)
Data and procedural layout helpers convert CSV records to renderable city structures:
- CSV loading/parsing (
lib/data/csvClient.ts) - Building scaling/feature mapping (
lib/city/scaling.ts) - City layout generation (
lib/city/layout.ts) - Window/light texture atlas generation (
lib/city/windowAtlas.ts) - Asset preloading (
lib/loadAssets.ts)
An optional WebSocket service (web/server/multiplayer-server.mjs) supports shared sessions:
- city-partitioned sessions
- join/welcome/state update message flow
- max player guardrails
- continuously simulated NPC per city
fetch_user_data.ipynbgathers and enriches source GitHub data.- source/full datasets are stored in
docs/*.csv - runtime/curated datasets consumed by the app are stored in
web/public/data/*.csv
- App starts in boot phase.
- City CSV is loaded from
web/public/data. - Rows are mapped to buildings/entities.
- Road/building layout is computed.
- 3D models/textures are preloaded.
- User enters showroom, then gameplay scene mounts with loaded state.
- Run
fetch_user_data.ipynbto refresh source records. - Save full outputs into
docs/(source-of-truth CSVs). - Generate/refresh app-facing curated files in
web/public/data/. - Verify schema compatibility in app (no missing required columns).
- Launch app and smoke test city load + navigation + rendering.
- Implement game/render logic in
web/src. - If schema assumptions change, update mapping/layout logic in
web/src/lib. - Validate in local runtime with
npm run dev. - Run lint checks with
npm run lint. - Commit code and dataset updates together when behavior depends on both.
git-city/
README.md
docs/
README.md
architecture.md
data-workflow.md
github_users_islamabad_full.csv
github_users_karachi_full.csv
github_users_lahore_full.csv
github_users_pakistan_full.csv
fetch_user_data.ipynb
web/
package.json
public/
data/
models/
audios/
server/
multiplayer-server.mjs
src/
app/
components/
game/
lib/
- Next.js 16
- React 19
- TypeScript 5
- Three.js + React Three Fiber + Drei
- WebSockets (
ws) for multiplayer server - ESLint
- Node.js 20+ recommended
- npm 10+ recommended
cd web
npm installnpm run devOpen http://localhost:3000.
From web/:
npm run multiplayer:serverServer default: ws://localhost:8787
From web/:
npm run dev
npm run build
npm run start
npm run lint
npm run multiplayer:server- Treat
docs/*.csvas source/full datasets for analysis and regeneration. - Treat
web/public/data/*.csvas runtime-optimized datasets for the client. - Keep column names/types stable for loader + mapper compatibility.
- If notebook paths still use root-level CSV locations, migrate them to
docs/<filename>.csv.
docs/README.md- docs folder scope and inventorydocs/architecture.md- architecture summarydocs/data-workflow.md- dataset lifecycle and update process
- Large model/data files can grow repository size; consider Git LFS if asset volume increases.
- Keep heavy source artifacts outside runtime paths to reduce client load costs.