How to run, deploy, monitor, and recover CivicLoop County OS. Companion to COUNTY_OS.md.
e1d84f28-2e39-4f34-98ab-5749dd77e286).465824a0-d562-40aa-84b7-178dcf79b3d7).fxhcphtwnicrypsznsxa (us-east-1). RLS on every table. Service-role key + Anthropic key in web/.env.local.github.com/tangwafor/civicloop, working dir ~/Desktop/projects/civicloop (web/ docs/ site/ scripts/ at root).Manual CLI (the app site does NOT auto-deploy from GitHub and a build hook does not trigger a build):
cd web && netlify deploy --build --prod --site=e1d84f28-2e39-4f34-98ab-5749dd77e286
--site=<id> so a missing .netlify/state.json cannot deploy to the wrong site.npm run build (or let --build do it) and confirm exit 0 before trusting a deploy.cd .. && npm run docs && node scripts/build-docs.mjs --pdf && netlify deploy --prod --dir=site --site=465824a0-d562-40aa-84b7-178dcf79b3d7.npm run build locally, exit 0.node scripts/ui-sweep.mjs against the deploy (or local) - zero uncaught JS errors.node scripts/prod-smoke.mjs against prod.
No em-dashes anywhere (the docs builder fails the build on one).| Var | Purpose | If unset |
|---|---|---|
ANTHROPIC_API_KEY |
AI co-pilot, bid scoring, County assistant | AI features fail safe (no crash) |
AUTOMATION_SECRET |
gate /api/automations + /api/cron/synthetic |
endpoints return 503 |
FEEDS_INGEST_SECRET |
gate /api/feeds/ingest |
endpoint returns 503 |
SENTRY_DSN / NEXT_PUBLIC_SENTRY_DSN |
error tracking | Sentry is a no-op |
SYNTHETIC_BASE_URL |
synthetic monitor target | defaults to prod URL |
| Twilio / Resend keys | SMS + email notifications | notifications log as "provider not configured" |
Point any scheduler (Supabase pg_cron + pg_net, a Netlify scheduled function, GitHub Action) at:
POST /api/automations with header x-automation-secret: $AUTOMATION_SECRET - hourly. Runs reminders, janitor, and feed forecasts.POST /api/cron/synthetic with the same header - every 5-10 min. Uptime/latency checks.POST /api/cron/self-heal - existing data-integrity sweep./dashboard shows the latest synthetic check per public surface.global-error.tsx catches React render crashes./dashboard shows open flags (overdue permits, expiring contracts, down monitors, forecast breaches) for an officer to resolve.node scripts/prod-smoke.mjs (20 checks across app + docs + Open311).node scripts/ui-sweep.mjs DEMO_APP_URL=https://civicloop-pgc.netlify.app.get_logs + get_advisors. RLS is on; never disable it to "fix" a read - grant the right policy./public page (public-record aggregates only).web/sql/civicpulse-schema.sql. Pull a fresh dump before writing new SQL.