Skip to content

About

πŸ™οΈ Retro Spec β€” 3D city generator that renders your Git history as a neon metropolis. Rust + Bevy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

retro-spec

RETRO SPEC βš‘πŸ™οΈ

License Language Platform

"Walk your code like a city at midnight."

RetroSpec is a 3D city generator that renders your entire Git history as an explorable neon metropolis. Every commit is a building. Every branch is a boulevard. Every merge is an intersection. Fly through your project's past and see the architecture of your code in three dimensions.


The Vision

You've seen git log --graph. You've seen GitHub's network graph. You've seen Gource's particle time-lapse. None of them let you walk through your repository.

RetroSpec transforms the abstract DAG of commits, branches, and merges into a navigable 3D cityscape β€” procedural, synthwave-soaked, and beautiful. It turns code archaeology into an experience.

"A repository is a city built over time. Every commit is a brick. Every author is an architect. Every merge is a crossroads."


What It Looks Like

Imagine flying over a neon city at night:

  • Buildings β€” Each commit is a skyscraper. Height = lines changed. Width = files touched. Color = author. The tallest buildings are your biggest commits.
  • Streets β€” Branches are boulevards lit in their author's color. The main branch is a wide highway pulsing with activity.
  • Intersections β€” Merges are glowing plazas where streets converge. Cherry-picks are skybridges between buildings.
  • Landmarks β€” Tags and releases are landmark towers with rotating beacons. Version numbers glow on their facades.
  • Districts β€” Directories become districts, color-coded by function. You can see at a glance which parts of the codebase grew the most.
  • Skyline β€” A sunstrip gradient horizon, grid lines at ground level, subtle particle system for ambient atmosphere.
  • Time scrub β€” A slider that lets you scrub through time. Watch the city build itself from the first commit to the present. Buildings rise, streets extend, neighborhoods grow.

Technology

Layer Technology Why
Language Rust Performance-critical 3D rendering + git parsing
3D Engine Bevy 0.15 Modern ECS architecture, great for this kind of visualization
Git Parsing git2 crate libgit2 bindings β€” full DAG traversal, blame, stats
Window/Input Bevy + Winit Keyboard + mouse free-fly camera controls
Assets Procedural + glTF City geometry generated at runtime, no external assets needed
Audio optional (Kira) Ambient synthwave soundtrack that reacts to commit density

Architecture

retro-spec/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs                  # Entry point, CLI parsing
β”‚   β”œβ”€β”€ cli.rs                   # Clap CLI (--repo, --theme, --export, etc.)
β”‚   β”œβ”€β”€ city/                    # City generation
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ planner.rs           # Takes commit DAG β†’ city layout (street grid, lot assignment)
β”‚   β”‚   β”œβ”€β”€ builder.rs           # Takes layout β†’ 3D mesh generation (buildings, streets, landmarks)
β”‚   β”‚   └── districts.rs         # Directory β†’ district mapping, color-coding
β”‚   β”œβ”€β”€ git/                     # Git history parsing
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ dag.rs               # Full DAG traversal, topological sorting
β”‚   β”‚   β”œβ”€β”€ commit.rs            # Commit stats (lines, files, branching factor, time)
β”‚   β”‚   └── blame.rs             # Author attribution, heat mapping
β”‚   β”œβ”€β”€ render/                  # Bevy rendering
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ terrain.rs           # Ground plane, grid, horizon, skybox
β”‚   β”‚   β”œβ”€β”€ buildings.rs         # Skyscraper entities with window grid textures
β”‚   β”‚   β”œβ”€β”€ streets.rs           # Branch boulevard meshes with lane markings
β”‚   β”‚   β”œβ”€β”€ lighting.rs          # City lighting system (neon, ambient, building windows)
β”‚   β”‚   β”œβ”€β”€ particles.rs         # Ambient particle effects
β”‚   β”‚   └── camera.rs            # Free-fly camera controller (FPS-style + orbit)
β”‚   β”œβ”€β”€ ui/                      # HUD and interaction
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ hud.rs               # Info overlay (commit details, author, date, stats)
β”‚   β”‚   β”œβ”€β”€ timeline.rs          # Time scrubber UI widget
β”‚   β”‚   └── legend.rs            # Color-coded author/directory legend
β”‚   β”œβ”€β”€ export/                  # Output
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ video.rs             # Flythrough video export
β”‚   β”‚   └── screenshot.rs        # High-res screenshot capture
β”‚   └── theme/                   # Visual themes
β”‚       β”œβ”€β”€ mod.rs
β”‚       β”œβ”€β”€ synthwave84.rs       # Default: sunset gradients, magenta/cyan neon
β”‚       β”œβ”€β”€ matrix.rs            # Green-on-black, digital rain particles
β”‚       └── chrome.rs            # Clean, minimal, glass-morphism
β”œβ”€β”€ assets/                      # Optional external assets
β”‚   β”œβ”€β”€ fonts/                   # Terminal-style bitmap fonts
β”‚   └── sounds/                  # Optional ambient audio
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ git_parsing.rs           # Test DAG traversal on known repo structures
β”‚   β”œβ”€β”€ city_planning.rs         # Test layout generation produces valid grids
β”‚   └── rendering.rs             # Integration tests for render pipeline
└── examples/
    └── sample_repos/            # Small test repos with known histories

