Skip to content

Repository files navigation

🚀 Shorty — Smart URL Shortener

🔗 Turn long links into short, trackable, and shareable URLs in seconds.

👉 Live Demo: https://long-url-nu.vercel.app/signup

✨ Features

✅ Lightning-fast URL shortening ✅ Custom short URLs (/my-link) ✅ Click analytics & tracking ✅ User authentication (Login / Signup) ✅ QR code generation ✅ Link expiration ✅ Password-protected links ✅ Dashboard for analytics ✅ REST API support ✅ Mobile-friendly UI

🛠 Tech Stack

Backend

Node.js

Express.js

MongoDB + Mongoose

Others

📸 Screenshots Signup/Login Screen image

Home Dashboard Analytics image

🚀 Installation & Setup 1️⃣ Clone the repo git clone https://github.com/LackyKannauje/longUrl cd url-shortener

2️⃣ Install dependencies

Backend

cd backend npm install

3️⃣ Create .env file (backend) PORT=5000 MONGO_URI=mongodb+srv://your_db_url

4️⃣ Start the server

Backend

npm run dev

🔗 API Endpoints Shorten URL POST /api/shorten Body: { "longUrl": "https://very-long-url.com" }

Redirect GET /:shortId

Get Analytics GET /api/analytics/:shortId

📊 Example Response { "shortUrl": "https://shorty.com/abc123", "createdAt": "2025-01-16T10:00:00Z" }

🧠 How It Works

User enters a long URL

Server generates a unique short ID

Stores mapping in MongoDB

Redirects users when visiting short link

Tracks clicks & analytics

🔐 Security

Sanitized user inputs

Secure environment variables

About

A URL Shortener built with Node.js that efficiently converts long URLs into concise, shareable links. It features robust backend logic for generating unique short URLs, ensuring quick redirection to the original URLs, and offers a user-friendly API for seamless integration.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages