|
| 1 | +# va-reform-dashboard |
| 2 | + |
| 3 | +An interactive calculator that lets users model the impact of reforms to the Child Tax Credit (CTC), Earned Income Tax Credit (EITC), and income tax rates at both the federal and Virginia state levels for Virginia residents. Users configure their household and adjust reform parameters, then see household-level impacts via line charts and summary metrics, plus statewide impacts via microsimulation. |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +- Next.js App Router with Tailwind CSS v4 and @policyengine/ui-kit theme |
| 8 | +- @policyengine/ui-kit for standard UI components (Header, SidebarLayout, Tabs, MetricCard, charts, inputs) |
| 9 | +- Custom Modal backend (gateway + worker pattern) for household and statewide microsimulation |
| 10 | +- Frontend polling via @tanstack/react-query for async computation results |
| 11 | +- Two endpoints: `household-impact` (fast, ~10-40s) and `statewide-impact` (slow, ~2-5 min microsimulation) |
| 12 | + |
| 13 | +## Development |
| 14 | + |
| 15 | +```bash |
| 16 | +bun install |
| 17 | +make dev # Deploy worker + start gateway + frontend (random port) |
| 18 | +make dev-frontend # Frontend only (uses production API or NEXT_PUBLIC_API_URL) |
| 19 | +make dev-backend # Gateway only (worker must already be deployed) |
| 20 | +``` |
| 21 | + |
| 22 | +## Testing |
| 23 | + |
| 24 | +```bash |
| 25 | +make test # Frontend tests (vitest) |
| 26 | +make test-backend # Backend tests (pytest) |
| 27 | +``` |
| 28 | + |
| 29 | +## Build |
| 30 | + |
| 31 | +```bash |
| 32 | +make build |
| 33 | +``` |
| 34 | + |
| 35 | +## Design standards |
| 36 | +- Uses Tailwind CSS v4 with @policyengine/ui-kit/theme.css (single import for all tokens) |
| 37 | +- @policyengine/ui-kit for all standard UI components |
| 38 | +- Primary teal: `bg-teal-500` / `text-teal-500` |
| 39 | +- Semantic colors: `bg-primary`, `text-foreground`, `text-muted-foreground` |
| 40 | +- Font: Inter (via next/font/google) |
| 41 | +- Sentence case for all headings |
| 42 | +- Charts use `fill="var(--chart-1)"` for series colors |
| 43 | +- Recharts axes use `niceTicks` with `domain={["auto", "auto"]}` |
| 44 | +- Negative currency formatted as `-$100` not `$-100` |
0 commit comments