Skip to content

URL shortener with QR Code generation, built with Next.js (frontend), Express (backend) and MongoDB. Configurable domain via .env. Also captures Open Graph metadata from the original URL for rich previews.

License

Notifications You must be signed in to change notification settings

matheusleiner/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 URL Shortener + QR Code Generator

Axios Cheerio CORS Dotenv Express Fetch API Fontawesome MongoDB Mongoose Next.js Node.js qrcode.react React Hot Toast TailwindCSS ts-node TypeScript

A free, open-source, no-login URL shortener with QR code generation. Built with Next.js + TypeScript on the frontend, Express + TypeScript on the backend, and MongoDB for data storage.

🚀 Features

  • 🔒 No authentication required
  • 🧠 Avoids duplicate entries: already-shortened URLs are reused
  • 🔁 Prevents shortening an already-shortened URL (loop protection)
  • ⚙️ Domain can be changed easily via .env (no code changes needed)
  • 🖼️ Extracts Open Graph metadata from original URL
  • 📦 Fully open-source and ready for deployment

📦 Getting Started

1. Clone the repository

git clone https://github.com/matheusleiner/url-shortener.git
cd url-shortener

2. Install dependencies

# Install frontend and backend dependencies
cd frontend && npm install
cd ../backend && npm install

3. Set up environment variables

Create a .env file in both frontend/ and backend/ folders:

Example .env (backend)

PORT=3001
MONGODB_URI=your_mongodb_connection_string
FRONTEND_URL=https://yourdomain.com

Example .env (frontend)

NEXT_PUBLIC_API_URL=https://api.yourdomain.com

4. Run the project

# In two terminals:
cd backend && npm run dev
cd frontend && npm run dev

🧑‍💻 Contributing

Pull requests are welcome! Feel free to open issues or suggest features.

📄 License

This project is licensed under the MIT License.

About

URL shortener with QR Code generation, built with Next.js (frontend), Express (backend) and MongoDB. Configurable domain via .env. Also captures Open Graph metadata from the original URL for rich previews.

Resources

License

Stars

Watchers

Forks