Skip to content

Quickstart Guide

This guide walks through cloning the monorepo, wiring your local environment, running migrations against MySQL, and making your first API calls.

ToolVersionInstall
Node.js20+ (LTS)nodejs.org or nvm install 20
pnpm10+npm install -g pnpm@10
Wrangler CLI4+npm install -g wrangler
MySQL8.0+ (Vitess)PlanetScale or local MySQL
Terminal window
git clone https://github.com/openinsure/openinsure
cd openinsure
pnpm install

Step 2 — Configure Environment Variables

Section titled “Step 2 — Configure Environment Variables”

Copy root env:

Terminal window
cp .env.example .env

Set these first:

VariableDescription
DATABASE_URLPlanetScale URL used by Drizzle migrations
JWT_SECRETAPI JWT signing secret
API_SECRETSystem bearer secret (machine/demo flows)
SERVICE_SECRETService token exchange secret
PORTAL_SECRETProducer portal token exchange secret
ADMIN_SECRETAdmin token exchange secret
CLOUDFLARE_ACCOUNT_ID / CLOUDFLARE_API_TOKENRequired for Wrangler and deploy tooling

Auth Worker:

VariableDescription
AUTH_URLAuth Worker base URL (e.g., https://auth-dev.openinsure.dev)
Terminal window
cp apps/api/.dev.vars.example apps/api/.dev.vars

Set .dev.vars values to match your .env (especially API_SECRET, JWT_SECRET, and DB connection settings).

Terminal window
pnpm --filter @openinsure/db db:migrate

This runs the squashed bootstrap + forward Drizzle migrations against DATABASE_URL.

Section titled “Step 5 — Seed Base Rating Data (Optional but Recommended)”
Terminal window
pnpm db:seed:rating
Terminal window
pnpm dev

Common local endpoints:

AppURL
API Workerhttp://localhost:8787
Underwriting Apphttp://localhost:3000
Producer Portalhttp://localhost:3001
Adminhttp://localhost:3002
Policyholder Portalhttp://localhost:3003
Astro Docshttp://localhost:4321

For local/demo flows, exchange API_SECRET for a short-lived superadmin JWT:

Terminal window
curl -s -X POST http://localhost:8787/auth/demo \
-H "Content-Type: application/json" \
-d '{"secret":"'"$API_SECRET"'"}' | jq -r '.token'

Export token:

Terminal window
export TOKEN="<paste-token>"
Terminal window
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.