URL Shortener REST API

The Problem #

Needed a simple yet well-structured URL shortener backend, not just a proof of concept, but code that could serve as an architecture reference for other Go projects.

The Solution #

Built using Go with Echo framework and MySQL, with a clean modular structure:

Architecture #

A modular structure separating handler, service, and repository, making it easy to test and extend with new features.

Results #

Lessons Learned #

  1. Framework selection matters: Echo provides lightweight routing and middleware without overhead, ideal for small-to-medium APIs
  2. Modular structure from the start: even for small projects, proper structure makes adding features (analytics, auth) straightforward without major refactoring