Complete Setup Guide
This guide walks through the full setup including payments and email.Time estimate: 10-15 minutes for basic setup, 30 minutes with Stripe and Resend fully configured.
Prerequisites
Node.js 18+
Check with
node -v. Download Node.jspnpm or npm
Package manager for dependencies
Supabase Account
Free tier works. Create account
Stripe Account
Test mode for development. Sign up
Installation
Configure Supabase
Create a Supabase project
- Go to supabase.com/dashboard
- Click New Project
- Choose organization, name, password, and region
- Wait for project to initialize (~2 minutes)
Get your API keys
Go to Settings → API and copy:
| Key | Environment Variable |
|---|---|
| Project URL | NEXT_PUBLIC_SUPABASE_URL |
anon public key | NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY |
service_role key | SUPABASE_SECRET_KEY |
Configure Auth URLs
Go to Authentication → URL Configuration:
| Setting | Value |
|---|---|
| Site URL | http://localhost:3000 |
| Redirect URLs | http://localhost:3000/auth/callback |
Configure Stripe (Optional)
Skip this section if you want to run the app without payments first.
Get API keys
Go to Stripe Dashboard and copy:
| Key | Environment Variable |
|---|---|
| Publishable key | NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY |
| Secret key | STRIPE_SECRET_KEY |
Create products and prices
- Go to Products in Stripe Dashboard
- Create products for Standard and Ultimate plans
- Set prices (one-time for lifetime access)
- Copy Price IDs (start with
price_)
.env.local:Configure Resend (Optional)
Get API key
- Sign up at resend.com
- Go to API Keys and create one
- Add to
.env.local:
Your .env.local File
Here’s a complete example with all variables:Run the App
Open in browser
Navigate to http://localhost:3000
You should see the marketing homepage with hero, pricing, and footer.
Verify Everything Works
| Feature | How to Test |
|---|---|
| Marketing pages | Visit /, /pricing |
| Authentication | Sign up, sign in, sign out at /sign-up, /sign-in |
| Dashboard | Access /dashboard after signing in |
| Payments | Click pricing button, complete Stripe checkout (test mode) |
| Blog | Visit /blog to see MDX content |
Common Issues
Auth redirect fails
Auth redirect fails
Check Supabase URL Configuration:
- Site URL:
http://localhost:3000(exact match) - Redirect URLs: includes
http://localhost:3000/auth/callback - Not using
127.0.0.1(uselocalhostinstead)
Stripe webhook errors
Stripe webhook errors
Ensure webhook listener is running:
bash stripe listen --forward-to localhost:3000/api/webhooks/stripe - Copy the whsec_... secret each time
you restart - Listener must be running when testing checkoutDatabase tables missing
Database tables missing
Run migrations:
bash npx supabase db push Or manually run SQL from
supabase/migrations/ in Supabase SQL Editor.Environment variables not loading
Environment variables not loading
- Restart dev server after changing
.env.local NEXT_PUBLIC_prefix required for client-side variables- No spaces around
=in env file