How kulkarniparth30/kisansetu works
KisanSetu is a multilingual agriculture platform for farmers. Signed-in users reach diagnosis, remedy chat, markets, weather, crop calendar, history, soil-health, farmer, and hotspot features through the React app; the pages call a FastAPI backend. The central diagnostic path accepts a leaf image, uses Gemini with a ResNet fallback, and can provide ICAR-grounded follow-up guidance. Other documented capabilities include nearby disease alerts and voice IVR. The route registration and selected service calls are evidenced in excerpts; several feature internals were not sampled, so their implementation links are omitted.
Main entry points: main.py FastAPI app · App.jsx App routing · api.js API client · supabase_client.py Supabase access
Components 34
Farmer app
- App routing
frontend/src/App.jsx - Diagnosis page
frontend/src/pages/DiagnosisPage.jsx - Chat page
frontend/src/pages/ChatPage.jsx - Hotspot dashboard
frontend/src/pages/DashboardPage.jsx - Crop calendar
frontend/src/pages/CalendarPage.jsx - Diagnosis history
frontend/src/pages/HistoryPage.jsx - Mandi prices
frontend/src/pages/MandiPage.jsx - Weather risk
frontend/src/pages/WeatherPage.jsx - Farmer network
frontend/src/pages/FarmerPage.jsx - API client
frontend/src/services/api.js
API routes
- FastAPI app
backend/app/main.py - Disease route
backend/app/api/predict.py - Remedy route
backend/app/api/remedy.py - Heatmap route
backend/app/api/heatmap.py - Calendar route
backend/app/api/calendar.py - History route
backend/app/api/history.py - Market route
backend/app/api/mandi.py - Weather route
backend/app/api/weather.py - Farmers route
backend/app/api/farmers.py - Alert route
backend/app/api/alerts.py - Soil health route
backend/app/api/soil.py - Voice IVR route
backend/app/api/ivr.py
Diagnosis and advice
- Gemini diagnosis and chat
backend/app/services/gemini_service.py - ResNet inference
backend/app/services/resnet_service.py - ICAR knowledge retrieval
backend/app/services/rag_service.py
Farm operations
- Supabase access
backend/app/supabase_client.py - Nearby SMS alerts
backend/app/services/alert_service.py - Nearby farmer distance
backend/app/utils/haversine.py - Soil PDF reports
backend/app/services/report_service.py - Weather risk service
backend/app/services/weather_service.py - Market data service
backend/app/config.py
Other components
- Farmer
- Gemini API
- Twilio SMS
Connections 45
- Farmer → App routing: uses
frontend/src/App.jsx - App routing → Diagnosis page: routes to
frontend/src/App.jsx - App routing → Chat page: routes to
frontend/src/App.jsx - App routing → Hotspot dashboard: routes to
frontend/src/App.jsx - App routing → Crop calendar: routes to
frontend/src/App.jsx - App routing → Diagnosis history: routes to
frontend/src/App.jsx - App routing → Mandi prices: routes to
frontend/src/App.jsx - App routing → Weather risk: routes to
frontend/src/App.jsx - App routing → Farmer network: routes to
frontend/src/App.jsx - Diagnosis page → API client: requests
frontend/src/pages/DiagnosisPage.jsx - Chat page → API client: requests
frontend/src/pages/ChatPage.jsx - Hotspot dashboard → API client: requests
frontend/src/pages/DashboardPage.jsx - Crop calendar → API client: requests
frontend/src/pages/CalendarPage.jsx - Diagnosis history → API client: requests
frontend/src/pages/HistoryPage.jsx - Mandi prices → API client: requests
frontend/src/pages/MandiPage.jsx - Weather risk → API client: requests
frontend/src/pages/WeatherPage.jsx - API client → FastAPI app: calls API
- FastAPI app → Disease route: registers route
backend/app/main.py - FastAPI app → Remedy route: registers route
backend/app/main.py - FastAPI app → Heatmap route: registers route
backend/app/main.py - FastAPI app → Calendar route: registers route
backend/app/main.py - FastAPI app → History route: registers route
backend/app/main.py - FastAPI app → Market route: registers route
backend/app/main.py - FastAPI app → Weather route: registers route
backend/app/main.py - FastAPI app → Farmers route: registers route
backend/app/main.py - FastAPI app → Alert route: registers route
backend/app/main.py - FastAPI app → Soil health route: registers route
backend/app/main.py - FastAPI app → Voice IVR route: registers route
backend/app/main.py - Disease route → Gemini diagnosis and chat: calls diagnosis
backend/app/api/predict.py - Disease route → ResNet inference: uses fallback
backend/app/api/predict.py - Disease route → Supabase access: persists results
backend/app/api/predict.py - Remedy route → Gemini diagnosis and chat: requests advice
backend/app/api/remedy.py - Gemini diagnosis and chat → ICAR knowledge retrieval: queries context
backend/app/services/gemini_service.py - Gemini diagnosis and chat → Gemini API: generates with
- Farmers route → Supabase access: reads farmers
backend/app/api/farmers.py - Farmers route → Nearby farmer distance: calculates proximity
backend/app/api/farmers.py - Alert route → Nearby SMS alerts: dispatches
backend/app/api/alerts.py - Nearby SMS alerts → Supabase access: loads farmers
backend/app/services/alert_service.py - Nearby SMS alerts → Nearby farmer distance: finds nearby
backend/app/services/alert_service.py - Nearby SMS alerts → Twilio SMS: sends SMS
- Heatmap route → Supabase access: reads detections
backend/app/api/heatmap.py - Soil health route → Supabase access: stores usage
backend/app/api/soil.py - Soil health route → Soil PDF reports: creates reports
backend/app/api/soil.py - Weather route → Weather risk service: uses risk data
- Market data service → Market route: configures API
backend/app/api/mandi.py