Development Guide - PreLaunch Next.js Template
Complete development documentation for PreLaunch Next.js landing page template. Learn about Supabase setup, authentication, payment integration, and deployment.
Prerequisite: Please install Node.js (version 16 or higher) and npm, yarn, or pnpm. For basic setup steps, refer to the Quick Start guide.
Technology Stack
PreLaunch is built with the following core technologies:
- Frontend Framework: Next.js 14 (App Router)
- UI Frameworks: Tailwind CSS, DaisyUI, Radix UI
- State Management: React Hooks
- Form Handling: React Hook Form + Zod
- Database: Supabase (PostgreSQL)
- Authentication: NextAuth.js
- Payment Processing: Paddle
Supabase Database Configuration
PreLaunch uses Supabase as the primary database for storing users, products, and subscription data.
Setting Up Supabase
- Create a Supabase account
- Create a new project
- Note down the URL and anonymous key, add them to your
.env.local
file:
Core Database Tables
PreLaunch requires the following core tables:
Waitlist Table
Paddle Customers Table
Subscriptions Table
Using Supabase Client
PreLaunch includes preconfigured clients for interacting with Supabase:
Authentication Configuration
PreLaunch uses NextAuth.js for user authentication. The configuration is in the libs/next-auth.ts
file.
Multiple authentication methods are supported:
- Email/password authentication
- Google OAuth
- GitHub OAuth
Payment Integration Details
Paddle Integration
For Paddle integration, PreLaunch includes:
- Webhook handling in the
/api/webhooks/paddle
endpoint - Client-side checkout components in
components/checkout
- Server-side API helpers in
libs/paddle
For more about Paddle configuration, see the Payment Integration guide.
Typeform Integration
PreLaunch integrates Typeform for user voting and suggestion collection:
- The embedded forms are available through
@typeform/embed-react
- The forms are integrated in
components/landing/suggestion-form.tsx
andcomponents/landing/vote-form.tsx
Advanced Project Structure
Troubleshooting
Next.js Hot Reload Not Working
Next.js Hot Reload Not Working
Try clearing the .next
folder and restarting the development server:
Supabase Connection Errors
Supabase Connection Errors
Check that your Supabase URL and key are correct. Make sure your IP address is not blocked by Supabase and that the database tables are correctly created.
Authentication Issues
Authentication Issues
If authentication is not working, check the NextAuth.js configuration and ensure all necessary environment variables are set correctly.
Common Development Tasks
Adding a New Page
Add a new directory and page component in the app
directory:
Working with the Database
For adding a new table to Supabase, you’ll need to:
- Create the table in the Supabase dashboard or using SQL
- Define TypeScript types in the
types
directory - Create helper functions in
libs/supabase
for common operations