by Ta-Tech Solutions All documents

County OS - operator guide

CivicLoop expanded from 311 into County OS: one platform, every county agency a module on the same engine. This doc covers the surfaces added on top of the 311 core and how to operate them.

Modules (staff, supervisor+)

Each agency is a module at /[locale]/<module>, gated by requireStaff(locale, "supervisor"), reading via the service-role admin client, county-scoped.

Module Route Core entity (full CRUD)
Procurement /procurement vendors (+ solicitations, bids, contracts; AI bid scoring)
DPIE Permitting /dpie permit_applications
Economic Development /econdev businesses (+ opportunities)
Public Works (DPWT) /dpwt fleet_vehicles
Human Resources /hr job_postings
Parks & Recreation /parks park_assets
Public Safety / Courts /safety safety_cases
Public Schools /schools schools
Redevelopment /redevelopment redevelopment_sites
Predictive Data Feeds /feeds data_feeds (+ feed_readings)
County Assistant /assistant county_kb (knowledge base)

Full CRUD (every module)

Each module carries a schema-driven Manage section (components/county-os/record-editor.tsx) with New / Edit / Delete on its core entity. Fields are declared once in src/lib/county-os/schemas.ts (real dropdowns for every enum, money/date/number/tags controls, EN/ES labels). Server actions: src/lib/county-os/crud-actions.ts (allowlisted by table, staff-gated, county-scoped). Nothing is read-only.

Printable reports

Every module + the public portals export as a branded, downloadable, printable report via components/county-os/report-bar.tsx (Print report button on screen; logo + county + timestamp header on print). Global print CSS in globals.css; staff chrome is .no-print. Browser "Save as PDF" = downloadable.

Predictive data feeds (/feeds)

Generic time-series store. Register a feed (kind + metric + unit + threshold), upload a CSV (timestamp,value), and the platform fits a least-squares trend, projects 7/30 days, and estimates days-to-threshold. Forecasted breaches raise feed_forecast automation flags.

Agentic automation

Observability ("our own Datadog")

County AI assistant (/assistant)

Named assistant ("Ada", renameable in county_ai_config). Answers from county_kb first and falls back to general guidance (prefixed "General guidance:") when a question isn't covered. The onboarding questionnaire is seeded as KB rows the county edits to fill in real answers - fully managed with the same RecordEditor. Action: src/lib/assistant/ask.ts (Claude Haiku). Needs ANTHROPIC_API_KEY.

First-run tour

components/dashboard/welcome-tour.tsx runs a one-time guided tour on the dashboard (re-openable via "Take a tour"); remembered in localStorage.

Testing & demo assets

Environment variables

Var Purpose Behavior if unset
ANTHROPIC_API_KEY AI co-pilot, bid scoring, assistant AI features fail safe
AUTOMATION_SECRET gate /api/automations + /api/cron/synthetic 503
FEEDS_INGEST_SECRET gate /api/feeds/ingest 503
SENTRY_DSN / NEXT_PUBLIC_SENTRY_DSN error tracking no-op
SYNTHETIC_BASE_URL target for synthetic monitor defaults to prod URL

Deploy

Manual CLI (no auto-deploy): cd web && netlify deploy --build --prod --site=e1d84f28-2e39-4f34-98ab-5749dd77e286. Always pass --site.

CivicLoop - Ta-Tech Solutions - Architecture & Design Documentation