A simple and efficient URL shortener built using Node.js, Express, MongoDB, and EJS. It allows users to convert long URLs into short, shareable links and track their usage.
- Backend: Node.js, Express.js
- Database: MongoDB Atlas
- Templating Engine: EJS
- Deployment: Render
- 🔗 Shorten long URLs instantly
- 📊 Track number of clicks per link
- 🔄 Redirect to original URL
- 📋 Display all shortened URLs
- ⚡ Fast and lightweight
URL-SHORTENER/
│
├── models/
│ └── shortUrl.js
│
├── views/
│ └── index.ejs
│
├── server.js
├── package.json
└── package-lock.json
- User enters a long URL
- Server stores it in MongoDB
- Generates a short ID
- When accessed, it redirects to the original URL
- Click count is updated
git clone https://github.com/pratikpradhan-dev/url-shortener.git
cd url-shortener
npm installnpm startCreate a .env file (optional for local):
MONGO_URI=your_mongodb_connection_string
PORT=5000
Deployed using Render with:
- Environment variables
- MongoDB Atlas cloud database
- 🔍 Search URLs
- 🗑️ Delete links
- 📈 Analytics dashboard
- 🎨 Better UI/UX
- 🔐 User authentication
Pratik Pradhan
Give it a ⭐ on GitHub and share it!