A full-stack URL Shortening application built using EJS, Node.js, Express.js, and MongoDB Atlas.
Includes Signup/Login, JWT authentication, bcrypt password hashing, and a clean UI rendered with EJS templates.
👉 Deployed Link: https://bitly.up.railway.app/
Replace the placeholder links with your actual screenshots.
| Page | Screenshot |
|---|---|
| Home Page | ![]() |
| Signup Page | ![]() |
| Login Page | ![]() |
| Dashboard / Shortened URL View | ![]() |
This project allows users to generate short URLs after logging in.
Built using Node.js + Express, UI in EJS, and database with MongoDB Atlas.
- 🔐 User Signup & Login with JWT
- 🔒 Protected routes with authentication
- 🔑 Password hashing using bcrypt
- ✂ URL shortening with unique IDs
- 📝 EJS template UI (home, login, signup)
- 📦 MongoDB Atlas + Mongoose
- 🌐 Works locally & after deployment
- 📈 Tracking redirects (optional)
- User signs up with name, email, password
- Password hashed with bcrypt
- JWT token created & stored in cookies
- Password verified
- JWT token issued
- User redirected to Home page
- User enters a long URL
- Backend generates unique ID
- Saves
{ originalUrl, shortUrl, userId }in database - Shows short link: http://localhost:5000/url/abc123
- After deployment: https://bitly.up.railway.app/url/abc123
- Visiting the short URL redirects to original link
- Implemented using
res.redirect()
- EJS Template Engine
- HTML / CSS
- Node.js
- Express.js
- JWT Authentication
- bcrypt
- Cookie-parser
- MongoDB Atlas
- Mongoose
├── controllers/
├── middlewares/
├── models/
├── routes/
├── views/
│ ├── home.ejs
│ ├── login.ejs
│ └── signup.ejs
├── public/
├── index.js
├── package.json
└── README.md
git clone https://github.com/prakashverma-dev/URL-Shortner-with-Analytics.git
cd URL-Shortner-with-Analytics
npm install
MONGO_URI=your-mongodb-atlas-url
JWT_SECRET=your-secret
PORT=5000
npm start
Pull requests are welcome!
If you like this project, give it a ⭐ on GitHub!
MIT License



