A System Design Project that implements a full-stack URL shortening service.
Users can input long URLs and generate short, shareable links.
The project is split into Backend (Node.js, Express, MongoDB) and Frontend (React + Vite), demonstrating modular design and scalable architecture.
Live demo: Netlify Deployment
- Shortens long URLs into unique, compact links.
- Redirects users seamlessly from the short link to the original URL.
- Backend built with Node.js + Express + MongoDB.
- Frontend built with React + Vite.
- Modular separation of concerns between backend and frontend.
- Scalable design principles suitable for system design projects.
URL-SHORTNER/ β βββ BACKEND/ # Node.js + Express + MongoDB backend β βββ src/ # Routes, models, controllers β βββ app.js # Main server file β βββ .env # Environment variables β βββ package.json β βββ FRONTEND/ # React + Vite frontend β βββ src/ # React components β βββ index.html β βββ vite.config.js β βββ package.json β
git clone https://github.com/samansiddiqui55/URL-SHORTNER.git
cd URL-SHORTNER
## βοΈ Backend Setup
1. Go to the backend folder:
```bash
cd BACKEND
Install the required dependencies:
npm install
Create a .env file inside the BACKEND directory and add:
MONGO_URI=<your-mongodb-connection-string>
PORT=5000
BASE_URL=http://localhost:5000
Start the backend server:
npm start
## βοΈ Frontend Setup
1. Go to the frontend folder:
```bash
cd FRONTEND
Install the required dependencies:
npm install
Start the frontend development server:
npm run dev
Open the app in your browser at:
http://localhost:5173
System Design Overview
Frontend (React + Vite) β User inputs a long URL.
Backend (Express + MongoDB) β Generates a unique short code, stores mapping in MongoDB.
Database (MongoDB) β Persists original URL and short code.
Redirection β When the short link is visited, backend retrieves original URL from DB and redirects.