Docs
govbase.dev production deployment
govbase.dev production deployment
Intended production architecture for AIGov on govbase.dev. Topology JSON: ../../hosted-saas/govbase-production-topology.json.
Architecture overview#
Surfaces#
| Surface | URL | Notes |
|---|---|---|
| Marketing and dashboard | https://govbase.dev | Next.js dashboard/ |
| Documentation | https://govbase.dev/docs | Canonical docs/*.md |
| Help center | https://govbase.dev/help | Operator guides |
| Hosted audit API | https://audit.govbase.dev | Evidence ingest and summaries |
| Tenant console | https://govbase.dev/tenant-console | Snapshot-driven UI |
| Onboarding | https://govbase.dev/onboarding | Live checklist backed by tenant_onboarding_progress |
Environment variables#
Dashboard (Vercel)#
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_SITE_URL | https://govbase.dev |
NEXT_PUBLIC_GOVAI_API_BASE_URL | https://audit.govbase.dev |
AIGOV_AUDIT_URL | Server-side audit fetches |
GOVAI_DATABASE_URL | First-party email/password and OAuth user storage (same database as audit migrations) |
GOVAI_DASHBOARD_JWT_SECRET | Shared HS256 signing secret; must match the audit API |
GOVAI_DASHBOARD_JWT_ISSUER | Optional issuer; defaults to govai-dashboard |
Audit API#
| Variable | Purpose |
|---|---|
DATABASE_URL | Postgres connection |
GOVAI_BASE_URL | Canonical public URL in /status |
GOVAI_DASHBOARD_JWT_SECRET | Same HS256 secret as the dashboard |
GOVAI_DASHBOARD_JWT_ISSUER | Same issuer as the dashboard |
GOVAI_STRIPE_SECRET_KEY | Optional billing |
GOVAI_STRIPE_WEBHOOK_SECRET | Optional webhooks |
See also ../hosted-backend-deployment.md and ../env-resolution.md.
Production secrets#
Store in the operator secret manager; rotate at least every 90 days. Never commit .env with production values.
Database#
Managed Postgres with TLS, RLS per tenant, and automated backups (see backup-and-disaster-recovery.md).
Monitoring#
- Liveness:
GET https://audit.govbase.dev/health - Readiness:
GET https://audit.govbase.dev/ready - Metrics:
GET https://audit.govbase.dev/metrics
Backups#
Follow backup-and-disaster-recovery.md. Verify restore in staging each quarter.
Signup-to-ready flow#
- User signs in on
govbase.devwith first-party email/password or Google/GitHub OAuth. The dashboard issues an API JWT using the shared secret. - Dashboard calls
POST /api/tenantsonaudit.govbase.devwith the access token. - Audit API provisions tenant, team, ledger binding, billing row, onboarding steps, and optional API key.
- User completes
/onboarding; progress is stored intenant_onboarding_progress. - Integrations use the issued API key against
/evidenceand/compliance-summary(hash-resolved tenant scope).
Legacy pilots may still set GOVAI_API_KEYS / GOVAI_API_KEYS_JSON; provisioned keys in tenant_api_keys work without adding plaintext to env.
Deployment checklist#
-
NEXT_PUBLIC_SITE_URLandGOVAI_BASE_URLmatch public DNS - Migrations applied through
0022_tenant_registry.sql(sqlx migrate orGOVAI_AUTO_MIGRATE) -
/readygreen on audit origin - Stripe webhooks registered when billing enabled
- WAF / rate limits configured at edge
-
make hosted-saas-readiness-checkpasses in CI - On-call rotation and status page configured
Signed in, but hosted API access is unavailable#
This message means the dashboard session has no audit API Bearer token. Signing in
again cannot repair a missing signing secret. Check both deployment configuration
and the session; do not bypass LegalEntitlementGuard on the hosted service.
- Set
NEXT_PUBLIC_GOVAI_API_BASE_URL=https://audit.govbase.devin the Vercel Production environment. Configure Preview separately for staging. - Set
GOVAI_DASHBOARD_JWT_SECRETto the same securely generated secret on the dashboard and audit server, separately for each environment. Never commit it or use a production development-token fallback. - Redeploy both services. The public API URL is compiled into the browser bundle.
- Sign out and sign in again, then verify the commercial status request and
/runswith an entitled tenant. A healthy/healthendpoint alone does not establish JWT or tenant access.
Production OAuth and password sign-in now check the public API URL and resolved
access token before creating the session. An unconfigured deployment returns an
administrator configuration error instead of redirecting to an unusable console.
Local development and explicitly configured AIGOV_SELF_HOSTED_NO_BILLING=true
deployments retain their user-only session behavior. This flag is not a repair
for hosted SaaS and must not be enabled to bypass billing or legal acceptance.