Static Astro build

Explore demographic snapshots for English towns

This prototype turns one CSV into a searchable homepage, a static page per town, a summary JSON feed for client-side search, and per-town JSON files for in-browser comparison.

Coverage 31 towns
Total population 2.4M
Average employment +76%
Average house price £373,774
What the build generates
  • Static page per town
  • Summary search JSON from the CSV
  • One full JSON file per town for comparisons
  • Cloudflare Pages-ready `dist/` output
Search towns

Jump straight to a town profile

Search by town, county, or region. Results are powered by the summary JSON generated from the CSV during build.

Why this structure

Designed for static hosting without losing rich comparison tools

Fast static delivery

Every town page is prerendered by Astro, which keeps deployment simple for Cloudflare Pages and avoids any runtime backend dependency.

Lightweight search payload

The homepage loads only town summaries into MiniSearch, so search stays quick without shipping every demographic series up front.

Progressive comparisons

Detailed charts are fetched only when a visitor adds comparison towns, which keeps the initial payload much smaller.

Method

Replace the mock CSV later without rewiring the site

  1. Edit data/towns.csv with real town rows and the same columns.
  2. Run npm run build or npm run dev.
  3. The build script regenerates summary JSON, town JSON, and the data used for static pages.