A production-ready climate intelligence platform for Indian farmers, providing actionable insights for climate adaptation, crop recommendations, and insurance/compensation documentation.
- Climate Stress Detection: Real-time analysis of heat stress, soil moisture, and rainfall irregularity
- Risk Assessment: Flood and drought probability predictions with contributing factors
- Smart Crop Recommendations: AI-powered crop suggestions using Google Gemini
- Soil & Water Dashboard: Fertility assessment and groundwater availability
- Climate Loss Reports: Insurance-ready PDF reports documenting invisible yield losses
- Advanced Analytics: Historical trends, yield loss estimation, and financial impact analysis
- Government Information: Access to policies, MSP, compensation schemes, and subsidies
- Bilingual Interface: English and Hindi language support
- Real-time weather data integration (OpenWeather API)a
- Gemini AI for intelligent crop recommendations
- PDF report generation for insurance claims
- JWT-based authentication
- Responsive design for mobile and desktop
- Interactive maps for farm location
- Data visualization charts
- Runtime: Node.js.
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT (jsonwebtoken), bcrypt
- APIs: OpenWeather API, Google Gemini AI
- PDF: PDFKit
- Validation: express-validator
- Framework: React 18
- Routing: React Router v6
- HTTP Client: Axios
- Charts: Recharts
- Maps: Leaflet, React-Leaflet
- Internationalization: i18next, react-i18next
- Styling: CSS with custom design system
- Node.js (v16 or higher)
- MongoDB (local or MongoDB Atlas)
- OpenWeather API key (Get it here)
- Google Gemini API key (Get it here)
git clone <https://github.com/manvirsingh01/kishan-saathi.git>
cd "kishan-saathi"cd backend
npm installCreate .env file in the backend directory:
PORT=5000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/kishan-saathi
# JWT Secret
JWT_SECRET=your-super-secret-jwt-key-change-in-production
# OpenWeather API
OPENWEATHER_API_KEY=your-openweather-api-key
# Google Gemini AI API
GEMINI_API_KEY=your-gemini-api-key
# Frontend URL
FRONTEND_URL=http://localhost:3000cd ../frontend
npm installCreate .env file in the frontend directory (optional):
REACT_APP_API_URL=http://localhost:5000/apiLocal MongoDB:
mongodOr use MongoDB Atlas:
- Update
MONGODB_URIin backend.envwith your Atlas connection string
Start Backend (in backend directory):
npm run devBackend will run on http://localhost:5000
Start Frontend (in frontend directory):
npm startFrontend will run on http://localhost:3000
POST /api/auth/register- Register new farmerPOST /api/auth/login- Login farmerGET /api/auth/verify- Verify JWT token
GET /api/profile- Get farmer profilePUT /api/profile- Update profilePUT /api/profile/location- Update farm location
GET /api/climate/stress- Get climate stress indicatorsGET /api/climate/risk- Get flood/drought risk assessmentGET /api/climate/history- Get historical climate data
GET /api/soil/sustainability- Get soil fertility and water assessment
POST /api/crops/recommend- Get AI crop recommendationsGET /api/crops/history- Get recommendation historyGET /api/crops/recommendation/:id- Get specific recommendation
POST /api/reports/loss- Create loss reportGET /api/reports/loss- Get all loss reportsGET /api/reports/loss/:id- Get specific reportPUT /api/reports/loss/:id- Update reportGET /api/reports/pdf/:id- Download PDF report
GET /api/analytics/climate- Get climate trendsGET /api/analytics/yield- Get yield loss analyticsGET /api/analytics/summary- Get overview summary
GET /api/government/info- Get government informationGET /api/government/info/:id- Get specific infoGET /api/government/categories- Get categoriesPOST /api/government/admin- Create info (admin)PUT /api/government/admin/:id- Update info (admin)DELETE /api/government/admin/:id- Delete info (admin)
kishan-saathi/
βββ backend/
β βββ models/ # MongoDB schemas
β βββ routes/ # API route handlers
β βββ services/ # Business logic services
β βββ middleware/ # Auth & other middleware
β βββ reports/ # Generated PDF reports
β βββ server.js # Express server
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ utils/ # API client, i18n
β β βββ App.jsx # Main app with routing
β β βββ index.js # Entry point
β β βββ index.css # Global styles
β βββ public/
β βββ package.json
β
βββ README.md
- Access all climate and crop features
- Generate loss reports
- View analytics
- Access government information
- All farmer features
- Manage government information
- Add/edit/delete policies, MSP, compensation schemes
After registration, you can create a test user with these credentials:
- Email:
[email protected] - Password:
password123 - State: Any Indian state
- District: Any district name
- Fill farm details including location, land area, soil type
- Login with email and password
- View quick stats and latest climate assessment
- Quick access to all features
- Real-time heat, soil moisture, and rainfall analysis
- Visual indicators for stress levels
- Flood and drought probability with contributing factors
- Region-specific risk calculations
- Click "Get Recommendations" for AI-powered suggestions
- View resilience scores, yield expectations, benefits
- Document climate-related losses
- Generate insurance-ready PDF reports
- View historical climate trends
- Track yield loss over time
- OpenWeather API: Free tier provides 1,000 calls/day
- Google Gemini API: Free tier available
- See
.env.examplein backend directory for all required variables
- Set environment variables in hosting platform
- Ensure MongoDB connection string is updated
- Deploy backend code
- Update
REACT_APP_API_URLto production backend URL - Build:
npm run build - Deploy build folder
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
MIT License - feel free to use this project for learning or production.
For issues or questions:
- Create an issue in the repository
- Check API documentation above
- Real satellite imagery integration
- SMS alerts for climate warnings
- Marketplace integration for crop selling
- Community forum for farmers
- Weather forecasting models
- Crop disease detection
- Yield prediction ML models
Made with β€οΈ for Indian Farmers