
Building a modern URL shortener with Next.js — lessons from shipping y.hn
Last month I shipped y.hn , a URL shortener built on one of the shortest domains you can get (4 characters). Here's the technical breakdown — what worked, what didn't, and what I'd do differently. The Stack Next.js 16 (App Router) → Vercel Edge Prisma ORM → Neon Postgres (serverless) That's it. No Redis, no queue, no separate API server. One repo, one deploy target. Why this stack? Next.js App Router gives me server components, API routes, middleware, and edge runtime in one framework. The middleware is key — it intercepts short link requests at the edge before they hit the origin, so redirects are fast globally. Neon is serverless Postgres. Cold starts are minimal, and the free tier is generous. I use branching for preview deployments — every PR gets its own database branch. Prisma — controversial choice, I know. But for a solo developer, the type safety and migration workflow saves me time. The performance overhead is acceptable for this use case. Feature Architecture Short link crea
Continue reading on Dev.to Webdev
Opens in a new tab



