Skip to content

Quick Start

This page takes you from a fresh install to a running local app.

  1. Copy the example file:

    Terminal window
    cp .env.example .env
  2. Open .env and set the required values:

    Terminal window
    # App
    NUXT_PUBLIC_APP_NAME=My SaaS
    NUXT_PUBLIC_SITE_URL=http://localhost:3000
    # Database
    DATABASE_URL=postgresql://postgres:postgres@localhost:5432/core-b2b
    # Auth — generate a secret with: openssl rand -base64 32
    BETTER_AUTH_SECRET=your-random-secret-here
    BETTER_AUTH_URL=http://localhost:3000

Apply the schema to your PostgreSQL database:

Terminal window
pnpm db:migrate

This uses Drizzle Kit to run all pending migrations from server/database/migrations/.

Terminal window
pnpm dev

Open http://localhost:3000 in your browser.

After the app starts, check these basics:

  1. Homepage loads — you should see the landing page at /
  2. Register an account — go to /register and create a user
  3. Dashboard works — after login, you land on /dashboard
  4. Organization created — a default organization is created on first login

If you configured the corresponding environment variables:

FeatureWhat to check
StripeGo to /pricing and verify the checkout button works
EmailCheck .tmp/email-previews/ for the verification email HTML
AIOpen /ai/chat in the dashboard and send a message
AdminSet INITIAL_ADMIN_EMAIL to your email, restart, then visit /admin

To access the admin panel at /admin, set the env var and restart:

Terminal window
INITIAL_ADMIN_EMAIL=your-email@example.com

The app auto-grants the platform_admin role to this email on startup. The user must register first. This is idempotent — safe to leave set.

Alternatively, use the script:

Terminal window
pnpm admin:grant-platform-admin -- you@example.com

Your app is running locally. Continue to Local Development to learn about the daily development workflow, email testing, and Stripe CLI setup.