Turn your GitHub history into a skyline.
Live Demo · try /?user=cyb3rcricket
Watch the silent 20s demo (WebM)
I had a pretty simple idea: GitHub gives us this little grid of green squares, but what would that history look like if it felt like an actual place?
So I built Commit City.
Give it a public GitHub username and it turns a year of contribution history into a 3D cyber-city. Each day becomes a city lot. More activity means taller buildings. Quiet days stay low and dark, so the original contribution graph is still there underneath everything.
It is part data visualization, part tiny digital city, and a little unnecessary in exactly the way I like.
- Live: https://commit-city-psi.vercel.app
- Shareable username URLs:
https://commit-city-psi.vercel.app/?user=USERNAMEhttps://commit-city-psi.vercel.app/u/USERNAME
- Contribution calendar → instanced 3D skyline (Three.js)
- Fog, bloom, and particles for depth without burying the data
- Server-side
/api/contributionsso tokens never sit in browser code - Share links and in-app Capture Skyline stills
npm install
npm run devVite prints the local URL, usually http://localhost:5173.
Jump straight to a username:
http://localhost:5173/?user=torvalds
npm test
npm run build
npm run previewpreview serves the production bundle and still mounts /api/contributions, so username lookup works locally too.
For GraphQL access locally, copy .env.example to .env:
GITHUB_TOKEN=your_token_here
USE_MOCK=falsePredictable fake data while working on visuals:
USE_MOCK=trueor:
/api/contributions?user=demo&mock=1
while npm run dev is running.
- Vite + TypeScript
- Three.js for the city, camera, instanced buildings, fog, bloom, and particles
- Vitest for the test suite
- a serverless-style
/api/contributionsendpoint shared by local Vite development and Vercel
The frontend talks to a small server-side endpoint:
GET /api/contributions?user=USERNAME
That endpoint normalizes the contribution calendar into something the city can use (username, year window, totalContributions, source: "github" | "mock", and a days[] array with date, count, level, and grid indices).
Data resolution order:
- GitHub GraphQL when
GITHUB_TOKENis available - GitHub's public contribution calendar HTML when it is not
- Deterministic mock data during local development if GitHub is unavailable
Never put that token in client-side JavaScript.
The public demo runs on Vercel at commit-city-psi.vercel.app. Set GITHUB_TOKEN as a server-side Production environment variable. Leave USE_MOCK unset in Production. The function lives at api/contributions.ts.
The city can get more dramatic. The environment can get stranger. The camera can get more cinematic.
But the contribution history should still be the contribution history.
The towers are the data.
Built with a lot of AI-assisted iteration (Grok Build and friends): get the idea working, look at what feels wrong, fix it, make it weirder, occasionally make it too weird, and then reel it back in. That process is part of why this exists.
