A modern, production-ready waitlist system built with Next.js 15, TypeScript, and PostgreSQL. Perfect for indie hackers and startups looking to collect early user interest.
- Built-in Security: Arcjet integration for bot protection, rate limiting, and email validation
- Automated Emails: Resend integration for instant confirmation emails
- Email Verification (Optional): Enable email verification links for double opt-in
- Persistent Storage: PostgreSQL database with Drizzle ORM for reliable data storage
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- shadcn/ui - Beautiful, accessible UI components
- PostgreSQL - Robust relational database
- Drizzle ORM - Type-safe database queries
- Arcjet - Security & rate limiting
- Resend - Transactional email service
- Biome - Fast formatter and linter
- pnpm - Fast, disk space efficient package manager
This is a headless waitlist system that collects email addresses from potential users. Here's how it works:
- User Submission: Visitors enter their email on the landing page
- Security Check: Arcjet validates the email, blocks bots, and enforces rate limits
- Database Storage: Valid emails are stored in PostgreSQL with timestamps
- Email Confirmation: Resend sends an immediate welcome email
- Local Storage: Browser remembers submission to prevent duplicates
The system is designed to be production-ready with proper error handling, security measures, and scalable architecture. The waitlist component can be easily integrated into any Next.js project or used as a standalone service.
- Node.js 18+
- pnpm (recommended) or npm
- Docker (for local database)
git clone <your-repo-url>
cd waitlist-headless
pnpm install
Create a .env.local
file in the root directory:
# Database
DATABASE_URL="postgresql://ashokasec:ashokasec@localhost:5432/waitlist-db"
# Security (Get from https://console.arcjet.com)
ARCJET_KEY="your_arcjet_key"
# Email (Get from https://resend.com)
RESEND_API_KEY="your_resend_api_key"
# App
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NODE_ENV="development"
# Email Verification (Optional)
# Set to true to require users to verify their email address via a link
EMAIL_VERIFICATION=true
# JWT secret for signing email verification tokens (required if EMAIL_VERIFICATION=true)
# Must be at least 8 characters
JWT_SECRET="your_jwt_secret"
# Using Docker (recommended)
pnpm docker:up
# Or use your own PostgreSQL instance
pnpm db:push
pnpm dev
Visit http://localhost:3000
to see your waitlist in action!
components/waitlist-ui.tsx
- The main waitlist component with form handlingapp/api/submit-email/route.ts
- API endpoint for email processing and (optionally) sending verification emailsapp/_db/email-schema.ts
- Database schema for email storagelib/emails.ts
- Email templates for confirmations and verificationlib/seo.ts
- SEO and branding configuration
Search TODO: in your editor to walk through all setup steps.
- Styling: Modify
components/waitlist-ui.tsx
for custom design - Email Templates: Edit
lib/emails.ts
for branded emails and verification links - SEO: Update
lib/seo.ts
with your product details - Database: Extend
app/_db/email-schema.ts
for additional fields
- 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.
Made with ❤️ for the indie hacker community