Skip to main content
Utilities for api-events development, seeding, and contract gates.

Database seeding

Populate Postgres with test data from api-events/scripts/seed/.
After demo-full, restart the Clerk emulator:
Manifest: api-events/scripts/seed/manifest/local-personas.json. Details: api-events/scripts/seed/README.md. Blake Admin is Admin on Seed Demo Band and Owner of leftover Blake Workspace; one-click sign-in lands on Blake Workspace.

Migrations


OpenAPI and contract gates

Emitted OpenAPI syncs to docs/openapi/soundcheck.json for web/mobile client codegen. Path templates use Encore param names. Query/body/response shapes come from sibling openapiRoute() annotations on api.raw handlers. Named $ref schemas come from sibling openapiSchema() registrations. The extractor keeps the first registration of a name it reads, so a copy in src/systems/shared/openapiSchemas.generated.ts can shadow the hand-written schema. openapi:assert-path-templates fails when a name is registered in both places, unless it is on api-events/scripts/openapi/driftedSchemaDuplicates.json. That list holds the copies that still differ from their hand-written schema. Do not add names to it. A listed name that is no longer duplicated also fails, so the list shrinks as copies are deleted. After editing a hand-written schema, delete its generated block if it has one and re-emit. Annotation coverage compares emit to the frozen Go-era checklist in api-events/scripts/openapi/testdata/openapi.baseline-ops.json, not the spec this branch writes. Schema-catalog equality also uses that in-memory emit (only $ref’d openapiSchema() names survive); leftover keys in the committed snapshot must not mask unused registrations. On PRs, api-events-deploy.yml openapi-parity emits and asserts Encore path templates (and catalog keys when the committed snapshot changed). On api-events/ pushes to dev/qa/main, docs-ci sync-openapi-spec emits first, then asserts Encore path templates and catalog keys, and refuses to auto-commit if either drifts. When a PR edits the committed snapshot, Docs CI also requires that file’s catalog keys to match emit so docs-only leftover schemas cannot land.

E2E runner

PowerShell entrypoint: api-events/scripts/run-encore-e2e.ps1

Shared infra launcher

Implementation: scripts/dev-infra.mjs → dev/docker-compose.yml

Encore dev launcher

Implementation: api-events/scripts/dev-emulator.mjs

Troubleshooting

Confirm infra is up and DATABASE_URL points at :5433:
Seed then restart emulator:
Regenerate and fix drift: