Jalsakhi Ai Powered Precision Agriculture Platform
Village Water Allocation Optimization API Distributes limited village reservoir water across farms using: - Crop Water Requirement from CropWaterModel (Model 1) - Optional predicte...
Technical Architecture & Engineering Overview
Detailed system design and core implementation
Frontend built with React. Backend API powered by FastAPI, Express. AI/ML capabilities powered by LangChain. Persistence managed by MongoDB.
System Diagrams & Flow Visualizations
Interactive Mermaid architecture & execution flows
Core System Features
Key capabilities & architectural features
- OTP‑based email verification for secure sign‑up.
- OTP‑based email verification for secure sign‑up.
- Role‑based JWT authentication (farmer & admin).
- Role‑based JWT authentication (farmer & admin).
- CRUD operations for farm entities with geo‑location support.
- CRUD operations for farm entities with geo‑location support.
- AI‑driven crop water requirement prediction (Random Forest).
- AI‑driven crop water requirement prediction (Random Forest).
- 7‑day soil moisture forecasting using Prophet and LSTM.
- 7‑day soil moisture forecasting using Prophet and LSTM.
- Village‑level water allocation optimizer integrating farmer demand.
- Village‑level water allocation optimizer integrating farmer demand.
- Real‑time AI chatbot powered by LangChain and Llama 3.1.
- Real‑time AI chatbot powered by LangChain and Llama 3.1.
- Centralized ML gateway with rate limiting and health checks.
- Centralized ML gateway with rate limiting and health checks.
- Exportable data endpoints for analytics dashboards.
- Exportable data endpoints for analytics dashboards.
- Environment‑agnostic configuration via `.env` files.
- Environment‑agnostic configuration via `.env` files.
Engineering Challenges & Solutions
Problem statements & resolution strategies
- Balancing latency between mobile requests and Python FastAPI models; introduced async proxying in the gateway.
- Balancing latency between mobile requests and Python FastAPI models; introduced async proxying in the gateway.
- Managing consistent schema versions across MongoDB and FastAPI input validation.
- Managing consistent schema versions across MongoDB and FastAPI input validation.
- Securing inter‑service communication without a full service mesh; used API keys and JWT propagation.
- Securing inter‑service communication without a full service mesh; used API keys and JWT propagation.
- Handling large payloads for sensor‑based soil data while respecting the 1 MB body size limit.
- Handling large payloads for sensor‑based soil data while respecting the 1 MB body size limit.
- Coordinating deployment of heterogeneous runtimes (Node.js vs Python) on Azure.
- Coordinating deployment of heterogeneous runtimes (Node.js vs Python) on Azure.
API Reference & Endpoints
REST API surface & route documentation
| METHOD | ENDPOINT PATH | DESCRIPTION | COPY |
|---|---|---|---|
| GET | /health | Endpoint defined in ml-services/chatbot/api.py | |
| POST | /chat | Endpoint defined in ml-services/chatbot/api.py | |
| POST | /model1 | Endpoint defined in ml-services/gateway/server.js | |
| POST | /model2 | Endpoint defined in ml-services/gateway/server.js | |
| POST | /model3 | Endpoint defined in ml-services/gateway/server.js | |
| POST | /predict | Endpoint defined in ml-services/models/Crop_Water_Model/main.py | |
| GET | /config | Endpoint defined in ml-services/models/Crop_Water_Model/main.py | |
| GET | / | Endpoint defined in ml-services/models/soil_moisture_model/api.py | |
| GET | /ui | Endpoint defined in ml-services/models/soil_moisture_model/api.py | |
| POST | /predict/sensor | Endpoint defined in ml-services/models/soil_moisture_model/api.py | |
| POST | /predict/location | Endpoint defined in ml-services/models/soil_moisture_model/api.py | |
| POST | /optimize | Endpoint defined in ml-services/models/village_water_allocation/api.py | |
| POST | /register | Endpoint defined in server/routes/authRoutes.js | |
| POST | /login | Endpoint defined in server/routes/authRoutes.js | |
| POST | /logout | Endpoint defined in server/routes/authRoutes.js | |
| POST | /send-verify-otp | Endpoint defined in server/routes/authRoutes.js | |
| POST | /verify-account | Endpoint defined in server/routes/authRoutes.js | |
| GET | /is-auth | Endpoint defined in server/routes/authRoutes.js | |
| POST | /send-reset-otp | Endpoint defined in server/routes/authRoutes.js | |
| POST | /reset-password | Endpoint defined in server/routes/authRoutes.js | |
| GET | /:id | Endpoint defined in server/routes/farmRoutes.js | |
| POST | / | Endpoint defined in server/routes/farmRoutes.js | |
| PUT | /:id | Endpoint defined in server/routes/farmRoutes.js | |
| DELETE | /:id | Endpoint defined in server/routes/farmRoutes.js | |
| POST | /:id/irrigation | Endpoint defined in server/routes/farmRoutes.js | |
| GET | /:id/irrigation | Endpoint defined in server/routes/farmRoutes.js | |
| POST | /crop-water | Endpoint defined in server/routes/mlRoutes.js | |
| POST | /soil-moisture | Endpoint defined in server/routes/mlRoutes.js | |
| POST | /village-water | Endpoint defined in server/routes/mlRoutes.js | |
| GET | /data | Endpoint defined in server/routes/userRoutes.js |
Key Code Modules & Architecture
Core file entrypoints and service responsibilities
app/appModule component managing app source logic
app/componentsModule component managing components source logic
app/components/uiModule component managing ui source logic
app/scriptsModule component managing scripts source logic
app/servicesModule component managing services source logic
app/utilsModule component managing utils source logic
docsModule component managing docs source logic
server/modelsModule component managing models source logic
serverModule component managing server source logic
server/configModule component managing config source logic
server/controllersModule component managing controllers source logic
server/middlewareModule component managing middleware source logic
server/routesModule component managing routes source logic
User Journey Pipeline
- 1User accesses application user interface via browser
- 2User triggers action invoking HTTP/WebSocket API endpoints
- 3Payload processed through AI/ML pipeline or local inference model
- 4Data persisted or retrieved from database storage layer
Execution Code Flow
- 1Client or caller initiates request to application entrypoint
- 2Backend router validates request parameters and applies middleware
- 3Service layer delegates task to ML runtime or LLM API worker
- 4Database ORM/client executes storage query
- 5Application serializes JSON/audio/data response back to client
System FAQ & Technical Specifications
Frequently asked questions and core architecture details
Q: What technologies are used in Jalsakhi Ai Powered Precision Agriculture Platform?
Jalsakhi Ai Powered Precision Agriculture Platform is engineered using modern full-stack frameworks.
Q: What core engineering problem does Jalsakhi Ai Powered Precision Agriculture Platform solve?
Village Water Allocation Optimization API Distributes limited village reservoir water across farms using: - Crop Water Requirement from CropWaterModel (Model 1) - Optional predicte...
Q: How is '- Balancing latency between mobile requests and Python FastAPI models; introduced async proxying in the gateway.' resolved in Jalsakhi Ai Powered Precision Agriculture Platform?
Resolved through specialized system architecture and resilient state handling.
Related Systems & Case Studies
Explore similar technical architectures and projects