DEV Community

Cover image for I built a 3D graveyard for my abandoned GitHub repos (18 of 22 are dead)
Selim
Selim

Posted on

I built a 3D graveyard for my abandoned GitHub repos (18 of 22 are dead)

I have 22 public repos on GitHub. 18 of them haven't been touched in over a year.

The oldest one is called todolist. Of course it is.

Instead of feeling bad about it, I gave them a proper funeral. Repo Graveyard takes a GitHub username, finds the repos nobody has pushed to in a while and buries them in a 3D graveyard you can walk through. Every repo gets a tombstone with its name, birth and death years, its description as the epitaph, and a cause of death.

A 3D graveyard at night. Each tombstone carries the name of an abandoned GitHub repo

No login, no backend, no build step. Plain HTML, CSS and JavaScript modules, Three.js from a CDN, and the public GitHub API called straight from your browser.

Here's how the interesting parts work.

When is a repo "dead"?

GitHub gives us pushed_at for every repo, which is the last time anything was pushed. If it's older than a threshold (1 year by default, you can pick 6 months or 2 years), the repo is dead. Archived repos are always dead. Forks are skipped unless you ask for them.

export function classify(repos, { now = Date.now(), thresholdDays = 365, includeForks = false } = {}) {
  const dead = [];
  const alive = [];
  for (const r of repos) {
    if (r.fork && !includeForks) continue;
    if (r.archived || idleDays(r, now) >= thresholdDays) dead.push(r);
    else alive.push(r);
  }
  dead.sort((a, b) => lastActivity(a) - lastActivity(b)); // oldest grave first
  return { dead, alive };
}
Enter fullscreen mode Exit fullscreen mode

One gotcha: empty repos can have pushed_at: null, so lastActivity() falls back to created_at.

Causes of death

This was the fun part. The rules go from most specific to most generic:

export function causeOfDeath(repo) {
  if (repo.archived) return "archived";        // "Archived in peace"
  if ((repo.size ?? 0) === 0) return "stillborn"; // "Born empty, not a single line written"
  for (const [re, key] of PATTERNS) if (re.test(repo.name)) return key;
  if (lifespanDays(repo) < 1) return pick(SAME_DAY, repo);   // "A one-commit life"
  if ((repo.open_issues_count ?? 0) > 0) return "issues";  // "Buried under unanswered issues"
  if ((repo.stargazers_count ?? 0) >= 10) return "loved";  // "Loved, but it wasn't enough"
  return pick(GENERIC, repo);                     // "A new framework came out"...
}
Enter fullscreen mode Exit fullscreen mode

PATTERNS matches repo names: anything with todo gets "The world didn't need another todo app", portfolio gets "Replaced by a newer portfolio", clone gets an identity crisis, and test/demo/tutorial/hello gets "Died while learning".

Same repo, same stone, every time

I didn't want the graveyard to reshuffle on every visit. If you share your graveyard with a friend, they should see the same stones. So all the "random" choices (stone shape, tilt, height, which generic cause) come from a tiny FNV-1a hash of the repo's full name:

export function hash(str) {
  let h = 2166136261;
  for (let i = 0; i < str.length; i++) {
    h ^= str.charCodeAt(i);
    h = Math.imul(h, 16777619);
  }
  return h >>> 0;
}
Enter fullscreen mode Exit fullscreen mode

Stones age with neglect

The longer a repo has been abandoned, the worse its stone looks. Moss grows linearly over five years, and after three years the stone cracks:

export function stoneLook(repo, now = Date.now()) {
  const h = hash(repo.full_name || repo.name);
  const years = idleDays(repo, now) / 365;
  return {
    shape: SHAPES[h % SHAPES.length],  // round, arch, gothic, slab, obelisk
    tilt: ((h >>> 8) % 7) - 3,         // -3..3 degrees
    moss: Math.min(1, years / 5),
    cracked: years >= 3,
    height: 0.85 + ((h >>> 4) % 30) / 100,
  };
}
Enter fullscreen mode Exit fullscreen mode

All of this lives in core.js, which has no DOM and no network. It runs in the browser and in Node, so the logic has plain node --test unit tests.

The scene

The 3D side is Three.js with a few tricks to keep it moody but light:

  • Engravings are canvas textures. Each stone's text (name, years, epitaph, cause) is drawn into a <canvas> and used as a CanvasTexture, with cracks drawn on top when the stone is old enough. No font loading in WebGL, and Turkish characters just work.
  • Two stone materials: clean plaster and worn mossy plaster from Poly Haven (CC0). Stones past a moss threshold switch to the mossy one, and the tone darkens a bit with age.
  • Atmosphere: FogExp2, a moon sprite, star points, fog sprites drifting near the ground and a few warm PointLight lanterns. The lantern, log and rock models are also Poly Haven.
  • Walking: scroll, drag or arrow keys move you down the path. Click a stone to read it, then ← → to go grave to grave.

A poster to share

At the end you get your stats (death rate, oldest dead, shortest life, most buried language) and a poster made from your own graveyard, rendered on a 2D canvas in three sizes: X (16:9), Instagram (4:5) and Stories (9:16).

Example share poster with an 86% death rate

Limits

The unauthenticated GitHub API allows 60 requests per hour per IP, and one graveyard costs 2 or more requests depending on how many repos the user has. That's plenty for trying a few names, but it's the reason there's no "compare 50 famous developers" mode.

Try it

👉 selimyalinkilic.github.io/repo-graveyard
Code: github.com/selimyalinkilic/repo-graveyard

Mine is 82%. What's your death rate? Drop it in the comments, and tell me which cause of death I'm missing. ðŸŠĶ

Top comments (0)