← All projects

Case · Go backend

Short: link shortener

Link shortening with aliases and expiry, click statistics by day, browser and device, a token-protected dashboard. IP addresses are not stored.

  • Go
  • SQLite
  • Docker

01 · How it looks

Screenshots

Screenshot of the project "Short: link shortener" at 1280 pixels wide
Desktop, 1280 px
Screenshot of the project "Short: link shortener" on a phone screen, 390 pixels wide
Phone, 390 px

02 · About

What it is and why

A link shortener with click statistics: custom aliases, expiry, redirects, and a breakdown by day, browser, OS and device.

The dashboard is protected by an admin token. Visitors are counted by a hash with a daily salt; IP addresses are not stored.

Limitations

One admin token, no users. The demo statistics are generated and do not reflect real traffic.

What is inside

  • 302 redirect and click tracking in SQLite
  • Rate limit on link creation per address
  • Statistics by day, browser, OS and device
  • SEED_DEMO=1 mode with fictional statistics for demos
  • Tests and Docker

03 · How to run

Run it locally

git clone <repository on request> link-shortener
cd link-shortener
ADMIN_TOKEN=demo SEED_DEMO=1 go run ./cmd/server   # http://localhost:8082

04 · Code

The repository is private

The source lives in a private repository. I will grant access on request: write to me and I will send an invitation.

Request the code