Skip to content

A simple and efficient URL Shortener App built using the MERN stack. This application allows users to shorten long URLs and redirect to the original URL when accessing the shortened link.

License

Notifications You must be signed in to change notification settings

lra8dev/quickshort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Project Banner
reactjs typescript expressjs tailwindcss mongodb

QuickShort - Tiny Links, Big Impact! πŸš€

A simple and efficient URL Shortener App built using the MERN (MongoDB, Express.js, React.js, Node.js) stack. This application allows users to shorten long URLs and redirect to the original URL when accessing the shortened link.

πŸ“‹ Table of Contents

  1. πŸ•ΈοΈ Features
  2. βš™οΈ Tech Stack
  3. πŸ“‚ Project Structure
  4. 🀸 Quick Start
  5. πŸ”— API Endpoints
  6. πŸ”­ Deployment
  7. πŸͺ΄ Future Enhancements
  8. 🀝 Contributing
  9. πŸ“„ License
  10. πŸ“© Contact

πŸš€ Features

  • πŸ”— Shorten long URLs with a unique identifier
  • πŸš€ Instant redirection to the original URL
  • πŸ“Š Track the number of clicks for each shortened link
  • 🌐 Responsive and user-friendly UI
  • 🎨 Styled with Tailwind CSS

πŸ› οΈ Tech Stack

Frontend

  • React.js (Vite for fast development)
  • Tailwind CSS (for modern UI styling)
  • React Query (for state management)
  • Axios (for API requests)

Backend

  • Node.js & Express.js (REST API)
  • MongoDB & Mongoose (Database & Schema management)
  • nanoid (for generating unique short URLs)
  • dotenv & cors (environment configuration & cross-origin handling)

πŸ—οΈ Project Structure

/url-shortener
 β”œβ”€β”€ client/        (React.js Frontend)
 β”œβ”€β”€ server/        (Express.js Backend)
 β”œβ”€β”€ public/        (Static Assets)
 β”œβ”€β”€ package.json   (Project Dependencies)
 β”œβ”€β”€ .gitignore     (Git Ignore File)
 β”œβ”€β”€ LICENSE        (Project License)
 β”œβ”€β”€ README.md      (Project Documentation)

🀸 Getting Started

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

  • Git - for version control
  • Node.js - for running JavaScript on the server
  • pnpm - for package management

1️⃣ Clone the Repository

git clone https://github.com/your-username/quickshort.git
cd quickshort

2️⃣ Backend Setup (Node.js & Express)

cd server
pnpm install

πŸ”Ή Create a .env file in the server/ directory

CLIENT_API = <your_frontend_api_url>;
SERVER_API = <your_backend_api_url>;
MONGO_URI = <your_mongodb_connection_string>;
PORT = 5000;

πŸ”Ή Start the Backend Server

pnpm dev

3️⃣ Frontend Setup (React.js)

cd ../client
pnpm install

πŸ”Ή Create a .env file in the client/ directory

VITE_SERVER_API = <your_backend_api_url>;

πŸ”Ή Start the Frontend Server

pnpm dev

4️⃣ Open the App

Visit: http://localhost:5173

πŸ“Œ API Endpoints

1️⃣ Shorten a URL

POST /short

{
  "longUrl": "https://example.com"
}

Response:

{
  "shortUrl": "http://localhost:5000/abc1234"
}

2️⃣ Redirect to Original URL

GET /:shortId

When visiting http://localhost:5000/abc1234, it redirects to https://example.com.

🌍 Deployment

  • Frontend: Vercel
  • Backend: Render
  • Database: MongoDB Atlas

πŸ”₯ Future Enhancements

βœ… Add User Authentication (JWT)
βœ… Allow Custom Short URLs
βœ… Track Click Analytics
βœ… Create a Dashboard for Managing URLs

πŸ™Œ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

To contribute:

Fork the repository
Create your feature branch (git checkout -b feature/your-feature)
Commit your changes (git commit -m 'feat: add your feature')
Push to the branch (git push origin feature/your-feature)

πŸ“œ License

This project is licensed under the Apache License - see the LICENSE file for details.

πŸ“© Contact

For any questions or suggestions, feel free to reach out at laxmanrathod.dev@gmail.com.

About

A simple and efficient URL Shortener App built using the MERN stack. This application allows users to shorten long URLs and redirect to the original URL when accessing the shortened link.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published