A full-stack Linktree-style application built with Next.js, NextAuth, MongoDB Atlas, and Cloudinary.
Users can authenticate, create a unique public handle, upload a profile picture, add custom links, and manage their profile through a protected dashboard.
https://linktree-ruby-two.vercel.app
- Credentials login
- Google OAuth login
- JWT session management
- Protected routes
- Custom post-login redirect control
- Unique user handles
- Dynamic routing with
/[handle] - Handle validation
- Alphanumeric and underscore support
- Profile image upload through Cloudinary
- Client-side validation
- Secure cloud storage
- No local file storage
- Add links
- Edit links
- Delete links
- Click counter support
- Responsive dashboard
- Desktop-optimized layout
- Mobile-friendly interface
- Responsive navigation
- Overlay navbar on smaller screens
- MongoDB Atlas
- Separate
usersandlinkscollections - User-to-link relationship through
links.userId - Cloud-based database storage
User
│
▼
Authentication
│
▼
Handle Creation
│
▼
Profile Management
│
├── Profile Image ──► Cloudinary
│
└── Links ──────────► MongoDB Atlas
│
▼
Public Profile
/[handle]
Google OAuth
│
▼
/post-login
│
▼
Check User in Database
│
├── Existing User ──► /dashboard
│
└── New User ───────► /generate
- Next.js 16 (App Router)
- React
- Tailwind CSS
- React Hook Form
- React Toastify
- NextAuth
- JWT Strategy
- MongoDB Native Driver
- Cloudinary API
- Vercel
- MongoDB Atlas
- Google Cloud Console — OAuth
Authentication
│
▼
Create Handle
│
▼
Configure Profile
│
├── Upload Profile Image
│
└── Add Custom Links
│
▼
Protected Dashboard
│
▼
Public Profile
/[handle]
Create a .env.local file for local development:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_secret_here
MONGODB_URI=your_mongodb_connection_string
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretFor production, configure the same environment variables through the Vercel project settings.
git clone https://github.com/Developer-Sohail786/linktree_.git
cd linktree_npm installCreate:
.env.local
Add the required environment variables listed above.
npm run devThe application will be available at:
http://localhost:3000
- Drag-and-drop link reordering
- Analytics dashboard
- Theme customization
- Custom domain support
- Premium plan system
Sohail Khan
Full-Stack Developer | Next.js | Backend | AI
This project is licensed under the MIT License.