Day-2 operations

Tooling the operators actually use.

Provisioning, migrations, backups, fleet status, drift checks, and QA — every script ships in the repo and is documented in the install guide.

pnpm provision:tenant

Interactive wizard. Asks for domain, brand, integration keys. Generates a complete .env, scaffolds Supabase project, runs migrations, and hands you a deployable artifact. New tenant in under ten minutes.

pnpm fleet status

Across every tenant in your fleet: readiness, running version, applied migrations, and (with --verify-schema) drift detection between expected schema and live database.

Forward-only migrations

Migrations apply once, in order. No down-migrations means no half-rollbacks in production. The migration creator scaffolds new files; pnpm db:migrate applies them with idempotent locks.

Backup, restore, verify

backup.sh dumps a consistent snapshot. restore.sh rebuilds from one. verify-backup.sh actually runs the restore against an ephemeral DB and asserts schema parity. Cron it.

QA smoke + E2E

qa-smoke.mjs is sub-30-second sanity. qa-e2e.mjs walks the full upload-to-playback path against a live tenant. Both are CI-friendly and fail loudly.

Full inventory

Every script and CLI surface that ships in the repo.

  • pnpm provision:tenantInteractive new-tenant wizard, generates full .env
  • pnpm fleet statusReadiness + version + migrations across all tenants
  • pnpm fleet status --verify-schemaSchema-drift detection
  • pnpm db:migrateForward-only migrations
  • Migration creatornew-migration.mjs
  • Backup / restore scriptsbackup.sh, restore.sh, verify-backup.sh
  • Master-data clone toolclone-master-data.mjs
  • Counter drift checksComments, view counts
  • License keypair generator
  • QA smoke + E2E suitesqa-smoke.mjs, qa-e2e.mjs
  • Query plan inspector

Setup walkthrough lives at /docs/install and /docs/configure.