All projects

Full-stack URL shortener

Trim.

A full-stack URL shortener with custom aliases, JWT auth, and a dashboard — short links redirect directly from your domain.

Case study

The problem

Long URLs look unprofessional and tell you nothing — and most shorteners either lack analytics or force you onto someone else's domain.

What I built

A Next.js 16 + PostgreSQL/Drizzle URL shortener with custom aliases on your own domain, link expiry, QR code generation, CSV export, and 14-day click analytics on a management dashboard. Authentication built from scratch — scrypt password hashing, short-lived JWTs, and rotating refresh tokens in HttpOnly cookies, no auth library. 57 Vitest unit tests guard the core logic, with GitHub Actions CI/CD deploying to Vercel.

Results

  • Custom aliases on your own domain
  • Auth from scratch: scrypt + rotating refresh tokens
  • 57 unit tests with CI/CD on every push

Highlights

  • Custom aliases and direct redirects from yourdomain.com/:code
  • JWT auth with dashboard to manage, copy, and delete links
  • 57 unit tests, GitHub Actions CI/CD, and Vercel deployments

Tech stack

Next.js 16PostgreSQLDrizzleJWTVitest

Key facts

57 unit testsCI/CD pipelineDrizzle ORM