Quickstart (in 5 mins)
Get your BetterStarter project running locally in under 5 minutes.
Prerequisites
- Node.js 22+ installed
- pnpm package manager installed
- Bun, npm and yarn are also supported
- A PostgreSQL database (local or cloud)
- Postgres App for local development
- Supabase for cloud development (I use)
Quickstart
- Clone the repo
git clone https://github.com/azizali/betterstarter.gitcd betterstarter
- Install dependencies
pnpm install cp .env.sample .env.local- 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/)
-
Create a new database called
betterstarter(or any name you prefer) -
Your connection string will be:
postgres://your_user:your_password@localhost:5432/betterstarterEnter the connection string in .env.local:
DATABASE_URL=postgres://your_user:your_password@localhost:5432/betterstarterOption B: Supabase
- Create a free project at supabase.com
- Click "Connect" on the header
- Click ORMs -> Drizzle
- 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_here2.1 Setup the db
pnpm db:generatepnpm 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 secretThe 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.