An AI-powered rural empowerment platform for Indian farmers
Features Architecture Detailed Tech Stack API Integration Roster Getting Started Support
Gram Vikash is an end-to-end AI platform that bridges the digital divide for rural farming communities in India. It enables farmers to access real-time weather, live mandi (market) prices, government scheme information, and an intelligent voice assistant in their native language including Telugu, Hindi, and English.
The platform relies on a dual-backend architecture combining Django for robust CRUD, authentication, and external REST integrations, alongside FastAPI to manage asynchronous, real-time audio WebSocket streams with Google's latest conversational AI models.
- Hum Bolo - Multilingual AI voice assistant powered by Gemini 2.5 Flash Native Audio.
- Fasal Doc - AI crop disease detection via photograph analysis.
- Market Rates - Live mandi and Minimum Support Price (MSP) tracking.
- Weather Forecast - Hyper-local weather aggregation with daily and hourly forecasting.
- Government Schemes - Curated scheme discovery tool covering PM-KISAN, Rythu Bandhu, and crop insurance frameworks.
- Emergency - One-tap field emergency service routing.
- Profile & Identity - Telephone-based OTP login with MSG91 and KYC document verification through DigiLocker.
- JWT-based stateless authentication over SimpleJWT.
- Async task queue managed by Celery and Redis.
- Direct AWS S3 integration for decentralized audio and crop imagery processing.
- Multi-app modular Django architecture incorporating
farmers,crops,market,weather,schemes, andemergencydomains.
- Real-time streaming audio ingestion utilizing Gemini Live.
- Built-in Server-side Voice Activity Detection (VAD) removing the need for manual turn management.
- Dynamic language auto-detection and fallback execution.
- Barge-in interruption capabilities measuring audio RMS energy.
- PSTN telephony bridging via Exotel WebSockets.
┌─────────────────────────────────────────────────────────────┐
│ Farmer's Mobile Device │
│ React Native App (Expo SDK 54) │
└────────────┬───────────────────────────┬────────────────────┘
│ REST (JWT) │ WebSocket
▼ ▼
┌────────────────────┐ ┌──────────────────────────────────┐
│ Django API :8000 │ │ FastAPI VoiceBot :8001 │
│ │ │ │
│ ┌──────────────┐ │ │ ┌──────────────────────────┐ │
│ │ farmers app │ │ │ │ Gemini Live (v1alpha) │ │
│ │ crops app │ │ │ │ gemini-2.5-flash-native │ │
│ │ market app │ │ │ │ Server-side VAD │ │
│ │ weather app │ │ │ └──────────────────────────┘ │
│ │ schemes app │ │ │ │
│ │ emergency app│ │ │ 16kHz PCM in -> 8kHz PCM out │
│ └──────────────┘ │ └──────────────────────────────────┘
│ │
│ Celery Workers │──── Redis (broker + cache)
│ Firebase Admin │
│ AWS S3 Storage │──── PostgreSQL (production)
└────────────────────┘ SQLite (local dev)
│
Nginx (reverse proxy, SSL termination)
- Framework: React Native
- Toolkit: Expo SDK 54 (Managed Workflow)
- State Management: Zustand
- Navigation: React Navigation (Stack and Bottom Tabs navigators)
- Storage: React Native MMKV (high-speed key/value store) and Expo Secure Store for JWT
- Media: Expo Audio/AV interfaces for recording microphone inputs
- Firebase:
@react-native-firebasepackages for authentication and push notifications integration - Styling: Custom StyleSheet architecture utilizing dynamic font implementations via Expo Google Fonts (Noto Sans Devanagari, Playfair Display, DM Sans, Lora)
- Framework: Django 5.1
- API Construct: Django REST Framework 3.15
- Authentication: DRF SimpleJWT
- Task Broker: Celery 5.4 with Redis 5.x
- Storage Strategy: Amazon AWS S3 via boto3
- Database: PostgreSQL (Production), SQLite (Development)
- Deployment Interface: Gunicorn proxying behind Nginx
- Language Detection:
langdetectlibrary - Voice Output: GenAI APIs and
gTTSwrapper integrations
- Framework: FastAPI 0.115
- Server Application: Uvicorn with ASGI architecture
- WebSockets: Native Python WebSockets for high-frequency streaming
- AI Integration: Google GenAI Python SDK (
google-genai) running thev1alphaLive streaming API. - Audio Processing: Unpacked bytes structuring utilizing
structand standard math operations to determine Root Mean Square (RMS) for hardware barge-in detection.
Gram Vikash merges data and functionality from multiple high-end third-party systems. Every API involved in the runtime is detailed below:
- Gemini Live WebSocket API (
genai.Client.aio.live.connect): Streams 16kHz continuous audio buffers synchronously between the user's microphone/PSTN and the Gemini 2.5 Flash Native Audio preview model. Executed in the FastAPI application. - Gemini Content Generation API (
genai.Client.models.generate_content): Executed in Django's Celery workers. Analyzes multi-modal input including agricultural photography for crop disease mapping and translates asynchronous audio clips. Models used include Gemini 3.1 Pro preview and Gemini 2.0 Flash.
- AgMarkNet (data.gov.in): Fetches real-time localized mandi wholesale prices. Queried serverside through Django REST frameworks (
api.data.gov.in/resource/...). Requires authentication token from Open Government Data Platform India.
- OpenWeatherMap One Call API 3.0: Aggregates hyper-local meteorological forecasts. Requested directly client-side from the React Native application (
api.openweathermap.org/data/3.0/onecall) using GPS latitude and longitude parameters.
- MSG91: Manages the primary login gateway through Indian telephone routing. Utilizes MSG91 React Native widget for the UI and Django POST verification against the MSG91 authentication key infrastructure.
- DigiLocker: Facilitates farmer KYC and credential mapping via Government of India digital storage formats. Integrates with Django
farmersapplication through standard OAuth 2.0 redirect flows. - Firebase Authentication: Handles device ID clustering, platform token bridging, and legacy login processes. Uses
@react-native-firebase/authandfirebase-adminpython structures.
- Exotel Media Stream API: Operates PSTN infrastructure. Connects outbound calls initiated by Django (
api.exotel.com/v1/Accounts/...) and binds the audio traffic into the FastAPI WebSocket listening port. - ElevenLabs API: Structured within the environment variable ecosystem to support optional high-quality local language Text-to-Speech fallbacks.
- AWS S3 API: Manages high-latency binary uploads. Configured with Django utilizing
boto3. Stores farmer disease-scan photos and long-form task-queue audio input/outputs securely inside theap-south-1region. - Google Firebase Cloud Messaging (FCM): Notifies agricultural alerts directly to the user's mobile device via background syncing.
| Toolkit | Minimum Required Version |
|---|---|
| Python | 3.11+ |
| Node.js | 20+ |
| npm | 9+ |
| Docker | 24+ |
- Clone the repository
git clone https://github.com/HarshavardhanVemali/gram-vikash.git
cd gram-vikash- Establish Configuration
Duplicate local environment templates and apply production keys. Ensure to read
gramvikash_api/.env.exampleandgramvikash/.env.exampleto review required tokens.
cp gramvikash_api/.env.example gramvikash_api/.env
cp gramvikash/.env.example gramvikash/.env- Initialize Backend Services Starting the backend relies on Docker to standardize dependencies like Postgres and Redis alongside Django.
docker compose up --buildAlternatively, you can run services bare-metal utilizing the provided start_local.sh initialization file.
- Boot the React Native Frontend
cd gramvikash
npm install
npx expo startUse Expo Go to test live on mobile hardware.
The core application guidelines, commit restrictions, security protocols, and further deep-dive documentation are found throughout the local repository files (GUIDE.md, CONTRIBUTING.md, SECURITY.md).
For any further inquiries, technical problems, deployment assistance, or organizational deployment queries, please contact:
Developed for the advancement of rural agriculture.