How mostafaai10/field-shift-adapting-farms-with-nasa-data-2026 works
Field Shift is a bilingual farm decision-support website for comparing crop rotations in the Sidi Salem–Qallin pilot area. A farmer or advisor selects a cell (or matches a location), adjusts scoring weights, and receives ranked options, crop and environmental context, and modeled irrigation comparisons. The backend validates pinned datasets at startup, serves cell and dashboard APIs, and computes custom-weight evaluations. The README also documents farm saving and planning, science/source transparency, themes, localization, and JSON export. Frontend-to-API wiring is not shown in excerpts, so those links are marked unverified.
Main entry points: dashboard.py Dashboard API · main.py FastAPI app · dashboard.js Dashboard UI · cells.py Cell API
Components 19
Website experience
- Dashboard UI
website-v2/js/dashboard.js - Farm tools
website-v2/js/app.js - Field map
website-v2/js/field-map.js - Saved farms and tasks
website-v2/js/app.js
API and cell data
- FastAPI app
website-v2/backend/app/main.py - Readiness API
website-v2/backend/app/api/routers/health.py - Cell API
website-v2/backend/app/api/routers/cells.py - Dashboard API
website-v2/backend/app/api/routers/dashboard.py - Rotation API
website-v2/backend/app/api/routers/rotations.py - Dataset dependency
website-v2/backend/app/api/dependencies.py - Cell profiles and recommendations
website-v2/backend/app/services/cell_service.py
Rotation analysis
- Weighted rotation scoring
website-v2/backend/app/services/scoring_service.py - Weight request validation
website-v2/backend/app/schemas/rotations.py
Validated datasets
- Dataset manifest
website-v2/backend/data/manifest.json - Processed cell and score tables
website-v2/backend/data/processed - CSV validation and loading
website-v2/backend/app/repositories/csv_repository.py
Other components
- Farmer / advisor
- Browser
- NASA and other source data
Connections 25
- Farmer / advisor → Dashboard UI: uses
- Dashboard UI → Field map: shows map
- Farmer / advisor → Farm tools: manages farms
- Farm tools → Saved farms and tasks: saves locally
README.md - Dashboard UI → Browser: renders in
- FastAPI app → Readiness API: registers router
website-v2/backend/app/main.py - FastAPI app → Cell API: registers router
website-v2/backend/app/main.py - FastAPI app → Rotation API: registers router
website-v2/backend/app/main.py - FastAPI app → Dashboard API: registers router
website-v2/backend/app/main.py - FastAPI app → CSV validation and loading: loads datasets
website-v2/backend/app/main.py - Cell API → Dataset dependency: requires datasets
website-v2/backend/app/api/routers/cells.py - Dashboard API → Dataset dependency: requires datasets
website-v2/backend/app/api/routers/dashboard.py - Rotation API → Dataset dependency: requires datasets
website-v2/backend/app/api/routers/rotations.py - Readiness API → Dataset dependency: checks readiness
website-v2/backend/app/api/routers/health.py - Cell API → Cell profiles and recommendations: calls profiles
website-v2/backend/app/api/routers/cells.py - Cell API → Weighted rotation scoring: calls scores
website-v2/backend/app/api/routers/cells.py - Rotation API → Weighted rotation scoring: evaluates weights
website-v2/backend/app/api/routers/rotations.py - Dashboard API → Weighted rotation scoring: evaluates rotations
website-v2/backend/app/api/routers/dashboard.py - Rotation API → Weight request validation: accepts request
website-v2/backend/app/api/routers/rotations.py - Dashboard API → Weight request validation: extends request
website-v2/backend/app/api/routers/dashboard.py - CSV validation and loading → Dataset manifest: checks hashes
website-v2/backend/app/repositories/csv_repository.py - CSV validation and loading → Processed cell and score tables: loads and validates
website-v2/backend/app/repositories/csv_repository.py - NASA and other source data → Processed cell and score tables: informs processed data
README.md - Dashboard UI → Dashboard API: requests results
- Farm tools → Dashboard API: requests evaluations