How chirag0071/farmora-ai works
Farmora combines a Streamlit interface with a FastAPI service for Indian crop-market insights. The user selects a location, crop, cost, and optional historical date; the prediction page stores those inputs and opens results, which request market history and display prices, forecasts, and profitability. Results also request mapped market locations and crop suggestions. The backend fetches and normalizes Agmarknet data, then derives forecasts, coordinates, or recommendation scores. API routes and service calls are evidenced in excerpts; home/about and some backend behavior are only partly sampled, so their connections are omitted where unverified.
Main entry points: main.py FastAPI routes · app.py Navigation shell · predict.py Prediction inputs · result.py Results dashboard
Components 16
Streamlit interface
- Navigation shell
app.py - Home and info
pages/home.py - Usage help
pages/help.py - Prediction inputs
pages/predict.py - Crop catalog
utils/crops.py - Results dashboard
pages/result.py - Suggestion view
pages/suggestions.py
API orchestration
- FastAPI routes
backend/main.py
Market data
- Price history
backend/services/agmarknet.py - Agmarknet API
Market insights
- Price forecasting
backend/services/forecasting.py - Market geocoding
backend/services/geocoding.py - Nominatim
- Crop recommendations
backend/services/recommendations.py
Other components
- Farmer
- Location lookup API
Connections 22
- Farmer → Navigation shell: opens
app.py - Navigation shell → Home and info: navigates
app.py - Navigation shell → Usage help: navigates
app.py - Navigation shell → Prediction inputs: navigates
app.py - Navigation shell → Results dashboard: routes to
app.py - Navigation shell → Suggestion view: routes to
app.py - Prediction inputs → Farmer: collects inputs
pages/predict.py - Prediction inputs → Crop catalog: uses catalog
pages/predict.py - Prediction inputs → Location lookup API: fetches locations
pages/predict.py - Prediction inputs → Results dashboard: switches page
pages/predict.py - Results dashboard → FastAPI routes: requests history
pages/result.py - FastAPI routes → Price history: loads and filters
backend/main.py - Price history → Agmarknet API: fetches records
backend/services/agmarknet.py - FastAPI routes → Price forecasting: forecasts prices
backend/main.py - Results dashboard → FastAPI routes: requests locations
pages/result.py - FastAPI routes → Market geocoding: gets locations
backend/main.py - Market geocoding → Price history: loads market history
backend/services/geocoding.py - Market geocoding → Nominatim: geocodes markets
backend/services/geocoding.py - Results dashboard → FastAPI routes: requests suggestions
pages/result.py - Suggestion view → FastAPI routes: requests suggestions
pages/suggestions.py - FastAPI routes → Crop recommendations: gets suggestions
backend/main.py - Crop recommendations → Price history: fetches records
backend/services/recommendations.py