A fast, scalable URL shortener built with the full MERN stack. Converts long URLs into short shareable links with click tracking, link management, and a clean responsive UI.
Project Overview
Shortly is a production-grade URL shortener that demonstrates scalable backend design. Users paste a long URL, the backend generates a unique short code, stores it in MongoDB, and every subsequent visit to the short link redirects to the original URL while incrementing the click counter.
The system includes full link management. view all links, copy short URLs, see click counts, and delete links. Server-side validation catches invalid URLs before they ever hit the database.
Built with scalability in mind: the short code generation is collision-resistant, and MongoDB indexes ensure fast redirect lookups even at scale.
How It Works
Backend
| Method | Endpoint | Description |
|---|---|---|
| POST | /shorten | Shorten a URL โ returns short code |
| GET | /:shortCode | Redirect to original URL + increment click count |
| GET | /api/links | Get all shortened links with stats |
| DELETE | /api/links/:id | Delete a shortened link |