SPB Git
A personal GitHub, built from scratch
SPB Git is a self-hosted software forge where every repository is public and clonable, writes are owner-only, and the filesystem is the database.
15
CLI commands
52
Weeks of contribution heatmap
200/min
Public API rate limit
14
Nightly backups retained
≥ 95
Lighthouse performance target
0
Databases — filesystem is the store
Overview
SPB Git is the canonical home for all of Simon-Pierre Boucher's repositories, live at git.spboucher.ai. It implements Git Smart HTTP v2 by hand — streamed upload-pack and receive-pack, anonymous clone and fetch, token-authenticated push, post-receive hooks, and zip/tar.gz snapshots — on a Node.js Fastify server with no SQL or NoSQL database anywhere.
The web UI is a server-rendered showcase designed to match GitHub's polish: pinned repos, an activity feed, a contribution heatmap, badge-perfect README rendering with mermaid diagrams and relative-image resolution, shiki-highlighted file browsing with line anchors, commits, diffs, blame, global search, dynamic Open Graph cards, and an Atom feed. Dark and light themes ship with self-hosted fonts and zero third-party requests.
Day-to-day, everything runs through the spbgit CLI — a terminal command center covering the full lifecycle from repo creation to multi-repo sync and GitHub-style release uploads with sha256 sidecars. Bare repos on disk are the source of truth, expensive renders are cached per repo-and-commit, and a push instantly busts and rewarms the cache.
Key Features
Git Smart HTTP v2
Streamed upload-pack and receive-pack with anonymous clone and token-gated push, packfiles never buffered in memory.
spbgit CLI
One terminal command center for init, create --push, clone --all, status, sync, releases, and a self-diagnosing doctor.
GitHub-grade README rendering
Badges, mermaid diagrams, task lists, footnotes, emoji shortcodes, and relative images all render pixel-perfect in dark and light themes.
Releases with binary assets
DMG, pkg, and zip assets attach to git tags, stream to disk with sha256 sidecars, and download publicly per tag.
PAT-secured writes
Personal access tokens are argon2id-hashed at rest, revocable, and tracked with last-used timestamps — reads never need an account.
Global search
A cache-backed inverted index searches repo names, descriptions, topics, and README content, refreshed on every push.
JSON API
Public reads and bearer-token writes at /api/v1 cover repos, languages, commits, tokens, and site-wide stats.
Filesystem as the database
Bare repos are the source of truth, meta.json holds repo metadata, and every expensive artifact is cached per repo@sha and busted on push.
Hardened by design
Double path-traversal checks, strict Markdown sanitization, nosniff plus sandbox CSP on raw files, and loopback-only hook routes.
How It Works
Ingress via ngrok
The public domain git.spboucher.ai terminates TLS at an ngrok tunnel and forwards to the Fastify app on the host node.
One server, four surfaces
Fastify routes every request to the SSR web UI, the /api/v1 JSON API, the /:repo.git Smart HTTP backend, or raw/archive file serving.
Filesystem as source of truth
Bare repositories live under the git root, a single meta.json indexes descriptions, topics, and pins — no database process exists.
Push-driven cache lifecycle
A post-receive hook hits a loopback-only route that busts caches, recomputes language stats, rewarms the README render, logs the activity feed, and regenerates the OG image.
Resilient operations
pm2 keeps the server and tunnel alive across reboots, /healthz feeds monitoring, and a nightly cron archives repos and data, keeping 14 backups.
Tech Stack
Server
Rendering
CLI & Auth
Ops
Highlights
- Implements the Git Smart HTTP protocol by hand — clone works for any stranger, push is rejected without a PAT
- Zero databases: bare git repos plus one meta.json, cached per commit SHA and invalidated by push hooks
- README rendering built to be indistinguishable from GitHub, badges and mermaid included
- spbgit sync commits, rebases, and pushes every workspace repo in one command
- GitHub-style releases serve DMG downloads for the entire Zyquo app suite
- SSR pages with self-hosted fonts and no render-blocking third-party requests, targeting Lighthouse 95+
Explore SPB Git
A self-hosted git forge for one — the full source is on GitHub.