5lnk - URL Shortener

A URL shortener built with Go and Next.js, created to deepen my Go and TypeScript skills and to explore the Next.js App Router introduced in version 13.

The problem

Short links are a simple idea, but a good shortener needs fast redirects, user accounts to manage links, and a reliable API behind it. I started 5lnk.me as a hands-on opportunity to improve my Go and TypeScript skills while learning how the Next.js App Router works, and I decided to build it as a real product rather than a tutorial exercise.

There’s a vast number of link shorteners out there, and like any good dev who enjoys learning by doing, I decided to build my own.

What I did

I designed and built the REST API in Go, and also developed the frontend using Next.js—which was my biggest challenge.

On the backend, I integrated Firebase Auth through the Firebase Admin SDK so users can authenticate and manage their own links. I connected the API to a PostgreSQL database using GORM, and I added Redis caching to some of the endpoints to speed up responses.

On the frontend, I used this project to learn and apply the Next.js App Router. Creating UIs for short links creation and management, user login and sign up, e.g.

Project’s structure

The project is split into two main parts that communicate over HTTP:

  • Frontend: Built with Next.js, React and TypeScript, using the App Router. It handles the user interface and sign-in flow.
  • REST API: Built with Go. It validates Firebase tokens with the Admin SDK, handles link creation and management, and serves the redirects.
  • Data layer: PostgreSQL (accessed through GORM) stores users’ data and links, while Redis caches responses on selected endpoints.

Screenshots

11screenshots

5lnk.webp

See also