Getting Started
Clone the repo, configure environment variables, and run the app locally in under ten minutes.
This guide gets you from zero to a running local instance of the template. You'll configure your database, auth provider, and billing keys, then boot the dev server.
Prerequisites
- Node.js 20+ (LTS)
- pnpm 9+ (
npm i -g pnpm) - A Neon account (free tier works)
- A Stripe account in test mode
1. Clone the repository
git clone https://github.com/YOUR_ORG/YOUR_REPO.git my-app
cd my-app
pnpm install
2. Environment variables
Copy the example file and fill in each value:
cp .env.example .env.local
Required variables
| Variable | Description |
|----------|-------------|
| DATABASE_URL | Neon admin/BYPASSRLS connection string (with pgbouncer pooling) |
| DATABASE_AUTHENTICATED_URL | Neon authenticated role connection string — RLS enforced |
| NEON_AUTH_COOKIE_SECRET | 32+ char secret — run openssl rand -base64 32 |
| NEXT_PUBLIC_APP_URL | Full URL of the app, e.g. http://localhost:3000 |
Optional — Stripe billing
| Variable | Description |
|----------|-------------|
| STRIPE_SECRET_KEY | Secret key from Stripe dashboard (starts sk_test_) |
| STRIPE_WEBHOOK_SECRET | Webhook signing secret (whsec_…) |
| NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Publishable key (pk_test_…) |
Optional — email
| Variable | Description |
|----------|-------------|
| RESEND_API_KEY | API key from Resend dashboard |
| EMAIL_FROM | Sender address, e.g. noreply@example.com |
3. Database setup
Push the Drizzle schema to your Neon database:
pnpm db:migrate
This applies all pending migrations in drizzle/ and creates the initial tables.
4. Start the dev server
pnpm dev
Open http://localhost:3000. You should see the marketing homepage. Navigate to http://localhost:3000/signup to create your first account.
5. Verify billing (optional)
Install the Stripe CLI and forward webhooks to your local server:
stripe listen --forward-to localhost:3000/api/webhooks/stripe
Copy the webhook signing secret printed by the CLI into STRIPE_WEBHOOK_SECRET in .env.local.
Troubleshooting
DATABASE_URL connection refused — Ensure you're using the pooled connection string from Neon (includes ?sslmode=require&pgbouncer=true).
Auth errors on signup — Double-check NEON_AUTH_COOKIE_SECRET is set and at least 32 characters. The secret must be identical across all instances (dev + production).
Stripe webhooks not firing — The Stripe CLI must be running in a separate terminal. Check that STRIPE_WEBHOOK_SECRET matches the CLI output exactly.
Next steps
- Configuration — feature flags, tenancy mode, and brand settings