Built to Win

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

Reactv19

UI component library — server-side rendered with client hydration

TypeScriptv5.7

Strict type safety across the entire codebase

Vitev6.4

Build tool and dev server with HMR

React Routerv7

Data router with SSR loaders and client-side navigation

Tailwind CSSv3.4

Utility-first CSS framework with custom design tokens

HTML5

Semantic markup with full accessibility (ARIA, roles, landmarks)

UI Component System

10 technologies

shadcn/ui

Accessible component library built on Radix UI primitives

Radix UI

15+ headless primitives: Dialog, Tabs, Select, Popover, Tooltip, and more

Lucide React

Icon library — 450+ consistent SVG icons

Heroicons

Additional icon set for campaign-specific UI elements

Motion (Framer)v12

Production animation library — entrance, hover, and scroll-triggered effects

Embla Carouselv8.6

Touch-friendly carousel with autoplay for media rotators

Vaul

Drawer component for mobile-optimized slide-up panels

Sonner

Toast notification system

cmdk

Command palette component

React Resizable Panels

Drag-to-resize split-pane layouts

Backend & Server

5 technologies

Node.jsv22

Server runtime — Alpine Linux container in production

Expressv5.1

HTTP server handling API routes and SSR rendering

Server-Side Rendering (SSR)

React renderToString with HelmetProvider for SEO-ready HTML on first byte

Multerv2.2

Multipart file upload handling for voter CSV imports

OpenTelemetry

Observability API for distributed tracing

Database & ORM

5 technologies

MySQLv5.7+

Relational database — campaigns, voters, donors, supporters, events

mysql2v3.22

Native MySQL driver for Node.js with connection pooling

Drizzle ORMv0.45

Type-safe ORM with schema definitions and query builder

Drizzle Kitv0.31

Schema migration tooling and introspection

Idempotent Raw SQL Migrations

Server-start migrations using raw mysql2 connections for MySQL 5.7 compatibility

Authentication & Security

7 technologies

BetterAuthv1.6

Full-stack auth with email/password, sessions, and additionalFields for user_type

Zodv3.25

Runtime schema validation for all API inputs and form data

React Hook Formv7.62

Performant form state management with Zod resolver

ESLint Security Plugin

Static analysis for XSS, injection, and unsafe patterns

ESLint No-Unsanitized Plugin

Prevents unsafe innerHTML and DOM injection

better-npm-audit

Automated dependency vulnerability scanning

lockfile-lint

Supply chain integrity checks on package-lock.json

Payments & Fundraising

2 technologies

Stripev20.4

Payment processing — subscriptions, one-time donations, webhook handling

Stripe Webhooks

Idempotent event handling for subscription lifecycle and Founding Forty badge logic

Communications

6 technologies

Amazon SES (SMTP)

Transactional and blast email delivery via Nodemailer SMTP relay

Nodemailerv9.0

Email composition and delivery with RFC 8058 unsubscribe headers

Twilio

SMS campaigns and A2P 10DLC-compliant text messaging

Brevo

Supplemental email delivery and list management

SendGrid

Additional transactional email provider

Amazon Polly (TTS)

AI-powered text-to-speech for robocall audio generation

AI & Machine Learning

5 technologies

OpenAI GPT-4o

Campaign Coach, Opposition Research, Predictive Voter Targeting, Creative Suite copy generation

Dynamic OpenAI Import

SSR-safe dynamic import pattern with externalized bundle to prevent server-side issues

React Markdownv9.0

Renders AI-generated markdown responses in the UI

remark-gfm

GitHub Flavored Markdown support for AI output tables and lists

rehype-raw

Safe HTML passthrough in AI-rendered content

Data Visualization & Mapping

7 technologies

Rechartsv3.10

Chart library — fundraising bar charts, payment method pie charts, KPI trends

Leafletv1.9

Interactive maps for precinct and ward visualization

Leaflet MarkerCluster

Clustered voter pin rendering for large walk list datasets

React Day Pickerv9.9

Date picker for event scheduling and availability calendars

date-fnsv4.1

Date arithmetic and formatting utilities

TanStack Queryv5.95

Server state management, caching, and background refetching

Zustandv5.0

Lightweight client-side state management

Document & File Processing

6 technologies

PDFKitv0.19

Server-side PDF generation for FEC reports and campaign documents

pdf-parsev2.4

PDF text extraction for document analysis

JSZipv3.10

ZIP archive creation for bulk data exports

html-to-image

DOM-to-image capture for creative asset export

Lexicalv0.43

Rich text editor framework for campaign content authoring

Async CSV Processing

POST returns 202 + jobId; frontend polls every 1.5s for voter file import status

Internationalization

3 technologies

i18nextv26.3

Internationalization framework for multi-language support

react-i18nextv17.0

React bindings for i18next with hooks and components

i18next Browser Language Detector

Automatic locale detection from browser settings

SEO & Meta

4 technologies

@dr.pogodin/react-helmetv3.0

SSR-compatible head management — title, meta, canonical, Open Graph, JSON-LD

JSON-LD Structured Data

Schema.org WebSite, Organization, WebPage, and LocalBusiness markup on every page

IndexNow

Automatic search engine ping on publish for Bing, Yandex, and Yahoo indexing

Sitemap (auto-synced)

Static route sitemap auto-generated from routes.tsx on every edit

Testing & Quality

6 technologies

Vitestv4.1

Unit and integration test runner — Vite-native, Jest-compatible

Testing Library (React)v16.3

Component testing with user-event simulation

jsdomv29

DOM environment for server-side test execution

TypeScript strict mode

noEmit type-check on every build; zero type errors enforced

ESLintv9.16

Linting with React, hooks, security, and TypeScript rule sets

Prettierv3.4

Opinionated code formatting

Infrastructure & DevOps

7 technologies

Alpine Linux (musl)

Production container OS — pure-JS packages only (no native addons)

Node.js 22

Server runtime with ESM module support

Vite SSR Build

Dual build: client assets to dist/client/, Express server to dist/server.bundle.mjs

Git (auto-versioned)

Every change auto-committed; publish deploys HEAD commit

Short Domain Routing

*.policampaigns.com subdomains; hostname middleware rewrites to /c/[subdomain]

CDN with cache purge

Content-hashed assets; full CDN purge triggered on every publish

Persistent Storage

/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.