Prerequisites & Initial Setup
Before you begin building your SaaS application with LaunchKit, you’ll need to set up several prerequisites and external services. This guide will walk you through everything you need to get started.
System Requirements
Section titled “System Requirements”Node.js and Package Manager
Section titled “Node.js and Package Manager”- Node.js 18+ (recommended: Node.js 20+)
- Package Manager: Choose one of the following:
- Bun (recommended for best performance)
- npm (comes with Node.js)
- yarn (alternative)
Development Environment
Section titled “Development Environment”- Code Editor: VS Code, WebStorm, or your preferred editor
- Git: For version control
- Terminal: Command line access
Required External Accounts
Section titled “Required External Accounts”1. Supabase Account
Section titled “1. Supabase Account”Supabase provides your database, authentication, and storage.
Setup Steps:
- Go to supabase.com
- Sign up for a free account
- Create a new project
- Note down your project URL and API keys (we’ll use these later)
What you’ll get:
- PostgreSQL database with real-time subscriptions
- Built-in authentication with OAuth providers
- File storage for user avatars
- Row Level Security (RLS) for data protection
2. Stripe Account
Section titled “2. Stripe Account”Stripe handles all payment processing and subscription management.
Setup Steps:
- Go to stripe.com
- Create an account
- Complete account verification for production use
- Access your dashboard to get API keys
What you’ll get:
- Payment processing (one-time and subscriptions)
- Customer portal for subscription management
- Webhook endpoints for real-time payment updates
- Detailed analytics and reporting
3. Resend Account (Email Service)
Section titled “3. Resend Account (Email Service)”Resend powers all transactional emails in your SaaS.
Setup Steps:
- Go to resend.com
- Sign up for an account
- Verify your domain (or use their test domain for development)
- Generate an API key
What you’ll get:
- Transactional email delivery
- Email templates and customization
- Delivery analytics
- DKIM/SPF authentication
4. GitHub Account (Optional)
Section titled “4. GitHub Account (Optional)”Only needed if you’re selling access to private GitHub repositories.
Setup Steps:
- Ensure you have a GitHub account
- Create a Personal Access Token with repo permissions
- Set up the repositories you want to grant access to
Environment Variables Setup
Section titled “Environment Variables Setup”Create a .env
file in your project root with the following variables:
# -----------------------------------------------------------------------------
# Application
# -----------------------------------------------------------------------------
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
# -----------------------------------------------------------------------------
# Database (Supabase)
# -----------------------------------------------------------------------------
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# -----------------------------------------------------------------------------
# Payments (Stripe)
# -----------------------------------------------------------------------------
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# -----------------------------------------------------------------------------
# Email (Resend)
# -----------------------------------------------------------------------------
RESEND_API_KEY=your_resend_api_key
# -----------------------------------------------------------------------------
# GitHub (Optional)
# -----------------------------------------------------------------------------
GITHUB_TOKEN=your_github_personal_access_token
# -----------------------------------------------------------------------------
# AI Features (Optional)
# -----------------------------------------------------------------------------
ANTHROPIC_API_KEY=your_anthropic_api_key
Common Issues
Section titled “Common Issues”Node.js Version Conflicts
Section titled “Node.js Version Conflicts”If you have multiple Node.js versions, use a version manager:
- nvm (Linux/macOS):
nvm use 20
- nvs (Windows):
nvs use 20
Environment Variables Not Loading
Section titled “Environment Variables Not Loading”- Ensure
.env
is in your project root (same level aspackage.json
) - Restart your development server after adding new variables
- Don’t include spaces around the
=
sign
Supabase Connection Issues
Section titled “Supabase Connection Issues”- Verify your project URL format:
https://[project-id].supabase.co
- Check that your anon key starts with
eyJ
- Ensure your service role key has the correct permissions