Skip to content

URL Shortener is a full-stack system design project that allows users to generate short, shareable links from long URLs. The project follows a client-server architecture with a React frontend and a Node.js + Express backend connected to MongoDB for data storage. Users can input any long URL, and the system will provide a unique shortened link

Notifications You must be signed in to change notification settings

samansiddiqui55/URL-SHORTNER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— URL Shortener

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


✨ Features

  • 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.

πŸ—‚ Project Structure

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 β”‚

1. Clone the repository

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.

About

URL Shortener is a full-stack system design project that allows users to generate short, shareable links from long URLs. The project follows a client-server architecture with a React frontend and a Node.js + Express backend connected to MongoDB for data storage. Users can input any long URL, and the system will provide a unique shortened link

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages