How nirsen117/agriai works
Agro AI is a mobile-first agricultural decision-support app. A farmer signs in, enters farm and location details, then views farm conditions and recommendations or requests crop-image triage and farm chat; the frontend sends requests to FastAPI, which combines normalized provider data with advisory logic. The product also offers diagnosis history, field mapping, multilingual UI, and an interoperability data feed. The graph follows documented capabilities and sampled imports/calls; some route-level wiring and unsampled implementations are represented only where the README supports them.
Main entry points: main.py FastAPI routes · App.tsx Farm workspace · api.ts API client · firebaseAuth.ts Firebase auth client
Components 22
Farmer experience
- Farm workspace
frontend/src/App.tsx - Sign-in dialog
frontend/src/AuthModal.tsx - UI translations
frontend/src/i18n.ts - API client
frontend/src/api.ts - Farm profile sync
frontend/src/farmStore.ts - Diagnosis history
frontend/src/diagnosisHistory.ts
Application API
- FastAPI routes
backend/app/main.py - Request and response models
backend/app/schemas.py - Farm profile storage
backend/app/main.py
Farm decision support
- Advisory rules
backend/app/advisory.py - Interoperability feed
backend/app/interoperability.py
Providers and integrations
- Firebase auth client
frontend/src/firebaseAuth.ts - Firebase services
- Weather provider
backend/app/providers.py - Soil provider
backend/app/providers.py - Satellite provider
backend/app/providers.py - AI and disease adapters
backend/app/providers.py
Other components
- Farmer
- Open-Meteo
- Bhuvan LULC
- Gemini
- OpenStreetMap
Connections 26
- Farmer → Farm workspace: uses
README.md - Farm workspace → API client: requests data
frontend/src/App.tsx - Farm workspace → Sign-in dialog: opens sign-in
frontend/src/App.tsx - Sign-in dialog → Firebase auth client: authenticates
frontend/src/AuthModal.tsx - API client → Firebase auth client: gets token
frontend/src/api.ts - Firebase auth client → Firebase services: signs in
frontend/src/firebaseAuth.ts - API client → Farm profile sync: syncs profile
frontend/src/api.ts - Farm profile sync → Firebase services: loads and saves
- Farm workspace → UI translations: localizes UI
frontend/src/App.tsx - Farm workspace → Diagnosis history: saves diagnosis
frontend/src/App.tsx - Diagnosis history → Firebase services: reads and writes
frontend/src/diagnosisHistory.ts - API client → FastAPI routes: calls routes
README.md - FastAPI routes → Request and response models: validates data
backend/app/main.py - FastAPI routes → Farm profile storage: reads and writes
backend/app/main.py - FastAPI routes → Weather provider: requests weather
README.md - FastAPI routes → Soil provider: requests soil
README.md - FastAPI routes → Satellite provider: requests land cover
README.md - FastAPI routes → AI and disease adapters: requests AI triage
README.md - FastAPI routes → Advisory rules: builds advice
backend/app/main.py - FastAPI routes → Interoperability feed: normalizes farm data
backend/app/main.py - Weather provider → Open-Meteo: fetches forecast
README.md - Soil provider → Open-Meteo: fetches soil moisture
README.md - Satellite provider → Bhuvan LULC: fetches LULC stats
README.md - AI and disease adapters → Gemini: requests AI
README.md - Farm workspace → Bhuvan LULC: displays map layer
README.md - Farm workspace → OpenStreetMap: displays street map
README.md