A simple URL shortener web application built with Next.js, MongoDB, and NextAuth for authentication.
- Shorten long URLs into short, easy-to-share links.
- User authentication with NextAuth.
- Dashboard to manage shortened URLs.
- Click tracking and analytics.
- Frontend: Next.js (App Router)
- Backend: API Routes in Next.js
- Database: MongoDB
- Authentication: NextAuth
- Styling: Tailwind CSS
- Hosting: Vercel
- Node.js (>= 16)
- MongoDB (local or Atlas)
-
Clone the repository:
git clone https://github.com/dharmik173/url_shortener1.git cd url-shortener -
Install dependencies:
npm install
-
Set up environment variables in a
.env.localfile:NEXT_PUBLIC_BASE_URL='' GOOGLE_CLIENT_ID='' GOOGLE_CLIENT_SECRET='' NEXTAUTH_SECRET='' JWT_SECRET='' MONGODB_URI='' NEXTAUTH_URL='' NEXTAUTH_URL_INTERNAL=''
-
Start the development server:
npm run dev
The application will be running on
http://localhost:3000
- Sign in using the authentication method set up in NextAuth.
- Enter a long URL and generate a short link.
- Access the dashboard to manage your shortened URLs.
- Share the short link and track its usage.
- Add custom alias support.
- Implement QR code generation.
- Improve analytics for link tracking.
- Enhance UI/UX.
Developed by Dharmik Shah.