KrishiSaathi is a full-stack AgriTech platform connecting farmers and buyers with AI-powered crop disease detection, real-time bidding, digital marketplace, insurance, and multilingual support.
| Feature | Description |
|---|---|
| π€ AI Disease Detection | Upload a leaf photo β CNN model detects disease & gives treatment |
| π Digital Marketplace | Farmers list crops; buyers browse & bid in real-time |
| π¦ Order Management | Full order lifecycle with payment via Razorpay |
| π¦οΈ Agri Store | Buy seeds, fertilizers, tools from a curated store |
| π‘οΈ Crop Insurance | Browse and apply for government/private insurance schemes |
| π¬ AI Chat Support | 24/7 AI-powered farming assistant |
| π° Krishi Samachar | Live agricultural news & market price updates |
| π Multilingual | English, Hindi, Marathi support with i18next |
| ποΈ Voice Commands | Voice-based crop upload and navigation |
KrishiSaathi/
βββ src/ # React 19 + Vite frontend
β βββ pages/ # All route pages (LandingPage, DiseaseDetectionPage, etc.)
β βββ components/ # Reusable UI components
β βββ services/ # Axios API clients
β βββ context/ # AuthContext (JWT-based auth)
β βββ hooks/ # Custom React hooks
β βββ locales/ # i18n translation files (en, hi, mr)
β
βββ server/ # Node.js + Express backend (Port 8000)
β βββ routes/ # API routes (auth, crops, detection, ordersβ¦)
β βββ controllers/ # Business logic
β βββ models/ # Mongoose schemas (User, Crop, Order, Detectionβ¦)
β βββ middlewares/ # JWT auth, rate limiting, error handling
β βββ services/ # External integrations (Cloudinary, Razorpay)
β
βββ AI-Service/ # Python FastAPI AI microservice (Port 5000)
βββ app.py # FastAPI server with /predict and /health endpoints
βββ train.py # MobileNetV2 transfer learning training script
βββ treatments.json # Treatment database for 38 disease classes
βββ requirements.txt # Python dependencies
- Node.js β₯ 18
- Python β₯ 3.10
- MongoDB (local or Atlas)
- Git
git clone https://github.com/yash4515/KrishiSaathi.git
cd KrishiSaathi# Install frontend dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env and set VITE_API_URL=http://localhost:8000/api
# Start development server
npm run dev
# β Runs on http://localhost:5173cd server
npm install
# Create environment file
cp .env.example .env
# Fill in MongoDB URI, JWT secret, Cloudinary, Razorpay keys
# Start backend server
npm start
# β Runs on http://localhost:8000cd AI-Service
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txt
# Start AI microservice (Demo Mode - no model needed)
uvicorn app:app --host 0.0.0.0 --port 5000
# β Runs on http://localhost:5000# First, download the PlantVillage dataset
git clone https://github.com/spMohanty/PlantVillage-Dataset
mv PlantVillage-Dataset/raw AI-Service/raw
# Train the model (requires ~2β4 hours on CPU, ~30 min with GPU)
cd AI-Service
python train.py
# Model saved to AI-Service/model/plant_disease_model.h5VITE_API_URL=http://localhost:8000/apiPORT=8000
NODE_ENV=production
MONGODB_URI=mongodb+srv://<user>:<pass>@cluster.mongodb.net/krishisaathi
JWT_SECRET=your_strong_jwt_secret
JWT_EXPIRES_IN=7d
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
RAZORPAY_KEY_ID=your_razorpay_key
RAZORPAY_KEY_SECRET=your_razorpay_secret
CLIENT_URL=https://your-frontend-domain.com- Import the repo on vercel.com
- Set Root Directory to
/(project root) - Set Build Command:
npm run build - Set Output Directory:
dist - Add environment variable:
VITE_API_URL=https://your-backend.onrender.com/api - Deploy!
- Create a Web Service on render.com
- Connect the GitHub repo
- Set Root Directory:
server - Set Build Command:
npm install - Set Start Command:
node server.js - Add all environment variables from
server/.env.example - Deploy!
- Create another Web Service on Render
- Set Root Directory:
AI-Service - Set Build Command:
pip install -r requirements.txt - Set Start Command:
uvicorn app:app --host 0.0.0.0 --port $PORT - Deploy! (Runs in Demo mode unless model is pre-trained)
- Create a free cluster on mongodb.com/atlas
- Whitelist
0.0.0.0/0for cloud access - Copy the connection string to
MONGODB_URI
The AI service uses MobileNetV2 transfer learning trained on the PlantVillage dataset (54,306 leaf images, 38 disease classes across 14 crops).
| Crop | Diseases Detected |
|---|---|
| Apple | Apple Scab, Black Rot, Cedar Apple Rust, Healthy |
| Tomato | 9 diseases including Late Blight, Leaf Mold, Mosaic Virus |
| Corn | Cercospora, Common Rust, Northern Blight, Healthy |
| Grape | Black Rot, Esca, Leaf Blight, Healthy |
| Potato | Early Blight, Late Blight, Healthy |
| + 9 more | Blueberry, Cherry, Orange, Peach, Pepper, Raspberry, Soybean, Squash, Strawberry |
Demo Mode: If no trained model is found, the AI service runs in smart demo mode, returning realistic predictions based on treatment data.
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, TailwindCSS, Framer Motion, i18next |
| Backend | Node.js, Express 5, MongoDB, Mongoose, JWT, Socket.IO |
| AI Service | Python 3.12, FastAPI, TensorFlow 2.21, MobileNetV2, Pillow |
| Storage | Cloudinary (images), MongoDB Atlas (data) |
| Payments | Razorpay |
| Deployment | Vercel (frontend), Render (backend + AI), MongoDB Atlas |
Coming soon β see the live demo for the full UI experience.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Yash Mishra
- GitHub: @yash4515
- Project: KrishiSaathi