Open source · API

LinkForge

A URL shortening API with authentication, API keys, asynchronous and anonymized click tracking, and analytics. Designed to stay fast and handle load, even when redirects pile up.

FastifyTypeScriptPrismaPostgreSQLRedisBullMQ
RoleDesign & dev.
Period2026 · 2 wk.
TypePersonal project
StatusLive
LinkForge documentation

// Context

Why this project

A URL shortener is a deceptively simple classic: easy to do badly, hard to do well. Behind a simple redirect lie questions of performance, security and audience measurement.

I wanted to make it a short-scoped but back-end demanding project: a real API, authenticated, instrumented, and designed to handle traffic without slowing down the redirect.

// Problem

What needed to be solved

Three requirements shaped the entire architecture:

  • The redirect must stay instant. Measuring a click must never slow down the user following the link.
  • Useful stats, without tracking. Count and qualify clicks while anonymizing personal data.
  • Programmable and secure access. Authentication and API keys to integrate the service elsewhere.

// Solution

The approach taken

The core of the system separates the hot path (the redirect) from the cold path (analytics). On each click, the API immediately responds with the redirect and delegates click processing to a queue, consumed in the background.

Result: the end user never pays the cost of measurement, and statistics are built reliably, at their own pace.

Create a short link + API key
Analytics — clicks over time
Architecture: redirect → queue → analytics

// Technical decisions

The choices that matter

Fastify

A framework built for speed

Fastify offers minimal per-request overhead: ideal for a service whose primary function is to respond fast, thousands of times.

WhyRedirect latency is the product's #1 criterion.
Redis · BullMQ

Asynchronous click tracking

Each click is pushed into a BullMQ queue (on Redis) and processed outside the response path: enrichment, anonymization and aggregation happen in the background.

WhyDecoupling measurement from redirection guarantees stable response times under load.
Prisma · PostgreSQL

Durable & queryable data

Postgres stores links, API keys and aggregated statistics; Prisma secures access with strict typing shared across the API.

WhyReliable analytics require a solid relational database, not just a cache.

// Result

What it delivers

A complete, documented API that concretely demonstrates how I approach back-end work: performance first, reliable measurement second, privacy by design.

2separate paths: hot / cold
Asyncclick tracking outside the response
Anonymousanalytics without personal data