Skip to content

Seed demo locations so the public demo always hits the location cache #10

Description

@AlaskanTuna

The most fragile moment in a demo is a first-time visitor searching an address that has never been resolved — that path hits the Google Solar API, downloads GeoTIFFs, and runs sharp, which is slow on Heroku Basic and likely to time out on Render free. It also burns Solar API quota on strangers. The project's own architecture already provides the fix: locations are cached, and the cache is provider-agnostic. Pre-seeding a handful of known-good Malaysian locations means the demo path is always a cache hit, which simultaneously de-risks task 10's CPU constraint, protects the API budget, and shows the product at its best. This is not a workaround — it is the cache constraint working as designed.

Scope: prisma/seed.ts, frontend/src/components/map/CoverageNoticeModal.tsx, frontend/src/locales/{en,ms,zh}/map.json

Depends on: #4, #5

Checklist

  • Pick 3–5 locations with confirmed HIGH-quality Solar API coverage in the areas the coverage modal already names (Klang Valley, Ipoh, Sungai Petani) — the rescued Location rows from task 1 are the best source, since they are already known-good
  • Ensure those Location rows and their R2 objects survive the migration intact and are marked ready
  • Surface them in the UI as suggested/example addresses on the MapPage so a visitor's first click is a cache hit — reuse the existing coverage-notice surface rather than adding a new component
  • Add the copy to all three locale files (en, ms, zh) — the app is fully localised and a monolingual addition would regress that
  • verify: clicking a suggested location goes Map → Workbench with zero outbound solar.googleapis.com calls in the backend log
  • verify: the full demo path (suggested location → drag a panel → save → analysis → PDF export) completes on the target host inside a time a stranger will tolerate
  • verify: pnpm dlx impeccable detect <changed frontend files> reports 0 unwaived findings (note: AGENTS.md bans npx in this repo, so use pnpm dlx)

Priority: High · Phase 12 task 11 of the maintainer's migration plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highBlocks launch or the demoenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions