Skip to content

Standard Production Deployment Guide

Last updated: 2026-05-02

ComponentPlatformURL
Frontend (SPA)Cloudflare Pageshttps://apistandard.bekaa.eu
API GatewayCloudflare Workerhttps://standard-api.bekaa.eu
DatabaseNeon PostgreSQLManaged external
AuthStandard Native Auth (SSO via Google)Embedded in Worker

  • Type: Cloudflare Pages
  • Build output: apps/web/dist
  • Custom domain: apistandard.bekaa.eu
  • Framework: React 19 + Vite (SPA)

API Gateway — standard-api-standard-api-gateway-production

Section titled “API Gateway — standard-api-standard-api-gateway-production”
  • Type: Cloudflare Worker
  • Config file: apps/api-gateway/wrangler.toml[env.production]
  • Custom domain: standard-api.bekaa.eu
  • Bindings: Queues (ingestion, KB embedding, report export), R2 buckets (documents, reports, exports), KV cache

Set via npx wrangler secret put <NAME> --env production:

SecretDescription
DATABASE_URLNeon PostgreSQL connection string (pooled)
BETTER_AUTH_SECRETJWT signing secret for Standard Native Auth sessions
GOOGLE_CLIENT_IDGoogle OAuth 2.0 client ID
GOOGLE_CLIENT_SECRETGoogle OAuth 2.0 client secret

Set in wrangler.toml under [env.production.vars]:

VariableValue
STANDARD_ENVproduction
BETTER_AUTH_URLhttps://standard-api.bekaa.eu
LOG_LEVELinfo
AI_GATEWAY_NAMEstandard-prod

Terminal window
# 1. Build
cd apps/web && pnpm build
# 2. Deploy to Cloudflare Pages
npx wrangler pages deploy apps/web/dist \
--project-name standard-web \
--branch production \
--commit-dirty=true
Terminal window
# Deploy to production Worker
npx wrangler deploy \
--config apps/api-gateway/wrangler.toml \
--env production
Terminal window
# Generate migrations from Drizzle schemas
pnpm db:generate
# Apply migrations
pnpm db:migrate

  1. API Health: curl https://standard-api.bekaa.eu/health

    • Expected: {"ok":true,"service":"standard-api-standard","database":"connected"}
  2. Frontend: Open https://apistandard.bekaa.eu

    • Expected: Login page renders with Google SSO button
  3. Auth Flow: Sign in with Google

    • Expected: Redirect to dashboard with session
  4. SCF Catalog: Navigate to /scf

    • Expected: Controls and frameworks from synthetic fixture
  5. Admin Panel: Navigate to /admin/*

    • Expected: Organizations, Users, Audit, Licenses, System Health pages

AspectDevelopmentProduction
Worker namestandard-api-standard-api-gatewaystandard-api-standard-api-gateway-production
Auth modeMockAuthProvider (legacy headers)Standard Native Auth (sessions + RBAC)
DatabaseNeon dev branchNeon production branch
STANDARD_ENVdevelopmentproduction
Custom domainstandard-api.bekaa.eu

  • Verify GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET are set as Worker secrets
  • Check redirect URI in Google Console includes https://standard-api.bekaa.eu/api/auth/callback/google
  • Check DATABASE_URL secret has the pooled connection string
  • Verify Neon project is active and not suspended
  • API gateway handles CORS via withCors() wrapper
  • Allowed origin: https://apistandard.bekaa.eu