BetterStarter logoBetterStarter
Getting Started

Quickstart (in 5 mins)

Get your BetterStarter project running locally in under 5 minutes.

Prerequisites

  1. Node.js 22+ installed
  2. pnpm package manager installed
    • Bun, npm and yarn are also supported
  3. A PostgreSQL database (local or cloud)
    • Postgres App for local development
    • Supabase for cloud development (I use)
      • Free tier is sufficient for local development and small projects
      • Neon, Railway, Render are also great options

Quickstart

  1. Clone the repo
  • git clone https://github.com/azizali/betterstarter.git
  • cd betterstarter
  1. Install dependencies pnpm install
  2. cp .env.sample .env.local
  3. Start pnpm dev

Boom 🎉 You have a running project at http://localhost:3000.

2. Database Setup

BetterStarter uses PostgreSQL with Drizzle ORM. You can use any PostgreSQL provider.

Option A: Local PostgreSQL

If you have PostgreSQL installed locally (I use Postgres.app) and PgAdmin4 (https://www.pgadmin.org/download/)

  1. Create a new database called betterstarter (or any name you prefer)

  2. Your connection string will be:

postgres://your_user:your_password@localhost:5432/betterstarter

Enter the connection string in .env.local:

DATABASE_URL=postgres://your_user:your_password@localhost:5432/betterstarter

Option B: Supabase

  1. Create a free project at supabase.com
  2. Click "Connect" on the header
  3. Click ORMs -> Drizzle
  4. Copy the Connection string (URI format)

Enter the connection string in .env.local:

DATABASE_URL="postgresql://postgres.[YOUR-PROJECT-ID]:[YOUR-PASSWORD]@aws-1-us-east-1.pooler.supabase.com:6543/postgres"

Option C: Other Cloud Providers

Any PostgreSQL-compatible provider works. Popular options include

Just grab the connection string from your provider's dashboard and put it in .env.local:

DATABASE_URL=your_connection_string_here

2.1 Setup the db

  1. pnpm db:generate
  2. pnpm db:migrate

3. Configure Environment Variables

Open .env.local and update the following required variables:

# Your app URL (default for local dev)
APP_BASE_URL=http://localhost:3000

# PostgreSQL connection string from step 2
DATABASE_URL=postgres://your_user:your_password@localhost:5432/betterstarter

# Auth (must match APP_BASE_URL)
BETTER_AUTH_URL=http://localhost:3000
BETTER_AUTH_SECRET=npx @better-auth/cli secret

The remaining variables (Login with Google, Payments with Stripe, Email with Plunk) are optional for initial setup. See the dedicated guides for each feature.

Alternatively, you can use pnpm db:generate followed by pnpm db:migrate for a migration-based workflow.

Your app is now running at http://localhost:3000.

Next Steps

On this page