git-city README

The project's README from github.com/srizzon/git-city. As one markdown file: README.md.

Git City

Your GitHub profile as a 3D pixel art building in an interactive city.

thegitcity.com

Git City — Where Code Builds Cities


What is Git City?

Git City transforms every GitHub profile into a unique pixel art building. The more you contribute, the taller your building grows. Explore an interactive 3D city, fly between buildings, and discover developers from around the world.

Features

How Buildings Work

Metric Affects Example
Contributions Building height 1,000 commits → taller building
Public repos Building width More repos → wider base
Stars Window brightness More stars → more lit windows
Activity Window pattern Recent activity → distinct glow pattern

Buildings are rendered with instanced meshes and a LOD (Level of Detail) system for performance. Close buildings show full detail with animated windows; distant buildings use simplified geometry.

Tech Stack

Getting Started

# Clone the repo
git clone https://github.com/srizzon/git-city.git
cd git-city

# Install dependencies
npm install

# Set up environment variables

# Linux / macOS
cp .env.example .env.local

# Windows (Command Prompt)
copy .env.example .env.local

# Windows (PowerShell)
Copy-Item .env.example .env.local

# Fill in your environment variables

# Run the dev server
npm run dev

Open http://localhost:3001 to see the city.

Local Supabase (no remote project needed)

You can run the whole backend locally — no Supabase account, no GitHub OAuth app.

Prerequisites: a container runtime and the Supabase CLI.

# macOS (Colima is a lightweight, free Docker alternative)
brew install colima docker supabase/tap/supabase
colima start

# ...or use Docker Desktop instead of Colima, then just:
# brew install supabase/tap/supabase

Start the stack (spins up Postgres/Auth/Storage/Studio and applies every migration from scratch):

supabase start          # first run pulls images; prints your local URL + keys
supabase status         # re-print the URL and keys at any time

Point .env.local at the printed local values:

NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=<Publishable key from `supabase status`>
SUPABASE_SERVICE_ROLE_KEY=<Secret key from `supabase status`>

Then npm run dev. The city renders straight from your local database — no snapshot step needed in local dev.

Logging in (zero config): the GitHub OAuth provider isn't configured for a local stack (it needs a client secret that can't ship in the repo). Instead, clicking Sign in with GitHub locally takes you to a built-in dev login — type any GitHub username and you're in, with a building created from that account. You can also go straight to http://localhost:3001/api/dev/login. This route is automatically disabled in production.

Useful commands:

supabase db reset       # re-apply all migrations on a clean database
supabase stop           # shut the stack down (data is preserved)

Studio (DB browser) runs at http://127.0.0.1:54323.

Environment Setup

After copying .env.example to .env.local, fill in these values:

Where to find the Supabase values

Open your Supabase project dashboard, then go to Project Settings -> API.

For local GitHub login to work, you also need to configure the GitHub OAuth provider in Supabase and add your local callback URL if required by your setup.

Where to find the GitHub token

Open GitHub and go to Settings -> Developer settings -> Personal access tokens.

Create a token, copy it once, and place it in GITHUB_TOKEN inside .env.local.

License

AGPL-3.0 — You can use and modify Git City, but any public deployment must share the source code.


Built by @samuelrizzondev

git-city (srizzon/git-city)

Searching Database…

这是什么?Git City 会把每个 GitHub 个人主页变成交互式城市里一座独一无二的 3D 像素艺术建筑,你贡献得越多,你的建筑就长得越高。
这是托管的应用,还是需要我自己部署?它主要是一个托管的网页应用,你可以访问并用 GitHub 登录。但完整源代码是开源的,采用 AGPL-3.0 许可证,因此你可以用自己的 Supabase 和 Vercel 配置运行自己的实例。
我该如何在本地运行?用容器运行时和 Supabase CLI 启动一个本地 Supabase 环境,把 .env.local 指向终端输出的本地配置值,然后运行 npm run dev。本地开发不需要 Supabase 账号,也不需要 GitHub OAuth 应用。
想试用的话,需要真实的 GitHub OAuth 应用或 Supabase 账号吗?本地开发不需要。内置的开发登录允许你输入任意 GitHub 用户名,生成测试用的建筑。若要上线,则需要 Supabase(Postgres/Auth)、GitHub 个人访问令牌,以及用于支付的 Stripe。
在本地运行时,GitHub 登录能直接用吗?不能。本地环境没有配置真正的 GitHub OAuth 提供方,因为它需要一个无法放入代码仓库的客户端密钥,所以本地开发会退回到模拟登录路由,而该路由在生产环境中会自动禁用。
如果我运行自己的实例,AGPL-3.0 许可证意味着什么?你可以自由使用和修改 Git City,但如果你部署了一个对外公开的实例,就依法必须同时公开你的源代码。
建筑的高度和宽度是如何决定的?建筑高度随你的贡献次数增长,宽度随你的公开仓库数量增长;窗户的亮度和图案则反映你的星标数和近期活跃度。
除了看看自己的建筑,还能做什么?你可以在城市中自由飞行,并排比较两位开发者,发送致意和礼物,解锁成就,用商店道具装扮你的建筑,还能下载可分享的个人资料卡片。
这座 3D 城市背后的技术栈是什么?应用使用 Next.js 16 搭配 Turbopack;渲染使用通过 @react-three/fiber 和 drei 调用的 Three.js;后端使用 Supabase(Postgres/Auth);支付使用 Stripe;样式使用 Tailwind CSS v4。
为什么远处的建筑看起来比近处的简单?Git City 使用实例化网格(instanced meshes)和细节层次(Level-of-Detail,LOD)系统来渲染建筑。近处的建筑显示完整的动画细节,而远处的建筑使用简化几何体,以保持流畅的性能。
What are similar projects?Hermes3D, petdex, chatbot, human-atlas, gitdiagram, crm, mike, documenso
Creator
srizzon
Size
32.2 MB
Stars
5.8K
Updated
CommitOct 17
Age
7mo
Commits · 90 Days