Side project · Jul – Oct 2026
GoloLink, click attribution for YouTube creators
Creators put affiliate links in video descriptions and then cannot tell which video sold anything. GoloLink gives every link a short URL per video, records each click, and attributes it back. I built all of it on my own, from the redirect service to the dashboard, and it is live at gololink.com.
- Role
- Sole engineer
- Status
- Live at gololink.com · early, in active development
- Platforms
- Web
- Stack
- Next.js 16, React 19, Fastify, Redis Streams, PostgreSQL, Supabase, Drizzle, Playwright, DigitalOcean, Vercel
- Links
- gololink.com
- automated tests, up from 17
- ~900automated tests, up from 17
- processes, deployed and scaled separately
- 4processes, deployed and scaled separately
The problem
A click on a creator’s link is a redirect. It has to be fast, because a viewer is waiting, and counted exactly once, because creators make decisions from the numbers. Those pull in opposite directions: the fastest redirect does no work, and the most reliable count writes to a database before answering.
The shape of the system
Four processes from one monorepo: the Next.js dashboard, a Fastify API, a separate Fastify redirect service, and a worker with no HTTP server at all.
Decisions and their costs
| Decision | Why | What it costs |
|---|---|---|
| The redirect is its own service | It runs on every click; the API only when a creator opens the dashboard, so the hot path scales alone and stays free of analytics code | One more thing to deploy and monitor |
| Answer first, write later: cache lookup, append to a Redis stream, return the 302 | The redirect never waits on Postgres | If the append fails, that click is lost; a worker drains the stream in batches of 100 |
| The click id is created at enqueue and is the row’s primary key | A redelivered batch inserts nothing new | Ids are random, so they carry no ordering |
| Temporary errors retry; after five failed attempts, rows go one by one and failures go to a dead-letter stream | One bad row cannot block 99 good ones | Failure counts live in memory and reset on restart |
| Attribute at read time: a click stores only its link placement, and reports join to the current state | Survives services running slightly different versions during a deploy | Renaming or deleting a placement changes how past clicks are grouped |
The last one came from a failure. My first design copied attribution fields onto every click row. When the redirect and the worker were deployed at slightly different versions, those fields arrived empty and zeroed every report.
Production taught a few smaller lessons too. Each stream consumer needs its own Redis connection, because blocking reads on a shared one are serialised. Rate limits must use the visitor’s real IP, not the proxy’s, since every request arrives through Vercel. And HEAD requests from link scanners are redirected but not counted, while bot traffic is flagged rather than deleted.
The bug that taught me the most
A click through a Smart Pick page showed up in both the “by link” and “by Smart Pick” reports: three clicks counted where two happened. The exclusion was keyed on the link when it should have been keyed on the placement. The fix was one condition; the lasting change was an end-to-end test that clicks through both paths and checks the totals.
Testing
In August the project had 17 unit tests and no CI. By October it had about 340 backend tests, 320 frontend unit tests and 250 Playwright end-to-end tests, with CI typechecking all three services and running the unit suites on every push.
What I would do differently
- Put error tracking in before launch. Logging was structured from day one, but exceptions only went to logs until my own pre-launch audit caught it.
- Run Playwright in CI. The end-to-end suite runs locally and against production, but not on every pull request, where a regression is cheapest to catch.
