Standalone Next.js App Router site explaining how PolicyEngine's microsimulation model works.
Deployed to Vercel as policyengine-model, embedded in policyengine-app-v2 at /{countryId}/model.
- Next.js 15 (App Router) + React 19 + TypeScript
- Tailwind CSS v4 with
tw:prefix +@policyengine/design-systemtokens - framer-motion for animations
- recharts for data visualizations
- Vitest + React Testing Library for tests
- Next.js App Router file-based routing (
app/directory) src/router.tsprovidesuseHashRoute()(wrapsusePathname()) andnavigate()for backward compat- Query params preserved:
?embed=true&country=us
Overview (/)
Rules (expandable)
Coverage tracker (/rules/coverage)
Parameters (/rules/parameters)
Variables (/rules/variables)
Data (expandable)
Pipeline (/data/pipeline)
Calibration (/data/calibration)
Validation (/data/validation)
Behavioral responses (/behavioral)
app/- Next.js App Router pages and layoutssrc/router.ts- Compat routing shim (usePathname + navigate)src/components/layout/- AppShell, Sidebar, MobileHeader, Footer, SectionContainersrc/views/- Page components for each routesrc/components/- microsim/, rules/, data/, theory/ (existing components)src/designTokens/- Local design tokens (colors, typography, spacing) — kept for dynamic/conditional stylessrc/data/- Programs data, microsim steps, pipeline stages, elasticitiessrc/hooks/- useInView, useCountrysrc/test/- Vitest test files
- Static layout → Tailwind classes with
tw:prefix - Dynamic/conditional styles → inline
style={}using designTokens JS imports - framer-motion style props → inline (required by motion API)
- recharts color props → designTokens JS imports
- PE design-system CSS vars available as
tw:text-pe-primary-500,tw:bg-pe-gray-50, etc.
bun dev- Development server (Next.js with Turbopack)bun run build- Production buildbun start- Start production serverbun run test- Run tests (Vitest)bun run test:watch- Run tests in watch mode
?embed=true- Hides sidebar, content full-width (for iframe embedding)?country=us|uk- Switches country data, spelling, currency