Local Development

Set up your development environment with all tools and services needed to run locally.

Prerequisites

Install pnpm

npm install -g pnpm

Setup

1. Clone & Install

git clone https://github.com/your-username/your-repo.git
cd your-repo
pnpm install
cp .env.example .env

2. Start Database

chmod +x start-database.sh
./start-database.sh

Creates a PostgreSQL container and generates a secure password.

3. Initialize Schema

pnpm db:generate
pnpm db:push

Configure Services

Auth Secret

openssl rand -base64 32
.env
AUTH_SECRET="your-generated-secret"

Google OAuth

  1. 1. Go to Google Cloud Console
  2. 2. Create OAuth credentials (Web Application)
  3. 3. Add origin: http://localhost:3000
  4. 4. Add redirect: http://localhost:3000/api/auth/callback/google
.env
AUTH_GOOGLE_ID="your-client-id.googleusercontent.com"
AUTH_GOOGLE_SECRET="your-client-secret"

Stripe (Test Mode)

Get test keys from Stripe Dashboard. Create products and copy price IDs.

.env
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_PRICE_PRO_MONTHLY="price_..."
STRIPE_PRICE_PRO_YEARLY="price_..."
STRIPE_PRICE_ULTRA_MONTHLY="price_..."
STRIPE_PRICE_ULTRA_YEARLY="price_..."

Use test card 4242 4242 4242 4242 for testing.

Resend Email

Get API key from Resend.

.env
AUTH_RESEND_KEY="re_..."
EMAIL_FROM="noreply@yourdomain.com"

Start Development

pnpm dev

Visit http://localhost:3000

Next: Production Deployment

Deploy to Vercel with Neon PostgreSQL

Continue →