Skip to content

rishabhbhartiya/GitCity

Drop this into any GitHub README, portfolio, or blog post:

[![My GitCity Skyline](https://gitcity.natrajx.in/api/svg?u=YOUR_USERNAME)](https://gitcity.natrajx.in/YOUR_USERNAME)

Every building = one day of commits. The taller the tower, the more you shipped.

GitCity Skyline


✨ What is GitCity?

GitCity fetches your entire GitHub contribution history via the GitHub GraphQL API and renders it as:

No personal access token required. Enter your username and go.

GitCity β€” GitHub Contributions as a 3D City Skyline

🎨 Themes

Six handcrafted themes β€” switch instantly:

Theme Preview
Matrix matrix
Noir noir
Aurora aurora
Ocean ocean
Gold gold
Ice ice

πŸ”— Embed API

The SVG embed API is dynamic β€” it re-renders from live GitHub data on each request.

Basic embed

![GitCity](https://gitcity.natrajx.in/api/svg?u=YOUR_USERNAME)

With theme

![GitCity Noir](https://gitcity.natrajx.in/api/svg?u=YOUR_USERNAME&theme=noir)

Available themes: matrix Β· noir Β· aurora Β· ocean Β· gold Β· ice

HTML (full control)

<a href="https://gitcity.natrajx.in/YOUR_USERNAME">
  <img src="https://gitcity.natrajx.in/api/svg?u=YOUR_USERNAME&theme=aurora"
       alt="My GitHub Skyline" width="100%" />
</a>

iframe (interactive, for portfolios)

<iframe
  src="https://gitcity.natrajx.in/YOUR_USERNAME"
  width="100%" height="500"
  frameborder="0"
  title="GitHub Contribution Skyline">
</iframe>

πŸš€ Quick Start

Option A β€” Use the hosted version (recommended)

Just go to gitcity.natrajx.in/YOUR_USERNAME β€” no setup needed.

Option B β€” Self-host

# 1. Clone
git clone https://github.com/natrajx/gitcity
cd gitcity

# 2. Install
npm install

# 3. Set your GitHub token (for API calls)
echo "GITHUB_TOKEN=ghp_your_token_here" > .env.local

# 4. Run locally
vercel dev          # uses /api serverless functions
# OR
npm run dev         # Vite only (no API β€” use hosted API instead)

# 5. Deploy to Vercel
vercel --prod

Environment variables

Variable Required Description
GITHUB_TOKEN Yes GitHub Personal Access Token (read:user scope)

GITHUB_TOKEN


πŸ€– SEO & AI Optimisation

Three files live in public/ and are served directly from the site root:

File URL Purpose
public/robots.txt /robots.txt Search crawler rules, AI bot allowlist, sitemap pointer
public/sitemap.xml /sitemap.xml Pages for Google to index
public/llms.txt /llms.txt Machine-readable summary for AI assistants (ChatGPT, Claude, Perplexity)

Why public/? Vite copies everything in public/ verbatim into dist/ at build time, so these files are served at the bare URL with no routing involved β€” exactly what crawlers and search engines expect.


πŸ“ Project Structure

gitcity/
β”œβ”€β”€ public/                           # ← Static files served at site root
β”‚   β”œβ”€β”€ robots.txt                    #   gitcity.natrajx.in/robots.txt
β”‚   β”œβ”€β”€ sitemap.xml                   #   gitcity.natrajx.in/sitemap.xml
β”‚   └── llms.txt                      #   gitcity.natrajx.in/llms.txt
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ contributions/[username].js   # Serverless: GitHub GraphQL proxy
β”‚   └── og/[username].js              # Serverless: SVG generator for embeds
β”œβ”€β”€ index.html                        # Root HTML with SEO/OG meta
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.jsx                       # Auth flow, URL params
β”‚   β”œβ”€β”€ components/ContributionGraph3D/
β”‚   β”‚   β”œβ”€β”€ ContributionGraph3D.jsx   # Main graph component + filters
β”‚   β”‚   β”œβ”€β”€ IsometricGrid.jsx         # SVG isometric 3D skyline
β”‚   β”‚   β”œβ”€β”€ CitySimulation.jsx        # Three.js driveable city
β”‚   β”‚   β”œβ”€β”€ BirdsEyeGrid.jsx          # Heatmap view
β”‚   β”‚   └── Building.jsx              # Individual isometric building
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   └── themes.js                 # 6 colour themes
β”‚   └── hooks/
β”‚       └── useGitHubData.js          # Data fetching hook
β”œβ”€β”€ vercel.json                       # Routing rules
└── vite.config.js

πŸ› οΈ Tech Stack


🀝 Contributing

PRs welcome. Open an issue first for major changes.

git checkout -b feat/your-feature
# make changes
git commit -m "feat: your feature"
git push origin feat/your-feature
# open PR β†’ main

β˜• Support

GitCity is free and open-source β€” no login, no paywall, no token required.

If it made your README cooler or your portfolio stand out, consider buying me a coffee. It goes directly toward hosting costs, GPU time for experiments, and building more free tools like this one.

Support on Ko-fi

πŸ™‹ About the Author

Built by Rishabh Bhartiya β€” ML Engineer & full-stack developer. 3 years turning research-grade ideas into production systems at scale.

If GitCity is useful to you, a ⭐ on the repo and a mention helps a lot.


❓ FAQ

Is this the same as thegitcity.com?
No β€” completely different. See COMPARISON.md for the full breakdown.


πŸ“„ License

MIT Β© Rishabh Bhartiya β€” free to use, modify, and distribute.


Made with β˜• by Rishabh Bhartiya Β Β·Β  gitcity.natrajx.in Β Β·Β  More projects Β Β·Β  Blog Β Β·Β  β˜• Ko-fi

About

Your GitHub contributions reimagined as a living 3D city skyline.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors