Mini-URL is a lightweight and efficient URL shortener built using Node.js, Express, MongoDB, and Tailwind CSS (Flowbite). It provides a seamless way to shorten long URLs and store them in a MongoDB database for future access.
✅ Shorten long URLs quickly ✅ Store & retrieve shortened URLs from MongoDB ✅ Open and copy shortened links easily ✅ Dynamic domain adaptation (works with localhost & deployed URLs) ✅ Responsive UI built with Tailwind CSS & Flowbite
- Backend: Node.js, Express.js, MongoDB
- Frontend: HTML, Tailwind CSS (Flowbite), JavaScript
- Database: MongoDB
- Containerization: Docker (yet to)
git clone https://github.com/yourusername/mini-url.git
cd mini-url
npm install
Make sure MongoDB is running locally or use MongoDB Atlas. Update your .env
file with:
MONGO_URI=mongodb://0.0.0.0/mini-url
npm start
Your app will be live at http://localhost:3000 🚀
- Use Render or Vercel for easy deployment.
- Set up environment variables (
MONGO_URI
) in the dashboard.
1️⃣ Enter a long URL in the input field. 2️⃣ Click Shorten to generate a short URL. 3️⃣ The shortened URL appears in the table below. 4️⃣ Click Open to visit the link or Copy to copy it.
POST /shorten
Request Body:
{ "url": "https://example.com" }
Response:
{ "shortUrl": "http://yourdomain.com/abc123" }
GET /:shortId
Example: GET /abc123
→ Redirects to https://example.com
GET /links
Feel free to fork the repo, create a feature branch, and submit a pull request!
This project is licensed under the MIT License.
Open an issue or start a discussion in the repo!
Enjoy shortening URLs with Mini-URL! 🚀