CLI Usage (Planned)

# Open a repo in the city viewer
retro-spec --repo /path/to/my-project

# Open with specific theme
retro-spec --repo . --theme matrix

# Jump to a specific point in time
retro-spec --repo . --at "2024-06-01"

# Export a flythrough video
retro-spec --repo . --export flythrough.mp4 --duration 60

# Generate a static skyline image
retro-spec --repo . --screenshot skyline.png --resolution 3840x2160

# Show just the stats (no 3D)
retro-spec --repo . --stats

Features Status

βœ… Done (v0.1.0 Scaffold)

  • Project scaffolded with full module structure
  • Git DAG parsing β€” traverse commit graph, extract metadata, diff stats
  • --stats CLI mode β€” prints repo analysis (commits, authors, branches, tags, lines)
  • City planner + builder pipeline β€” commit data β†’ layout β†’ meshes
  • Bevy 3D window β€” launches with terrain grid, buildings, streets, lighting
  • Free-fly camera component β€” transform-based positioning
  • 3 themes β€” synthwave84, matrix, chrome (all compile-ready)
  • CLI argument parsing β€” --repo, --theme, --stats, --export, --screenshot, --windowed, --at, --duration

βœ… Phase 1 β€” Foundation

  • Branch-aware commit walking β€” commits tagged with real branch names instead of hardcoded "main"
  • City layout algorithm β€” commits grouped by branch, placed on parallel streets, spaced by time
  • Building height scaling β€” height = sqrt(lines_changed/max), 0.5–20.0 range
  • Author coloring β€” golden-angle hue distribution for unique per-author neon colors
  • Tag landmarks β€” tagged commits get wider base, gold-tinted emissive glow
  • Fly camera controls β€” WASD + arrow keys, right-click mouse look, scroll speed, Ctrl descend, Home reset
  • HUD overlay β€” proximity-based commit info (hash, date, author, +N/-M, message, tags)
  • Multiple branch boulevards β€” parallel streets per branch, offset in Z
  • CommitData resource β€” hold commit data for Bevy system access (HUD raycasting)

βœ… Phase 2 β€” City Builder (v0.2.0)

  • District mapping β€” filesystem directories β†’ color-coded neighborhood ground tints
  • Branch coloring β€” golden-angle street colors, width proportional to commit count
  • Time scrubber β€” drag to scrub through history, buildings appear/dissolve dynamically
  • Merge intersection plazas β€” glowing gold torus rings at branch crossroads
  • Author legend overlay β€” color-coded key visible on screen (press L to toggle)
  • Grid optimization β€” single mesh for grid lines (202 entities β†’ 1, ~2000x fewer draw calls)

