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

Platform Architecture

ForaCity is a multi-subdomain civic engagement platform. Each subdomain serves a distinct audience while sharing a common database, authentication system, and AI engine.

Technology Stack

Frontend
React 19 + TypeScript + Tailwind CSS 4 + shadcn/ui
Vite bundler, wouter routing, lazy-loaded pages
API Layer
tRPC 11 + Superjson
Type-safe RPC, 25+ routers, ~200 procedures
Server
Express 4 + Node.js 22
Session cookies, Manus OAuth, middleware pipeline
Database
TiDB (MySQL-compatible) + Drizzle ORM
70+ tables, schema-first migrations
Storage
S3-compatible Object Storage
CDN-backed, presigned URLs, public bucket
AI Engine
Manus Forge LLM API
22 invocations, structured JSON responses, streaming
Auth
Manus OAuth 2.0
JWT sessions, role-based access (admin/user)
Compliance
NetFile FPPC API + Custom Engine
Real-time contribution tracking, Levine Act detection

Deployment Topology

Full request flow from DNS resolution through subdomain routing, middleware, tRPC handlers, and data layer.

ForaCity Deployment Topology — DNS to Database request flow
9 Subdomains
All route through Cloudflare CDN
27 tRPC Routers
Type-safe RPC layer
144 DB Tables
TiDB / MySQL via Drizzle
4 External APIs
NetFile, LLM, Maps, Notify

Request Lifecycle

1
DNS Resolution
Browser resolves *.foracity.com → Cloudflare edge IP. SSL terminated at CDN.
2
Subdomain Routing
Host header determines which React SPA routes render. All subdomains share one Express server.
3
Middleware Pipeline
CORS validation → Cookie parsing → JWT session verification → Rate limiting.
4
tRPC Dispatch
Request hits /api/trpc/{router}.{procedure}. Superjson deserializes input. Auth context injected.
5
Business Logic
Procedure runs: DB queries via Drizzle ORM, external API calls (NetFile, LLM), compliance checks.
6
Response
Superjson serializes output (preserves Date, BigInt). Batched responses returned to client.

Subdomain Topology

foracity.com
Main Public Site

The primary public-facing civic engagement platform. Houses the Levine Act compliance guide, Fora proposal system, official profiles, meeting tracker, legislation browser, voter guide, and candidate comparison tools.

35 routes14 router groups8+ key tables
View details
escondido.foracity.com
I Heart Escondido

Community portal for Escondido with admin tools for managing officers, contributions, proceedings, conflicts, meetings, and data sources. Includes the full DashboardLayout admin panel.

18 routes6 router groups6+ key tables
View details
escondidogov.foracity.com
EscondidoGov

Government compliance dashboard with compliance cockpit, agenda intelligence, and officer compliance profiles. Purpose-built for elected officials and city staff.

8 routes4 router groups5+ key tables
View details
campaign.foracity.com
Campaign Tool

Campaign management platform with fundraising, FPPC compliance, volunteer management, event scheduling, analytics, outreach, and Fora proposal integration. Features 5 Escondido candidates across 4 races.

12 routes2 router groups6+ key tables
View details
nonprofit.foracity.com
Nonprofit Portal

Nonprofit organization dashboard with campaigns, volunteers, donors, impact reporting, and 21 integrations across 7 categories (CRM, fundraising, volunteer, communication, accounting, compliance, analytics).

9 routes2 router groups4+ key tables
View details
developer.foracity.com
Developer Portal

This portal. Architecture documentation, subdomain software stacks, database schema, AI governance rules, error monitoring, scaling plan, and integrations catalog.

16 routes1 router groups1+ key tables
View details

Cross-System Data Flows

CitizenFora Proposal
Citizens submit proposals, add research, vote on solutions
Fora ProposalAI Refinery
AI refines arguments, solutions, finds collaborators
AI RefineryCampaign
Candidates endorse proposals, link to campaign positions
CampaignCompliance Engine
Donations tracked, Levine Act limits enforced
Compliance EngineFPPC / NetFile
Filing deadlines, contribution reports, audit trail
Values CompassVoter Guide
Citizen values matched to candidate positions
Meeting TrackerConflict Scanner
Agenda items cross-referenced with donor data
NonprofitCampaign
Shared integrations, volunteer coordination

Shared Services

Manus OAuth
Single sign-on across all subdomains
TiDB Database
Shared schema, 70+ tables
Forge LLM
22 AI invocations, structured output
Compliance Engine
Levine Act + FPPC enforcement