Satellite-based parametric crop risk platform for agricultural lenders and insurers in Pakistan.
MVP scope: Wheat monitoring in Matiari District, Sindh — decision-support only (not automated payout).
frontend/ React 19 + TypeScript + Leaflet dashboard (pnpm)
backend/ Python FastAPI — tier adapters, fusion, risk scoring
supabase/ PostgreSQL + PostGIS, Auth, RLS, report storage
See Architecture for the full system diagram, module map, and data flow.
| Tier | Source | Role |
|---|---|---|
| 1 | PlanetScope (E&R Program) | 3m optical — deferred (M5), pending license |
| 2 | SEN2SR (local super-resolution model) + Sentinel-2 weekly composite fallback | 2.5m optical |
| 3 | Sentinel-1 SAR + Sentinel-2 + CHIRPS rainfall (via Google Earth Engine) | Always-available, cloud-independent baseline — required, no synthetic fallback |
Core risk flagging works on Tier 3 alone (FR-3.7); a live GEE service account is required for all field processing.
- Async processing — registering or reprocessing a field returns immediately; satellite fetch/fusion/risk scoring runs in a background worker and the frontend polls
GET /fields/{id}/processinguntil it's ready. - ML risk layer (M12) — a gradient-boosted classifier can elevate (never downgrade) the z-score-based risk tier when its confidence is high enough; toggled via
ML_RISK_ENABLED. - Tenant isolation (M1) — every institution's data is scoped by
institution_idat the application layer on every query; see Architecture for how this relates to the Postgres RLS policies also defined in the schema.
- Node.js 20+
- pnpm 9+ (
npm install -g pnpm) - Python 3.11+
- Supabase CLI (optional, for local DB)
- Google Earth Engine service account (Tier 3 pipeline)
Create a project at supabase.com, then run migrations:
supabase db push
# or paste supabase/migrations/001_initial_schema.sql in the SQL editorCopy .env.example values into backend/.env and frontend/.env.
cd backend
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000cd frontend
pnpm install
pnpm devSee backend/.env.example and frontend/.env.example.
With the backend running: http://localhost:8000/docs
- Architecture — system diagram, module map, data flow, tenant-isolation design
- Module plan — delivery order and acceptance criteria (MVP complete)
- Supabase setup — start here after clone (M11)
- Google Earth Engine setup — service account and GCP project configuration for Tier 3
- Production deployment — Gunicorn, Docker, security, timeouts
- Contributing — dev workflow, branch/commit conventions, manual verification gate
- Changelog — notable changes by milestone
- SRS traceability — requirement → code map
- UI/UX inspiration — historical design-direction options from before the M9 Canopy redesign shipped
- Audit findings — prioritized backlog of known flaws and improvement ideas
- Feature roadmap — feasibility-checked future features, and which accelerators/evaluators to target
- Free vs. paid resources — what's buildable at $0 today vs. what needs budget, and when
- User flow & what the numbers mean — plain-language walkthrough of the product and honest accuracy caveats
- Live walkthrough — real screenshots from an actual run against the live stack (Supabase + GEE)
- In-app Guide — http://localhost:5173/guide (plain-language + technical tutorials)
cd backend && python -m pytest # unit tests, no live credentials needed
cd frontend && pnpm run lint && pnpm run test && pnpm run buildRuns automatically in CI (.github/workflows/ci.yml) on every push/PR. See Contributing for what this does and doesn't cover.
python scripts/verify_supabase.py
python scripts/verify_rls.py # requires backend on :8000
python scripts/verify_gee.py # GEE credentials
python scripts/bootstrap_ml_models.py # M4 SEN2SR + M12 ML weights
python scripts/test_e2e_flows.py