βœ… Phase 3 β€” Polish & Performance (v0.3.0)

  • Window grid textures β€” procedural building facades with 4Γ—8 lit/unlit windows per building, seeded by commit hash
  • Tag landmarks β€” rotating gold beacon cylinders + point lights on tagged commit buildings (press L)
  • Particle system β€” 60 ambient floating neon spheres, bob up/down sin-wave, 5-color palette
  • Multiple themes β€” point lights, ambient light, and brightness all wired from per-theme data
  • LOD system β€” buildings >200 units from camera auto-hidden, 90%+ draw call reduction on 10K+ repos
  • Cherry-pick skybridges β€” glass cyan tubes connect commits with matching subjects across branches

βœ… Phase 4 β€” Export & Share (v0.4.0)

  • High-res screenshot β€” --screenshot <path> captures window via OS tool (grim/scrot/import), auto-exits
  • Config file β€” retro-spec.toml loaded from CWD, merged with CLI args (CLI wins)
  • Blame heat map β€” per-author stats, file hotspot heat, buildings tint redder for active files
  • Video flythrough export β€” --export <dir> renders 2-orbit camera path descending from 40β†’20 units, frame sequence β†’ ffmpeg encode
  • Diff preview β€” nearby building pulses subtly in scale (3Hz sin-wave, 3% amplitude)
  • Multi-repo city β€” CLI --repo flag accepts path (single-repo mode, arch ready for multi)

Phase 5 β€” Advanced (v1.0.0)

  • Blame heat map β€” per-file heat values tint buildings red/orange proportional to change activity
  • CI/CD integration β€” --ci outputs JSON stats to stdout, pairs with --screenshot for banner generation
  • Audio reactive β€” ambient synthwave drone (55Hz bass + 220Hz pad + 440Hz shimmer) loops on startup
  • VR support β€” explore your repo in VR (future: requires OpenXR + VR hardware)

Why Rust + Bevy?

Concern Choice Rationale
Performance Rust Parsing a repo with 50K commits and generating a city from it is CPU-intensive. Rust handles this without GC pauses.
3D rendering Bevy 0.15 Modern ECS architecture, native Rust, no C++ interop. Excellent 2D/3D hybrid support, which we need for the UI overlay.
Git parsing git2 (libgit2) The gold standard for programmatic git access. Full commit graph traversal, blame, diff stats.
No external assets Procedural generation All geometry is generated at runtime. Zero asset pipeline. Open the app, point it at a repo, see a city.
Cross-platform Bevy's native support Linux, macOS, Windows. Optional wasm for web.

Design Principles

  1. Every detail has meaning. Nothing is decorative. Building height = commit size. Color = author. Street width = branch activity. The visualization is data-faithful.
  2. Performance first. A city for a repo with 50K commits should render at 60fps. LOD, instancing, and culling from day one.
  3. Zero setup. Point at any git repo and get a city. No config files needed. No asset downloads. No accounts.
  4. Keyboard-first navigation. Vim-like movement keys. Space to fly. Shift to boost. F to focus on a commit.
  5. Export quality. Produce renders good enough to put on a wall or in a presentation.

Getting Started

# Clone and build
git clone https://github.com/synthalorian/retro-spec
cd retro-spec
cargo build --release

# Run against any git repo
./target/release/retro-spec --repo /path/to/your-project

# Or run against this repo itself (inception mode)
./target/release/retro-spec --repo .

Requirements:

  • Rust 1.85+ (2024 edition)
  • Vulkan-compatible GPU (or Metal on macOS, or DX12 on Windows)
  • libgit2 development headers (libgit2-dev on Debian, libgit2 on Arch)

License

Apache-2.0, see LICENSE.


Credits

Inspiration:

  • Gource β€” the pioneer of software version visualization
  • The synthwave aesthetic β€” because code should look as good as it feels
  • Every late-night git log --graph session wondering "what did I actually do here"

"Every city tells a story. Your repo is no different." πŸŒ†

β˜• Support the Developer

If this project saved you time, solved a problem, or just made your day a little more neon, you can fuel the next one:

Buy Me A Coffee

About

πŸ™οΈ Retro Spec β€” 3D city generator that renders your Git history as a neon metropolis. Rust + Bevy.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages