Skip to main content
Operations

Operations

Deployment procedure

Regurai deploys via the Lovable Cloud pipeline:

  1. Author changes (code + docs) in a branch / preview.
  2. Verify in the Preview environment (project--<id>-dev.lovable.app).
  3. Run the security scan; target zero critical findings.
  4. Publish via the Lovable platform — production URL: project--<id>.lovable.app plus custom domains (www.regurai.com, regurai.com).

No manual npm run build or bunx ...build is required — the harness builds on publish.

Environments

EnvironmentURLPurpose
Local devlocalhost:5173Engineer workstation
Previewproject--<id>-dev.lovable.appPre-production verification, latest preview build
Productionproject--<id>.lovable.app + custom domainsLive user traffic

Environment variables

VariableScopeNotes
VITE_SUPABASE_URLBrowser (build-time)Public, baked into bundle
VITE_SUPABASE_PUBLISHABLE_KEYBrowser (build-time)Public anon key
SUPABASE_URLServer (runtime)Same as VITE version
SUPABASE_PUBLISHABLE_KEYServer (runtime)Used by requireSupabaseAuth
SUPABASE_SERVICE_ROLE_KEYServer (runtime)Never exposed to client
WEBHOOK_SECRET (per webhook)Server (runtime)HMAC key for /api/public/*

Read server vars via process.env.X inside .handler() — never at module scope.

Infrastructure requirements

  • Cloudflare Workers (workerd) with nodejs_compat.
  • Supabase project (managed).
  • Lovable Cloud secret store.
  • TLS / DNS handled by the platform.

Backup procedure

  • Database: Supabase performs automated daily backups with point-in-time recovery (PITR) within the retention window of the project's plan.
  • Application code: source of truth is the Lovable project / git remote; the latest published build is immutably stored by the platform.
  • Documentation snapshots: each published version of the Project Manual can be downloaded as PDF (/docs → Download). Archive copies in the firm's GRC document repository at every release.

Disaster recovery

ScenarioAction
Worker outage in one regionCloudflare automatically reroutes — no action.
Edge function regressionRoll back via the Lovable Cloud function tooling.
Database corruption / accidental destructive migrationOpen a support ticket with Supabase; restore via PITR. Verify with supabase--db_health.
Service-role key compromiseRotate via Supabase admin; redeploy edge functions; investigate audit log; force-revoke active sessions.
Complete project lossRestore from git + Supabase PITR snapshot into a fresh project; reconfigure secrets; redeploy.

RTO and RPO targets are set per tenant SLA; document them in the firm's BCP, not here.

Incident response

Severity ladder:

  • SEV-1 — auth bypass, data exposure, total outage.
  • SEV-2 — partial outage, broken governance workflow, degraded MFA.
  • SEV-3 — single-page bug, cosmetic regression.

Standard workflow:

  1. Detect — alert from monitoring, user report, or audit anomaly.
  2. Triage — assign severity, on-call owner, war-room channel.
  3. Contain — disable affected feature flag or rollback last release if needed.
  4. Eradicate — code fix + tests + manual update (changelog entry + impact note in chapter).
  5. Recover — redeploy, verify in preview, then production.
  6. Postmortem — within 5 business days, file in chapters/10-change-management.md under Incidents. If architectural, also record an ADR.

For any SEV-1 affecting customer data, also open a gdpr_requests entry where applicable.

Monitoring

SignalWhere
Edge function logsLovable Cloud → Edge Functions
Server function logsWorker stdout
Audit log entries/app/audit-log-viewer
Login attemptspublic.sec_login_attempts
DB healthsupabase--db_health
Security findingsLovable Project security view

Scheduled jobs

JobCadenceEndpointOwner
audit_logs integrity check (Tech-debt #9, follow-up to Incident #5)Weekly (suggested: Mondays 03:17 UTC)POST /api/public/hooks/audit-logs-integrity-check (calls public.audit_logs_integrity_summary() and persists a SYSTEM row into audit_logs)Security

Scheduling is wired through pg_cron + pg_net. The runbook entry — exact cron.schedule(...) SQL, alerting hook for status='suspect' runs, and operator playbook for triaging flagged rows — is a planned Operations documentation pass and is not yet in production. Until then, the endpoint and RPC are deployed and can be invoked manually for ad-hoc audits.