One URL for all your links - An open-source alternative to Linktree. Create a beautiful profile page to share all your important links in one place.
- Google OAuth Authentication - Secure and seamless sign-in with your existing Google account
- Custom Profile Pages - Create personalized profile pages with your unique username
- Link Management - Add, edit, and reorganize your links effortlessly
- Deep Analytics - Track clicks and view detailed insights about your audience engagement
- Avatar Upload - Upload and customize your profile picture with drag-and-drop support
- Responsive Design - Your profile looks perfect on every device
- Fast & Modern - Built with Next.js 16 and React 19 for instant page loads
- Framework: Next.js 16 (App Router)
- Backend: Express.js (separate service for link previews)
- Language: TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: Better Auth
- File Upload: UploadThing + React Dropzone
- State Management: TanStack Query (React Query)
- Styling: Tailwind CSS
- UI Components: Base UI React
- Charts: Recharts
Before you begin, ensure you have:
- Node.js 20+ or Bun installed
- PostgreSQL database (local or cloud like Neon)
- Google OAuth credentials
- UploadThing account (free tier available)
git clone https://github.com/KartikLabhshetwar/oneurl.git
cd oneurlbun install
# or
npm installCreate a .env file in the root directory:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/oneurl"
# Better Auth
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# UploadThing - for file uploads
UPLOADTHING_TOKEN="your-uploadthing-token"
# Backend Service
# Development: http://localhost:3001
# Production: https://api.oneurl.live
BACKEND_URL="http://localhost:3001"Note: UploadThing is optional. If not configured, you can still use the app but avatar uploads won't work. Sign up at uploadthing.com to get your credentials.
# Generate Prisma Client
bun prisma generate
# Run migrations
bun prisma migrate devThe backend service handles link preview metadata fetching. Create a .env file in the backend directory:
PORT=3001
FRONTEND_URL=http://localhost:3000
NODE_ENV=developmentInstall backend dependencies:
cd backend
bun install
cd ..Option 1: Run both services together
bun run dev:allOption 2: Run separately
# Terminal 1 - Frontend
bun run dev
# Terminal 2 - Backend
bun run dev:backendOpen http://localhost:3000 in your browser. The backend service runs on http://localhost:3001.
oneurl/
├── app/ # Next.js app directory
│ ├── (auth)/ # Authentication routes (login, signup)
│ ├── (dashboard)/ # Dashboard routes (protected)
│ ├── (onboarding)/ # Onboarding flow
│ ├── [username]/ # Public profile pages
│ └── api/ # API routes
├── backend/ # Express backend service
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Rate limiting, validation, error handling
│ │ └── utils/ # Metadata fetching utilities
│ └── package.json # Backend dependencies
├── components/ # React components
│ ├── landing/ # Landing page components
│ └── ui/ # UI component library
├── hooks/ # Custom React hooks
├── lib/ # Utility functions and services
│ ├── generated/ # Generated Prisma client
│ ├── hooks/ # Custom hooks
│ ├── services/ # Business logic services
│ └── validations/ # Zod schemas
├── prisma/ # Prisma schema and migrations
└── public/ # Static assets
Frontend:
bun run dev- Start Next.js development serverbun run build- Build for productionbun run start- Start production serverbun run lint- Run ESLint
Backend:
bun run dev:backend- Start backend development serverbun run build:backend- Build backend for productionbun run start:backend- Start backend production server
Both:
bun run dev:all- Run both frontend and backend in development mode
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google - Copy Client ID and Client Secret to
.env
UploadThing is used for secure file uploads (avatars). To enable avatar uploads:
- Sign up at uploadthing.com (free tier available)
- Create a new app
- Copy your
UPLOADTHING_TOKEN - Add them to your
.envfile
The app will work without UploadThing, but avatar upload functionality will be disabled.
- Sign In - Click "Sign In" and authenticate with Google
- Onboarding - Complete the onboarding flow:
- Choose a username
- Upload an avatar (optional)
- Add your links
- Preview your profile
- Dashboard - Manage your profile, links, and view analytics
- Share - Your profile is available at
oneurl.live/yourusername
- Push your code to GitHub
- Import your repository to Vercel
- Add all environment variables in Vercel dashboard:
DATABASE_URLBETTER_AUTH_SECRETBETTER_AUTH_URL(your production URL)GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETUPLOADTHING_TOKEN(if using file uploads)
- Deploy!
For production, use a managed PostgreSQL service like:
Update your DATABASE_URL in the deployment environment variables.
Frontend:
- Set up production database
- Configure Google OAuth with production redirect URI (
https://oneurl.live/api/auth/callback/google) - Set
BETTER_AUTH_URLtohttps://oneurl.live - Set
BACKEND_URLtohttps://api.oneurl.live - Configure UploadThing with production domain (if using)
- Update
next.config.tsimage domains if needed - Test all features in production environment
Backend:
- Deploy backend service (Railway, Render, Fly.io, etc.)
- Set
FRONTEND_URLtohttps://oneurl.live - Set
NODE_ENVtoproduction - Configure DNS: Point
api.oneurl.liveto backend service - Test backend health endpoint:
https://api.oneurl.live/health - Verify CORS allows requests from
oneurl.live
Contributions are welcome! Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
Quick start:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For detailed guidelines, see CONTRIBUTING.md.
This project is licensed under the MIT License - see the LICENSE file for details.
Made by Kartik Labhshetwar