Architecture
Understand the edge/origin split, HIPAA boundaries, and multi-tenant controls.
This guide walks through cloning the monorepo, wiring your local environment, running migrations against MySQL, and making your first API calls.
| 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 |
git clone https://github.com/openinsure/openinsurecd openinsurepnpm installCopy root env:
cp .env.example .envSet these first:
| 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 |
Auth Worker:
| Variable | Description |
|---|---|
AUTH_URL | Auth Worker base URL (e.g., https://auth-dev.openinsure.dev) |
cp apps/api/.dev.vars.example apps/api/.dev.varsSet .dev.vars values to match your .env (especially API_SECRET, JWT_SECRET, and DB connection settings).
pnpm --filter @openinsure/db db:migrateThis runs the squashed bootstrap + forward Drizzle migrations against DATABASE_URL.
pnpm db:seed:ratingpnpm devCommon local endpoints:
| 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 |
For local/demo flows, exchange API_SECRET for a short-lived superadmin JWT:
curl -s -X POST http://localhost:8787/auth/demo \ -H "Content-Type: application/json" \ -d '{"secret":"'"$API_SECRET"'"}' | jq -r '.token'Export token:
export TOKEN="<paste-token>"curl -s -X POST http://localhost:8787/v1/submissions \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "insuredName": "Pacific Coast Roofing LLC", "naicsCode": "238160", "annualRevenue": 2500000, "requestedLimit": 1000000, "requestedDeductible": 5000, "effectiveDate": "2026-06-01", "expirationDate": "2027-06-01", "state": "CA", "lineOfBusiness": "GL" }' | jq '.'Architecture
Understand the edge/origin split, HIPAA boundaries, and multi-tenant controls.
API Reference
Explore the live Scalar docs and full OpenAPI coverage.
Policy Lifecycle
Review issuance, endorsements, cancellation, and renewal flows.
MGA Ops
Configure delegated authority, producer management, and bordereaux reporting.