Receipts

Your GitHub year on one shareable card, in words people who don't code understand.

Next.js · TypeScript · next/og · GitHub GraphQL

Brief

I posted a card of my own 2k GitHub contributions, and a friend asked for theirs. The contribution graph means a lot to developers and very little to anyone else: green squares and no context. Year-in-review season was close, and I wanted a card anyone could make in seconds and post where people who don't code would see it.

Build

Type a username and Receipts draws the last twelve months as a 16:9 image: the familiar grid of days, the total, and a few stats in plain language. Pick any accent colour and a light or dark background, then download the PNG or share the link, which unfurls as the card. It went from create-next-app to live in one day.

Key decisions

  • One renderer. The card is written once for next/og and serves the preview, the 2x download and the Open Graph image, so what you share is exactly what you saw.
  • Lookups return typed errors instead of throwing. If GitHub can't be reached, the page says so and never shows a made-up year. A built-in demo year works offline.
  • Lines of code was the obvious next stat, but GitHub's OAuth repo scope includes write access. The plan instead is a read-only GitHub App, plus a local command for private and client repos that sends only daily totals.
  • Pressing Enter before the page had hydrated sent people to the wrong route, because a slow analytics script was holding up page load. The form now has a plain server fallback that also works without JavaScript, and the script loads async.

Outcome

Live at receipts01.vercel.app. Around 200 people made cards, mostly from the developer communities I shared it in. That number comes from my own self-hosted analytics platform. Receipts sends custom events for card views, downloads and copies, and counts views in the studio rather than hits on the image route, because previews re-render on every colour change and link unfurls fetch the image too.