Prerequisites
| Tool | Version | Install |
|---|---|---|
| Node.js | 20+ (LTS) | nodejs.org or nvm install 20 |
| pnpm | 10+ | npm install -g pnpm@10 |
| Wrangler CLI | 4+ | npm install -g wrangler |
| MySQL | 8.0+ (Vitess) | PlanetScale or local MySQL |
DATABASE_URL to any
reachable MySQL instance (PlanetScale branch or local MySQL).
:::
Step 1 — Clone and Install
Step 2 — Configure Environment Variables
Copy root env:| Variable | Description |
|---|---|
DATABASE_URL | PlanetScale URL used by Drizzle migrations |
JWT_SECRET | API JWT signing secret |
API_SECRET | System bearer secret (machine/demo flows) |
SERVICE_SECRET | Service token exchange secret |
PORTAL_SECRET | Producer portal token exchange secret |
ADMIN_SECRET | Admin token exchange secret |
CLOUDFLARE_ACCOUNT_ID / CLOUDFLARE_API_TOKEN | Required for Wrangler and deploy tooling |
| Variable | Description |
|---|---|
AUTH_URL | Auth Worker base URL (e.g., https://auth-dev.openinsure.dev) |
Step 3 — Configure API Worker Vars
.dev.vars values to match your .env (especially API_SECRET, JWT_SECRET, and DB connection settings).
Step 4 — Apply Database Migrations
DATABASE_URL.
Step 5 — Seed Base Rating Data (Optional but Recommended)
Step 6 — Start the Stack
| App | URL |
|---|---|
| API Worker | http://localhost:8787 |
| Underwriting App | http://localhost:3000 |
| Producer Portal | http://localhost:3001 |
| Admin | http://localhost:3002 |
| Policyholder Portal | http://localhost:3003 |
| Astro Docs | http://localhost:4321 |
Step 7 — Get an API JWT
For local/demo flows, exchangeAPI_SECRET for a short-lived superadmin JWT: