How rjoel158/tarpuy-nasa-cochabamba- works
Tarpuy is an offline-first, bilingual agricultural decision-support PWA for Cochabamba producers. The main journey is location and zone selection, weather and municipal context retrieval, comparative crop-rotation recommendations and alerts, then visual and audio guidance; saved bundles support offline use. The README also describes satellite/climate ingestion and printable materials. The documented architecture supplies some links beyond the excerpts; where implementation wiring was not shown, those links are marked dashed or omitted.
Main entry points: App.jsx PWA application · main.py FastAPI · recommender.py Rotation recommendations · apiClient.js API client
Components 25
Climate ingestion
- Data harmonization
etl/harmonizer.py - Weather clients
etl/realtime_weather_client.py - District data
etl/gamc_districts.py
Agronomy engine
- Zone repository
engine/recommender.py - Rotation recommendations
engine/recommender.py - Strategy scoring
engine/scoring.py - Crop categories
engine/categories.py - Municipal context
engine/periurban.py - Weather alerts
engine/alerts.py
API services
- FastAPI
backend/main.py - GAMC proxy
backend/gamc.py - Printable materials
backend/poster.py
Producer PWA
- PWA application
frontend/src/App.jsx - Producer mode
frontend/src/components/ProducerMode.jsx - Technical mode
frontend/src/components/TechnicalMode.jsx - Cochabamba map
frontend/src/components/maps/CochabambaMap.jsx
Offline and audio
- API client
frontend/src/services/apiClient.js - Device snapshot store
frontend/src/services/embeddedDb.js - Speech playback
frontend/src/services/speechService.js - Bilingual narration
frontend/src/services/narration.js - Quechua and Spanish TTS
etl/quechua_tts_client.py
Other components
- Producer
- NASA and climate sources
- Weather provider
- GAMC map services
Connections 26
- Producer → PWA application: uses
README.md - NASA and climate sources → Data harmonization: feeds
README.md - Data harmonization → Zone repository: harmonizes data
- Weather provider → Weather clients: supplies forecasts
etl/realtime_weather_client.py - Weather clients → FastAPI: provides weather
backend/main.py - District data → GAMC proxy: provides districts
- Zone repository → Rotation recommendations: supplies zones
engine/recommender.py - Rotation recommendations → Strategy scoring: scores strategies
engine/recommender.py - Rotation recommendations → Crop categories: uses categories
engine/recommender.py - Rotation recommendations → Municipal context: builds context
engine/recommender.py - FastAPI → Rotation recommendations: requests recommendations
backend/main.py - FastAPI → Weather alerts: evaluates alerts
backend/main.py - FastAPI → Printable materials: generates materials
backend/main.py - FastAPI → GAMC proxy: routes map requests
backend/main.py - PWA application → API client: fetches alerts
frontend/src/App.jsx - PWA application → Device snapshot store: loads snapshot
frontend/src/App.jsx - PWA application → GAMC proxy: requests map context
- PWA application → Producer mode: renders
frontend/src/App.jsx - PWA application → Technical mode: renders
frontend/src/App.jsx - PWA application → Cochabamba map: renders
frontend/src/App.jsx - API client → Device snapshot store: saves offline bundles
frontend/src/services/apiClient.js - API client → FastAPI: calls recommendations
frontend/src/services/apiClient.js - Cochabamba map → GAMC map services: queries map services
frontend/src/components/maps/CochabambaMap.jsx - Speech playback → Bilingual narration: builds narration
frontend/src/services/speechService.js - Speech playback → Quechua and Spanish TTS: requests generated audio
- FastAPI → Quechua and Spanish TTS: generates audio
backend/main.py