How manojadithyareddy/agrifusion-ai works
AgriFusion AI is a farmer-facing agriculture intelligence product with a separate administrator experience. Farmers use the web app to request crop recommendations, yield and market outlooks, weather information, scheme guidance, crop-health diagnosis, and agricultural assistance; administrators manage users, datasets, models, predictions, analytics, audit logs, and settings. The tree and excerpts establish the application routing, backend router registration, local prediction and vision engines, and RAG persistence. Most individual router-to-service wiring is not shown, so those links are omitted.
Main entry points: main.py FastAPI app · AppRoutes.tsx App routes · App.tsx Web app · rag_service.py RAG service
Components 30
Web application
- Web app
frontend/src/App.tsx - App routes
frontend/src/routes/AppRoutes.tsx - Farmer pages
frontend/src/pages - Admin pages
frontend/src/pages/admin - Auth context
frontend/src/context/AuthContext.tsx - API client
frontend/src/api/client.ts
API and domain
- FastAPI app
backend/app/main.py - Prediction routes
backend/app/routers/v1/predictions.py - Vision routes
backend/app/routers/v1/vision.py - Assistant routes
backend/app/routers/v1/assistant.py - Auth routes
backend/app/routers/v1/auth.py - Weather routes
backend/app/routers/v1/weather.py - Schemes routes
backend/app/routers/v1/schemes.py - Geography routes
backend/app/routers/v1/geography.py - Soil health routes
backend/app/routers/v1/soil_health.py
Agriculture intelligence
- Crop recommendation
backend/app/ml/inference/crop_recommendation.py - Prediction service
backend/app/services/prediction.py - Vision service
backend/app/services/vision.py - CV engine
backend/app/cv/cnn_engine.py - Assistant CV
backend/app/services/assistant_vision_engine.py - RAG service
backend/app/nlp/rag_service.py - Assistant agent
backend/app/nlp/assistant_ai_agent.py - Weather service
backend/app/services/weather.py - Schemes service
backend/app/services/schemes.py - Soil health service
backend/app/services/soil_health.py
Persistence
- Relational database
backend/app/database.py - RAG records
backend/app/models/rag.py - pgvector store
Other components
- Farmer
- Administrator
Connections 18
- Farmer → Web app: uses
- Administrator → Web app: uses
- Web app → App routes: renders
- Web app → Auth context: provides auth
- App routes → Farmer pages: routes to
- App routes → Admin pages: routes to
- App routes → Auth context: checks access
- FastAPI app → Prediction routes: registers
- FastAPI app → Vision routes: registers
- FastAPI app → Assistant routes: registers
- FastAPI app → Auth routes: registers
- FastAPI app → Weather routes: registers
- FastAPI app → Schemes routes: registers
- FastAPI app → Geography routes: registers
- FastAPI app → Soil health routes: registers
- RAG service → Relational database: persists records
- RAG service → pgvector store: indexes chunks
- RAG service → pgvector store: retrieves context