KhedutMitra is a sophisticated full-stack rural intelligence platform designed for farmer-centric risk monitoring, advisory delivery, and operational excellence. It empowers institutions with real-time data, predictive analytics, and automated communication tools to support rural communities effectively.
Advanced risk scoring engine that computes vulnerability based on:
- Climate Risk: Real-time and historical weather patterns.
- Soil Suitability: Compatibility analysis for specific crops.
- Financial Risk: Loan status, insurance coverage, and market factors.
- Social Risk: Household and demographic indicators.
- Real-time weather monitoring on district levels.
- Intelligent caching strategy to prevent redundant API calls.
- Weather-aware advisories generated for specific crop cycles.
- Dynamic Metrics: Live tracking of average vulnerability scores and unique district reaches.
- Heatmaps: District-wise visualization of risk factors using Leaflet.
- Actionable Insights: Categorized alerts (Critical, High, Medium, Low) for field teams.
- Automated advisory delivery and farmer engagement via Twilio.
- Assisted response flow for conversation tracking.
- Bulk alert generation and status management.
- Computer Vision: Crop disease detection from farmer-uploaded photos using Llama-3 Vision models via Groq.
- Multilingual Support: Instant analysis and advice in Gujarati, Hindi, and English.
- Automatic Logging: Detected issues are automatically logged into the central database for field officer follow-ups.
- Rural Accessibility: Integrated Text-to-Speech (TTS) using Azure Speech Service to convert agricultural advisories into spoken audio.
- Localized Voices: Support for natural-sounding neural voices in Gujarati, Hindi, and English.
- Interactive Engagement: Hybrid interaction model combining text, images, and audio for maximum reach.
- Native support for English, Gujarati, and Hindi.
- Seamless UI localization across all modules (Dashboard, Profile, Alerts).
- Domain-Specific Modeling: Tailored farmer intelligence rather than generic CRM behavior.
- Field-Ready Profiles: Combines agronomy and finance into a single, actionable entity.
- Hybrid Advisory: Merges weather data, risk scoring, and automated alerting.
- Institutional Focus: Dashboards designed for scale, supporting both field officers and superadmins.
- Modular Architecture: Clean isolation of domains into controller/route/service layers.
GenAI-Rural_Intelligence_Platform/
βββ backend/ # Express.js Server
β βββ src/
β β βββ config/ # App configuration
β β βββ db/ # Migrations, Seeds, and Setup
β β β βββ migrations/
β β β βββ migrate.js
β β β βββ seed.js
β β β βββ setup.js
β β βββ middleware/ # Auth, Logging, Validation
β β βββ modules/ # Domain-driven modules
β β β βββ alerts/
β β β βββ auth/
β β β βββ crops/
β β β βββ dashboard/
β β β βββ disease/
β β β βββ farmers/
β β β βββ institutions/
β β β βββ locations/
β β β βββ schemes/
β β β βββ translation/
β β β βββ users/
β β β βββ vulnerability/
β β β βββ weather/
β β β βββ whatsapp/
β β β βββ function-docs/
β β βββ utils/ # Shared Helpers
β βββ server.js # API Entry Point
βββ frontend/ # React Vite Application
β βββ src/
β β βββ api/ # TanStack Query Hooks
β β βββ components/ # UI Design System
β β βββ hooks/ # Custom React Hooks
β β βββ pages/ # Feature Views (Dashboard, Map, Farmers)
β β βββ router/ # App Routing
β β βββ store/ # Global State (Zustand)
β β βββ utils/ # Frontend Helpers
β βββ vite.config.js # Build Configuration
βββ README.md
- Node.js v20 or higher
- PostgreSQL (running locally or via cloud)
- Go to the
backendfolder. - Install dependencies:
npm install - Configure environment variables in
.env(DATABASE_URL, JWT_SECRET, etc.). - Initialize DB (schema + seed):
npm run db:setup - Start server:
npm run dev
- Go to the
frontendfolder. - Install dependencies:
npm install - Configure
VITE_API_BASE_URLin.env. - Start app:
npm run dev
- Migrations: Include base schema, WhatsApp sessions, farmer sequences, and extended profile fields.
- Smart Seeding: The seed script populates farmers with complete agronomic and financial data, ensuring edit forms display realistic values immediately.
- Auto-Generated: Detailed per-function documentation is located in
backend/src/modules/function-docs. - Index: See
backend/src/modules/function-docs/README.mdfor a complete overview of controller/service logic. - Maintenance: To regenerate, rerun the documentation workflow assigned to backend modules.
/api/auth- Authentication & Refresh Tokens/api/users- User Management & RBAC/api/institutions- Organization Management/api/farmers- Profile CRUD & Life-cycle/api/crops- Crop Catalog & Suitability/api/vulnerability- FVI Calculation Engine/api/schemes- Matching & Eligibility/api/alerts- Operational Monitoring/api/dashboard- Real-time Analytics/api/disease- AI Disease Detection/api/locations- District/Taluka Assets/api/translate- Multilingual Logic/api/whatsapp- Twilio Messaging & Voice Assistant/api/telegram- GenAI Telegram Bot
- Stateful Sessions: JWT with integrated refresh flow for secure, long-lived sessions.
- Input Validation: Strict Joi schemas for all inbound requests.
- Error Handling: Centralized response normalization and logging.
- Weather Reliability: Caching strategy with smart refresh to maintain advisory context.
- Keep migrations forward-only and idempotent.
- Ensure
vulnerabilityweightages are updated in synchronization with institutional policies.
This project is for internal institutional use. Contact the administrator for licensing policies.