I Escondido·In 8 weeks (June 2026)
ForaCity Developer Portal

Infrastructure Scaling Plan

Roadmap to scale ForaCity to every city, county, and state in the United States.

Target Scale: United States

50
States
3,143
Counties
19,502
Cities
519K+
Elected Officials
22.7K
Total Jurisdictions

Phased Rollout

Key Metrics
19
Jurisdictions
~25
Subdomains
100+
Est. officers
5,000+
Est. contributions
Tech Stack
Multi-tenant DB schemaSubdomain routing per cityShared compliance engineBatch NetFile sync
Data Strategy

Automated ingestion pipelines: NetFile (all SD County filers), CivicPlus/Granicus (agendas), ArcGIS (all SD districts). Jurisdiction-scoped data isolation with shared analytics.

Deliverables
Multi-tenant database: jurisdiction_id on all tables, row-level filtering
Automated subdomain provisioning: {cityname}.foracity.com + {cityname}gov.foracity.com
Shared compliance engine with jurisdiction-specific thresholds
Batch NetFile sync across all SD County filers (FPPC jurisdiction)
County Board of Supervisors integration with district boundaries
Cross-jurisdiction analytics: compare compliance scores, participation rates
Onboarding workflow: city clerk uploads data → auto-provision subdomain
SD County pilot cities: Encinitas, Oceanside, Carlsbad, Vista, San Marcos

Data Ingestion Layer

Layer 1 of 5
NetFile Adapter (CA local campaign finance)
CalAccess Adapter (CA state campaign finance)
FEC Adapter (federal campaign finance)
CivicPlus/Granicus Adapter (agendas & minutes)
ArcGIS Adapter (district boundaries)
State-specific adapters (TEC, BOE, DOS, etc.)
PDF/OCR pipeline (Form 700, meeting minutes)
Manual upload portal (city clerk onboarding)

Processing & Compliance Layer

Layer 2 of 5
Pluggable Compliance Rules Engine
Conflict Detection Service
Contribution Threshold Monitor
Entity Resolution (match contributors across sources)
ML Anomaly Detection
Real-time Event Streaming (Kafka/NATS)

Storage Layer

Layer 3 of 5
TiDB Serverless (horizontally scalable MySQL)
Regional sharding (West/Central/East)
S3 for documents, images, media
Redis for caching and rate limiting
Elasticsearch for full-text search

Application Layer

Layer 4 of 5
tRPC API gateway (type-safe, auto-batching)
Subdomain router (auto-provision per jurisdiction)
Auth service (Manus OAuth + social logins)
Notification service (push, email, SMS)
LLM service (summaries, analysis, chat)

Presentation Layer

Layer 5 of 5
React 19 SPA with SSR capability
Mobile app (React Native, shared backend)
Embeddable widgets (for city websites)
Public API (REST + GraphQL)
Data export (CSV, JSON, PDF reports)

Cost Projections

PhaseInfra / moData / moTeam
1. Escondido$50$01 dev
2. SD County$200$1002-3 devs
3. California$2K$1K5-8 devs
4. Multi-State$10K$5K15-20
5. National$50K$20K30-50

Key Architecture Decisions

Multi-Tenant vs. Multi-Instance

Multi-tenant with jurisdiction_id

Shared infrastructure reduces cost per jurisdiction. Row-level security via Drizzle query filters. Shard by region at Phase 3+.

Monorepo vs. Microservices

Monorepo with modular routers

tRPC routers act as service boundaries. Split to microservices only when team size exceeds 15. Current architecture supports 10K+ jurisdictions.

Real-time vs. Batch Processing

Batch with real-time overlay

Campaign finance data updates daily (NetFile/CalAccess). Real-time only for user-generated content (feed, Fora). Reduces infrastructure cost 80%.

Compliance Engine: Hardcoded vs. Rules Engine

Pluggable rules engine at Phase 4

Current CA Levine Act logic is hardcoded (simple, fast). At multi-state, extract to configurable rules: threshold amounts, lookback periods, entity types per state law.