The technology
behind PoliCampaign.
A modern, production-grade stack purpose-built for political campaigns — fast, secure, and scalable from city council to statewide races.
14
Technology Categories
79+
Libraries & Services
SSR
Server-Side Rendered
100%
TypeScript
Core Frontend
6 technologies
UI component library — server-side rendered with client hydration
Strict type safety across the entire codebase
Build tool and dev server with HMR
Data router with SSR loaders and client-side navigation
Utility-first CSS framework with custom design tokens
Semantic markup with full accessibility (ARIA, roles, landmarks)
UI Component System
10 technologies
Accessible component library built on Radix UI primitives
15+ headless primitives: Dialog, Tabs, Select, Popover, Tooltip, and more
Icon library — 450+ consistent SVG icons
Additional icon set for campaign-specific UI elements
Production animation library — entrance, hover, and scroll-triggered effects
Touch-friendly carousel with autoplay for media rotators
Drawer component for mobile-optimized slide-up panels
Toast notification system
Command palette component
Drag-to-resize split-pane layouts
Backend & Server
5 technologies
Server runtime — Alpine Linux container in production
HTTP server handling API routes and SSR rendering
React renderToString with HelmetProvider for SEO-ready HTML on first byte
Multipart file upload handling for voter CSV imports
Observability API for distributed tracing
Database & ORM
5 technologies
Relational database — campaigns, voters, donors, supporters, events
Native MySQL driver for Node.js with connection pooling
Type-safe ORM with schema definitions and query builder
Schema migration tooling and introspection
Server-start migrations using raw mysql2 connections for MySQL 5.7 compatibility
Authentication & Security
7 technologies
Full-stack auth with email/password, sessions, and additionalFields for user_type
Runtime schema validation for all API inputs and form data
Performant form state management with Zod resolver
Static analysis for XSS, injection, and unsafe patterns
Prevents unsafe innerHTML and DOM injection
Automated dependency vulnerability scanning
Supply chain integrity checks on package-lock.json
Payments & Fundraising
2 technologies
Payment processing — subscriptions, one-time donations, webhook handling
Idempotent event handling for subscription lifecycle and Founding Forty badge logic
Communications
6 technologies
Transactional and blast email delivery via Nodemailer SMTP relay
Email composition and delivery with RFC 8058 unsubscribe headers
SMS campaigns and A2P 10DLC-compliant text messaging
Supplemental email delivery and list management
Additional transactional email provider
AI-powered text-to-speech for robocall audio generation
AI & Machine Learning
5 technologies
Campaign Coach, Opposition Research, Predictive Voter Targeting, Creative Suite copy generation
SSR-safe dynamic import pattern with externalized bundle to prevent server-side issues
Renders AI-generated markdown responses in the UI
GitHub Flavored Markdown support for AI output tables and lists
Safe HTML passthrough in AI-rendered content
Data Visualization & Mapping
7 technologies
Chart library — fundraising bar charts, payment method pie charts, KPI trends
Interactive maps for precinct and ward visualization
Clustered voter pin rendering for large walk list datasets
Date picker for event scheduling and availability calendars
Date arithmetic and formatting utilities
Server state management, caching, and background refetching
Lightweight client-side state management
Document & File Processing
6 technologies
Server-side PDF generation for FEC reports and campaign documents
PDF text extraction for document analysis
ZIP archive creation for bulk data exports
DOM-to-image capture for creative asset export
Rich text editor framework for campaign content authoring
POST returns 202 + jobId; frontend polls every 1.5s for voter file import status
Internationalization
3 technologies
Internationalization framework for multi-language support
React bindings for i18next with hooks and components
Automatic locale detection from browser settings
SEO & Meta
4 technologies
SSR-compatible head management — title, meta, canonical, Open Graph, JSON-LD
Schema.org WebSite, Organization, WebPage, and LocalBusiness markup on every page
Automatic search engine ping on publish for Bing, Yandex, and Yahoo indexing
Static route sitemap auto-generated from routes.tsx on every edit
Testing & Quality
6 technologies
Unit and integration test runner — Vite-native, Jest-compatible
Component testing with user-event simulation
DOM environment for server-side test execution
noEmit type-check on every build; zero type errors enforced
Linting with React, hooks, security, and TypeScript rule sets
Opinionated code formatting
Infrastructure & DevOps
7 technologies
Production container OS — pure-JS packages only (no native addons)
Server runtime with ESM module support
Dual build: client assets to dist/client/, Express server to dist/server.bundle.mjs
Every change auto-committed; publish deploys HEAD commit
*.policampaigns.com subdomains; hostname middleware rewrites to /c/[subdomain]
Content-hashed assets; full CDN purge triggered on every publish
/shared-storage/public/assets/ for runtime uploads; /private/ for sensitive documents
Architecture Overview
Rendering
Full server-side rendering (SSR) via React 19 + Express. Every page is rendered to HTML on the server before reaching the browser — ensuring fast first paint, SEO-ready markup, and social preview support via react-helmet.
Data Layer
MySQL with Drizzle ORM for type-safe queries. Idempotent raw SQL migrations run on server start for MySQL 5.7 compatibility. API routes are manually registered in Express — no filesystem-based auto-discovery.
Authentication
BetterAuth handles sessions, email/password auth, and user type routing (candidate / supporter / admin). All protected routes enforce session checks server-side before rendering.
AI Integration
OpenAI GPT-4o powers the Campaign Coach, Opposition Research, Predictive Targeting, and Creative Suite. OpenAI is dynamically imported and externalized from the SSR bundle to prevent server-side initialization issues.
Email Delivery
All outbound email routes through Amazon SES via Nodemailer SMTP. Blast emails include RFC 8058 unsubscribe headers, daily send caps, and hard bounce/spam rate enforcement before delivery.
Deployment
Dual Vite build: client assets to dist/client/ (content-hashed), Express server bundled to dist/server.bundle.mjs. Runs on Node 22 Alpine in production. CDN cache purged on every publish.