AgriSense is a full-stack AI farming platform built for Indian agriculture workflows. It combines a multilingual React frontend with a Node/Express backend to help farmers get fast, practical assistance on crops, weather, disease detection, soil health, finance, and government schemes.
- π€ AI chat assistance in English, Hindi, and Punjabi
- ποΈ Voice-first chat with microphone recording, transcription, and spoken responses
- π€οΈ Live location-based weather with provider failover
- πΏ Plant disease detection from uploaded images
- πͺ΄ Soil image analysis with crop suggestions
- π Crop advisory and financial guidance
- ποΈ Government scheme discovery
- π Farmer profile, farm details, and crop history management
| Area | Details |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS, React Router |
| Backend | Node.js, Express, Mongoose, Multer |
| AI Services | Groq LLMs, Whisper transcription, optional Python RAG service |
| Languages | English, Hindi, Punjabi |
| Deployments | Vercel frontend, Render backend |
| Public Frontend | agri-sense-lime.vercel.app |
| Public Backend | agrisense-backend-h3a6.onrender.com |
- Repo Structure
- Tech Stack
- Key Features
- Environment Setup
- Local Development
- Verification Status
- Deployment Notes
- Why Issues Like This Happen
- Precautions To Prevent Future Breakage
- Known Gaps
- Suggested Next Checks
.
|-- backend/
| |-- controllers/
| |-- data/
| |-- middleware/
| |-- models/
| |-- python-scripts/
| |-- routes/
| |-- services/
| |-- server.js
| `-- requirements.txt
|-- frontend/
| |-- public/
| |-- src/
| |-- package.json
| `-- vite.config.js
|-- assets/
`-- uploads/
- Frontend: React 19, Vite, Tailwind CSS, React Router, Framer Motion
- Backend: Node.js, Express, Mongoose, Multer, JWT
- AI: Groq LLMs, optional Python RAG service with ChromaDB
- Data: MongoDB
- Deployment: Vercel frontend, Render backend
- Multilingual landing page and AI assistant
- Login/signup with local auth and Google sign-in
- Voice input with backend transcription and voice output playback
- Location-aware weather and scheme discovery
- Farm profile capture for more personalized recommendations
- Login/signup with local auth and Google sign-in
- Multilingual UI and chat flow
- Voice-enabled chat with microphone recording and TTS playback
- Weather card with location prompt and fallback weather providers
- Scheme discovery with state filtering
- Soil and plant analysis upload flows
- Crop advisory and financial guidance modals
- Farm profile and crop history management
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/googleGET /api/auth/mePUT /api/auth/profilePOST /api/auth/crop-historyDELETE /api/auth/crop-history/:idGET /api/weatherGET /api/schemesPOST /api/chatGET /api/ttsPOST /api/analyze-soilPOST /api/analyze-plantPOST /api/crop-advicePOST /api/financial-guidancePOST /api/location-schemesGET /api/health
Create backend/.env using backend/.env.example as the template.
Important variables:
PORTorAPP_PORTMONGODB_URIJWT_SECRETGROQ_API_KEYTOMORROW_API_KEYWEATHERAPI_KEYOPENWEATHERMAP_KEYGOOGLE_CLIENT_IDGOOGLE_CLOUD_VISION_KEYFRONTEND_ORIGINSCHAT_MODERAG_SERVICE_URL
Notes:
- Weather now prefers
TOMORROW_API_KEY, then falls back throughWEATHERAPI_KEY,OPENWEATHERMAP_KEY, Open-Meteo,met.no, andwttr.in. - AI chat, soil analysis, plant analysis, crop advice, and financial guidance still require a valid
GROQ_API_KEY. - If
CHAT_MODE=pure_rag, the backend can auto-start the Python RAG service when needed.
Create frontend/.env using frontend/.env.example.
Important variables:
VITE_API_URLVITE_GOOGLE_CLIENT_ID
If VITE_API_URL is missing, the app now auto-selects:
http://localhost:4001/apifor local developmenthttps://agrisense-backend-h3a6.onrender.com/apifor production hosts
cd backend
npm install
cd ../frontend
npm installcd backend
npm run devDefault local API:
http://localhost:4001
cd frontend
npm run devDefault frontend URL:
http://localhost:5173
- It supports text, image, and voice-based farmer interactions in one product.
- It is designed for Indian agriculture use cases instead of generic chatbot behavior.
- It has layered fallback behavior for weather, auth recovery, and voice playback.
- It is deployable as separate frontend and backend services with clear health-check targets.
See backend/RAG_SETUP.md.
The following checks were run in this workspace on June 3, 2026:
- Frontend production build: passed
- Backend JavaScript syntax check: passed
- Local backend health endpoint: passed
- Local weather endpoint: passed
- Local chat endpoint: passed
- Local plant analysis endpoint: passed
- Deployed backend health endpoint: passed
- Deployed backend chat endpoint: passed
- Deployed backend plant analysis endpoint: passed
Issues found during verification:
- Frontend lint currently fails with existing ESLint and prop-types issues.
- Deployed backend weather was failing because
WEATHERAPI_KEYwas not configured in production. - The voice assistant could silently fail when the browser had not granted microphone access before speech recognition started.
- The repo had no root
README.md.
Current deployed frontend:
https://agri-sense-lime.vercel.app
Current backend used by the deployed frontend:
https://agrisense-backend-h3a6.onrender.com/api
Recommended uptime monitor targets:
- Frontend home:
https://agri-sense-lime.vercel.app - Backend health:
https://agrisense-backend-h3a6.onrender.com/api/health - Backend root:
https://agrisense-backend-h3a6.onrender.com
If Vercel and Render are connected to GitHub auto-deploy, pushing to main should trigger a redeploy.
The main failure modes in this project are operational, not just code bugs:
- Frontend builds can point to the wrong backend if
VITE_API_URLis left on a local URL or overridden incorrectly. - Protected features depend on a valid JWT token; if the token expires but the UI still thinks the user is logged in, feature requests fail with
401. - Weather depended on a third-party key-based API, so missing quota, missing key, or rate limiting could blank the weather card.
- Browser speech recognition can fail without a visible error if microphone permission is blocked or if
start()is called before the browser has granted access. - AI features depend on external APIs and can fail if provider credentials are missing, exhausted, or rate-limited.
- Render free or low-traffic services can cold-start or lag behind Vercel deploy timing.
- Keep a working
VITE_API_URLin Vercel environment settings and verify it after each deploy. - Keep
GROQ_API_KEY,TOMORROW_API_KEY,WEATHERAPI_KEY,OPENWEATHERMAP_KEY,GOOGLE_CLIENT_ID,MONGODB_URI, andJWT_SECRETconfigured in Render. - Use an uptime monitor on both the frontend home page and backend health endpoint.
- After every push, verify
auth,weather,chat, and one upload-based endpoint from production. - Avoid relying on only one external weather provider; keep a keyed primary provider and multi-provider fallbacks, which this repo now does.
- Test microphone permission and one spoken query after each frontend deploy, especially on Chrome mobile and desktop.
- Expire bad sessions cleanly by forcing logout on
401responses instead of silently bouncing users around the app. - Keep deploy-time environment variables documented and versioned in
.env.example, but never commit real secrets.
- No automated backend test suite is present.
- No automated frontend integration or e2e suite is present.
- Frontend lint errors should still be cleaned up in a follow-up pass.
- Several advanced features depend on external service credentials and uptime.
After deployment, verify:
- Weather loads on the public homepage.
- Login/signup works.
- Chat responds after login.
- Plant and soil uploads return analysis.
- Crop advisory and financial guidance respond.