A modern, feature-rich URL shortener built with Next.js 14, offering custom domains, advanced analytics, and premium features for businesses and professionals.
- Create custom short links
- Password protection for links
- Link expiration dates
- Basic analytics (clicks, countries, referrers)
- Branded short links with zyppd.cc domain
- Custom domains (use your own domain)
- Advanced analytics with detailed charts
- Unlimited links
- API access
- Priority support
- Node.js 18+
- PostgreSQL database
- Google OAuth App (for authentication)
-
Clone the repository
git clone https://github.com/rishikesh-suvarna/zyppd.git cd zyppd -
Install dependencies
npm install
-
Setup environment variables
cp .env.example .env
Fill in your environment variables:
# Database DATABASE_URL="postgresql://username:password@localhost:5432/zyppd" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-secret-key" # Google OAuth GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # App NEXT_PUBLIC_BASE_URL="http://localhost:3000"
-
Setup database
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
-
Open your browser Visit http://localhost:3000
- Framework: Next.js 14 (App Router)
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js (Google)
- Styling: Tailwind CSS
- Icons: Lucide React
- Language: TypeScript
- Sign in with your Google account
- Go to the Dashboard
- Click "Create New Link"
- Enter your URL and optional settings:
- Custom short code
- Password protection
- Expiration date
- Title and description
View detailed analytics for your links:
- Click statistics over time
- Geographic data (countries)
- Referrer information
- Device and browser data
- Upgrade to Premium
- Go to Settings → Custom Domains
- Add your domain
- Follow DNS setup instructions
- Use your domain for short links
All API endpoints require authentication via NextAuth session.
POST /api/links
Content-Type: application/json
{
"originalUrl": "https://example.com",
"shortCode": "my-link",
"title": "My Link",
"password": "secret123",
"expiresAt": "2024-12-31T23:59:59.000Z"
}GET /api/links?page=1&limit=10&search=exampleGET /api/links/{linkId}/analytics| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | ✅ |
NEXTAUTH_URL |
Your app URL | ✅ |
NEXTAUTH_SECRET |
NextAuth secret key | ✅ |
GOOGLE_CLIENT_ID |
Google OAuth Client ID | ✅ |
GOOGLE_CLIENT_SECRET |
Google OAuth Client Secret | ✅ |
NEXT_PUBLIC_BASE_URL |
Public app URL | ✅ |
zyppd/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ ├── dashboard/ # Dashboard pages
│ └── [shortCode]/ # Dynamic redirect pages
├── components/ # React components
├── lib/ # Utility functions
├── prisma/ # Database schema
└── public/ # Static assets
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- 📧 Email: rishikeshsuvarna@gmail.com
- 🐛 Issues: GitHub Issues
