This project is a URL Shortener and QR Code Generator web application that allows users to shorten URLs, generate dynamic QR codes, and track analytics for the links. It also includes a custom authentication system with OAuth 2.0 integration, allowing users to sign in securely with Google, GitHub, and email.
- URL Shortening: Shorten any URL to share it easily.
- Custom Branded URLs: Shorten links with your brand's domain.
- Dynamic QR Code Generation: Generate and manage QR codes that can be updated anytime.
- Advanced Link Analytics: Track clicks, devices, locations, and more.
- Password Protection: Secure your shortened links with passwords.
- Link Expiration: Set expiration dates for your short URLs.
- Bulk URL Shortening: Shorten multiple URLs at once.
- API Access: Integrate URL shortening functionality into other apps.
- OAuth 2.0 Authentication: Custom authentication with OAuth 2.0.
- Google Sign-In
- Email and Password Sign-In
- Two-Factor Authentication (2FA) for added security.
- Frontend: React, Shadcn ui, Next.js
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: Custom authentication using OAuth 2.0 with Google, and Email Sign-In.
- QR Code Generation:
qrcode
npm package - Link Analytics: Custom analytics tracking
To get started with the project locally, follow these steps:
git clone https://github.com/aminurjs/url-shortener.git
cd url-shortener
For both the frontend (Next.js) and backend (Node.js), install the required dependencies.
# Install all dependencies
npm run install:all
Create .env
files for both frontend and backend. Fill all the field according to .env.example
:
To run both frontend and backend servers:
# Run frontend (Next.js) and backend (Node.js)
npm run dev
Visit the frontend in your browser at http://localhost:3000
to access the application.
-
Sign Up / Sign In:
- Sign up with Google, GitHub, or email/password.
-
Shorten URL:
- Enter a long URL and click Shorten to generate a short link.
-
Generate QR Code:
- For any shortened URL, generate a dynamic QR code.
-
Analytics:
- Track the performance of your links including clicks, devices, and locations.
-
Manage Links:
- Edit, delete, or set expiration dates for your shortened links.
- OAuth 2.0: For secure authentication.
- Lucide Icons: For beautiful and customizable icons.
- Tailwind CSS: For styling the frontend.
- Shadcn UI: For for component.
- MongoDB: For storing user data and link information.
- QR Code Package: For generating QR codes.