How iamgojoof6eyes/farmersfeedback works
AjraSakha is a farmer-feedback and answer-quality system for the AjraSakha agricultural advisory bot. Farmers submit WhatsApp text, quick replies, or voice feedback; the backend associates feedback with knowledge-base answers, tracks sessions and metrics, and flags poor-performing answers for agronomist review. The dashboard exposes analytics, resolution, catalog, digest, and weather views. Evidence includes README capabilities and indexed imports, but several feature modules were not sampled, so their internal call paths are not asserted.
Main entry points: main.py FastAPI application · App.tsx Dashboard routes · database.py MongoDB collections · flagging_pipeline.py Statistical flagging
Components 29
Review dashboard
- Dashboard routes
frontend/src/App.tsx - Dashboard state
frontend/src/store/slices/feedbackSlice.ts - API client
frontend/src/services/api.ts - Analytics view
frontend/src/components/AnalyticsView.tsx - Flagged queue
frontend/src/components/FlaggedQueueView.tsx - WhatsApp simulator
frontend/src/components/TwilioWhatsAppView.tsx - GDB catalog
frontend/src/components/GdbCatalogView.tsx - Weekly bulletin
frontend/src/components/WeeklyDigestView.tsx - Weather advisories
frontend/src/components/WeatherAdvisoryView.tsx
Backend API
- FastAPI application
backend/app/main.py - Runtime settings
backend/app/config.py - MongoDB collections
backend/app/database.py - Scheduled jobs
helpers/scheduler.py
Feedback quality
- Flagged review endpoints
backend/app/routers/flagged.py - Statistical flagging
helpers/flagging_pipeline.py - Answer generation
helpers/nvidia_service.py - Knowledge catalog endpoints
backend/app/routers/gdb.py
Farmer messaging
- WhatsApp endpoints
backend/app/routers/whatsapp.py - Interaction processing
helpers/whatsapp_service.py - Twilio messaging
helpers/twilio_service.py - Session and feedback
helpers/session_pipeline.py - Voice feedback NLP
helpers/voice_nlp_service.py
Insights and advisories
- Analytics endpoints
backend/app/routers/analytics.py - Digest endpoints
backend/app/routers/digest.py - Digest generation
helpers/digest_service.py - Weather endpoints
backend/app/routers/weather.py - Weather risk service
helpers/weather_service.py
Other components
- Farmer
- Agronomist
Connections 43
- Dashboard routes → Dashboard state: dispatches
frontend/src/App.tsx - Dashboard state → API client: requests data
frontend/src/store/slices/feedbackSlice.ts - Dashboard routes → Analytics view: routes to
frontend/src/App.tsx - Dashboard routes → Flagged queue: routes to
frontend/src/App.tsx - Dashboard routes → WhatsApp simulator: routes to
frontend/src/App.tsx - Dashboard routes → GDB catalog: routes to
frontend/src/App.tsx - Dashboard routes → Weekly bulletin: routes to
frontend/src/App.tsx - Dashboard routes → Weather advisories: routes to
frontend/src/App.tsx - FastAPI application → WhatsApp endpoints: registers
backend/app/main.py - FastAPI application → Knowledge catalog endpoints: registers
backend/app/main.py - FastAPI application → Analytics endpoints: registers
backend/app/main.py - FastAPI application → Flagged review endpoints: registers
backend/app/main.py - FastAPI application → Digest endpoints: registers
backend/app/main.py - FastAPI application → Weather endpoints: registers
backend/app/main.py - FastAPI application → MongoDB collections: initializes
backend/app/main.py - FastAPI application → Scheduled jobs: starts
backend/app/main.py - WhatsApp endpoints → Interaction processing: processes interaction
backend/app/routers/whatsapp.py - WhatsApp endpoints → Session and feedback: creates sessions
backend/app/routers/whatsapp.py - WhatsApp endpoints → Twilio messaging: sends messages
backend/app/routers/whatsapp.py - Interaction processing → MongoDB collections: reads and writes
helpers/whatsapp_service.py - Interaction processing → Statistical flagging: evaluates answers
helpers/whatsapp_service.py - Interaction processing → Voice feedback NLP: analyzes voice
helpers/whatsapp_service.py - Session and feedback → MongoDB collections: updates records
helpers/session_pipeline.py - Session and feedback → Statistical flagging: evaluates answers
helpers/session_pipeline.py - Session and feedback → Twilio messaging: notifies farmer
helpers/session_pipeline.py - Flagged review endpoints → Statistical flagging: runs review pipeline
backend/app/routers/flagged.py - Flagged review endpoints → MongoDB collections: reads and writes
backend/app/routers/flagged.py - Statistical flagging → MongoDB collections: scores entries
helpers/flagging_pipeline.py - Statistical flagging → Answer generation: generates replacements
helpers/flagging_pipeline.py - Knowledge catalog endpoints → MongoDB collections: reads catalog
backend/app/routers/gdb.py - Analytics endpoints → MongoDB collections: serves metrics
- Digest endpoints → Digest generation: requests digest
backend/app/routers/digest.py - Weather endpoints → Weather risk service: requests advisories
backend/app/routers/weather.py - Scheduled jobs → Statistical flagging: schedules scans
helpers/scheduler.py - Scheduled jobs → Session and feedback: schedules nudges
helpers/scheduler.py - Farmer → WhatsApp endpoints: sends feedback
README.md - Agronomist → Flagged queue: reviews answers
README.md - WhatsApp simulator → FastAPI application: simulates interaction
- Analytics view → FastAPI application: loads metrics
- Flagged queue → FastAPI application: submits revisions
- GDB catalog → FastAPI application: loads catalog
- Weekly bulletin → FastAPI application: loads bulletin
- Weather advisories → FastAPI application: loads advisories