AboutProjectsResumeOthersContact
MERN Stack ยท Production Grade ยท URL Management

Shortly

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.

What is Shortly?

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.

TypeFull Stack Web App
FrontendReact.js + Axios
BackendNode.js + Express.js
DatabaseMongoDB + Mongoose
Key FeaturesShort codes, Click tracking, Link mgmt
Status Complete

The Flow

User pastes long URL into the form
โ†’
Backend generates unique short code
โ†’
URL + code saved to MongoDB
โ†’
Short link shared anywhere
โ†’
Click redirects + counter increments
URL Shortening
Converts any long URL into a short unique code. Collision-resistant generation algorithm.
Smart Redirect
Visiting the short link instantly redirects to the original URL with near-zero latency.
Click Tracking
Every redirect increments a click counter. See exactly how many times your link was visited.
Link Management
View all shortened links, copy to clipboard, delete unwanted links from the dashboard.
Server Validation
URL format validation and error handling on the server before anything hits the database.
Responsive UI
Clean React frontend that works perfectly on desktop, tablet, and mobile.

API Endpoints

MethodEndpointDescription
POST/shortenShorten a URL โ€” returns short code
GET/:shortCodeRedirect to original URL + increment click count
GET/api/linksGet all shortened links with stats
DELETE/api/links/:idDelete a shortened link
POST /shorten โ€” Request body:
{ "longUrl": "https://example.com/very/long/url?with=params" }
Response:
{ "shortUrl": "http://localhost:5000/abc123", "shortCode": "abc123" }