Skip to content

About

my project/work displayed as a city

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Project Metropolis

A 3D sand table visualization of your GitHub repositories, built with Three.js and React.

Every repository is a district in one continuous city and every text file in it is a building — height represents lines of code, and every building stands on the same base area, so the whole map shares one scale. Districts are mapped by glowing floating boundaries rather than raised plinths, so the whole metropolis reads as a single model instead of a shelf of separate dioramas.

Features

  • One continuous model: a single paved ground, one road grid and one instanced mesh holding every building in the city
  • Glowing district boundaries: the city is unmarked until you hover a building, then its repository's floating outline and name light up in that district's colour
  • Line map on hover: hovering a building draws colour-coded 3D arcs to everything it relates to — the files it imports (green), the files that import it (pink), other files of the same type (cyan), files with the same name (amber) and the rest of its own district (violet) — and the hover card lists them as links to the file on GitHub
  • Surveyed in CI: repositories are surveyed by a GitHub Action, not by each visitor's browser
  • Performance optimized: instanced rendering for buildings and roads
  • Interactive: WASD to walk the city (Shift to hurry), drag to rotate, ⌘/Ctrl + scroll to zoom, double-click to recentre, hover to inspect

How the city is built

public/city-layout.txt is generated by .github/workflows/city-layout.yml. The workflow walks every public repository under the account with the repository token, writes one district block per repository and one file <lines> <bytes> <path> line per text file, commits the file and asks the Pages deploy to run.

It fires on a six-hour schedule, on demand, and whenever the survey script changes. The site only reads that text file at runtime, so no visitor triggers a live GitHub survey and nobody hits the anonymous API rate limit.

district <name>
  description <text>
  language / stars / forks / size / branch / pushed / fork / url
  files <count>
  lines <count>
  file <lines> <bytes> <path>
    import <specifier>       # in-repo imports, one per line: the line map's edges

The survey reads every file's source anyway to count its lines, so it also records the relative imports it finds (JavaScript/TypeScript, CSS, Python and Rust). Those become the green and pink arcs in the city.

Development

npm install
npm run dev

Regenerate the layout by hand (uses GITHUB_TOKEN when it is set, and falls back to jsDelivr when the anonymous API is rate limited):

GITHUB_TOKEN=... node scripts/survey-city.mjs

Tech Stack

  • React 19
  • Three.js for 3D rendering
  • Motion (Framer Motion) for animations
  • Tailwind CSS for styling
  • Vite for bundling

Deploy

The site is configured for GitHub Pages deployment via GitHub Actions, and the survey workflow starts that deploy whenever it commits a fresh layout.

About

my project/work displayed as a city

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages