> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revcenter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run Revcenter locally against a real Postgres database

## Prerequisites

* Node.js and [pnpm](https://pnpm.io)
* [Docker](https://www.docker.com/) — the local Supabase stack runs in containers
* [Supabase CLI](https://supabase.com/docs/guides/cli) (`brew install supabase/tap/supabase`)

## 1. Install dependencies

```bash theme={null}
pnpm install
```

## 2. Start the local database

This spins up a real local Postgres, Storage, and a local email testbed (Mailpit) — the
same stack used in production, running on your machine.

```bash theme={null}
supabase start
```

The first run pulls several Docker images and can take a few minutes. When it finishes it
prints connection details, including `DB_URL`, `ANON_KEY`, and `SERVICE_ROLE_KEY` — you'll
need these for the next step.

## 3. Configure environment variables

```bash theme={null}
cp .env.example .env.local
```

Fill in `.env.local` with the values from `supabase start`'s output for the Supabase
block, plus:

<ParamField path="BETTER_AUTH_SECRET" type="string" required>
  32+ random characters. Generate one with `openssl rand -base64 32`.
</ParamField>

<ParamField path="CREDENTIAL_ENCRYPTION_KEY" type="string" required>
  A 32-byte base64 key used to encrypt API keys saved through the Credentials page.
  Generate one with `openssl rand -base64 32`.
</ParamField>

<ParamField path="COOKIE_DOMAIN" type="string" default="localhost">
  Leave as `localhost` for local development.
</ParamField>

Harvest, Serper, Anthropic, and Trigger.dev keys are also required by the env schema
(`lib/env.ts`) but only need to be *present* to boot — see
[API Keys](/guides/api-keys) for how to add real ones once the app is running, without
touching `.env.local` again.

## 4. Apply the database schema

```bash theme={null}
supabase db reset
```

This runs every migration in `supabase/migrations/` against your local database,
including the auth schema, scoring functions, and row-level security policies.

## 5. Start the app

```bash theme={null}
pnpm dev
```

`predev` runs a boot-validation script first (`scripts/verify.ts`) that checks your
environment variables, confirms the database schema is live, and pings dependent
services — if something's misconfigured, you'll see exactly what before the server even
starts.

Visit the printed URL (usually `http://localhost:3000`, or the next open port), sign up
for an account, and you'll land on the calibrate screen.

## Verifying everything works

```bash theme={null}
pnpm build          # production build + typecheck
pnpm lint            # eslint
supabase test db     # pgTAP: confirms RLS actually blocks unauthenticated access
```
