Documentation

Environment Setup

Configure server .env from .env.example and connect Supabase.

Environment Setup (Server)

Create your .env file

# From repo root
cp apps/server/.env.example apps/server/.env

Server .env variables

Use the following as a reference for the server environment. Copy from .env.example and fill the values.

# Server Configuration
CORS_ORIGIN=http://localhost:3001
BETTER_AUTH_URL=http://localhost:3000

# Authentication
BETTER_AUTH_SECRET=your_32_character_random_secret_here

# Database (Required)
# Get these from your Supabase project settings
DATABASE_URL=
DIRECT_URL=

# Google OAuth (Optional - for social login)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# Email providers (Optional)
PLUNK_API_KEY=
RESEND_API_KEY=

# Apple Auth (Optional)
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_APP_BUNDLE_IDENTIFIER=

Get database URL from Supabase

  1. Create a new project at the Supabase dashboard
  2. During creation, generate and copy your database password (store it securely)
  3. After the project is created, click the "Connect" button in the Database section
  4. You will see a connection info screen similar to the one below

Supabase Connect Screen

Copy the connection strings into your .env file:

  • DATABASE_URL → main connection string
  • DIRECT_URL → direct connection string for migrations

Verify configuration

# From repo root
pnpm run db:generate
pnpm run db:push  # dev only

If commands succeed, your environment variables are configured correctly.