Deployment
Build, migrate, run the web process and the worker, and check readiness.
| Script | Effect |
|---|---|
npm run build | keystone build --no-ui && next build; does not migrate |
npm run migrate | prisma migrate deploy (creates row-level security policies, so the database role must be one you control) |
npm start | next start |
npm run worker | Runs validate:env, then the background worker |
npm run validate:env | Checks required environment |
npm run verify:audit, verify:migrations, verify:retained-upgrade | Audit-chain and migration checks; migration checks need disposable databases (MIGRATION_SHADOW_DATABASE_URL) |
npm run build
npm run migrate # against a backed-up database
npm start
npm run worker # separate long-running processSettlement, webhook delivery, recovery, scheduled jobs, and audit anchoring depend on the worker. If it is not running those queues do not drain.
Production environment
Set DATABASE_URL, SESSION_SECRET (32+ characters), CUSTOMER_IDENTITY_SECRET (32+), PII_ENCRYPTION_KEY, OUTBOUND_WEBHOOK_SECRET and WEBHOOK_EGRESS_HOSTS for outbound webhooks, AUDIT_ANCHOR_DIR and AUDIT_ANCHOR_SECRET for anchoring, METRICS_BEARER_TOKEN for probes, SMTP for recovery emails, and the Authorize.net variables for payments.
Health
/api/healthreturnsokwith the service name and time./api/readychecks migrations, stale worker leases, degraded providers, oldest pending queue age, worker heartbeats, row-level security coverage, exposure consistency, audit anchoring, and privileged operators without MFA. Detail needsMETRICS_BEARER_TOKENin production./api/metricsreturns Prometheus text (wagers, queues, providers, dead letters, incidents, markets, journal imbalance) and 404s without the bearer token in production.- Set
OTEL_EXPORTER_OTLP_ENDPOINTfor OpenTelemetry from the app and worker.
After deploy
Create the first operator at /dashboard/init, enrol two-factor, run onboarding, and create the independent approver. See Getting started.