AgroBot is a modern, AI-powered farming assistant with a beautiful Gemini-style unified chat interface. Built for project expos and real-world agricultural applications, it provides farmers with instant, multilingual advice on crops, soil, irrigation, pest control, and plant disease detection.
- Single conversation thread like ChatGPT/Gemini
- Voice, text, and image inputs work seamlessly in one chat
- Chat persistence - Messages saved across page refreshes
- Audio playback with pause/resume/stop controls
- Professional landing page with smooth navigation
- Speak in English, Hindi (เคนเคฟเคเคฆเฅ), or Telugu (เฐคเฑเฐฒเฑเฐเฑ)
- Voice transcription displayed in chat
- Automatic audio response for voice inputs
- Multi-language speech synthesis
- Type farming queries for instant AI answers
- Powered by Google Gemini 2.5 Flash
- Responses translated to selected language
- Optional audio playback (manual control)
- Upload plant/crop photos for disease detection
- Gemini Vision AI powered analysis
- Treatment recommendations included
- Visual feedback with image preview
- Landing page with hero section and features
- Gemini-style bottom toolbar with all tools
- Language selector integrated in chat
- Back button to return to home
- Responsive design for all devices
- Smooth animations with Framer Motion
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend (Port 3000) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Landing Page โ โ
โ โ โข Hero Section โ โ
โ โ โข Features Showcase โ โ
โ โ โข CTA Buttons โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Chat Interface (Gemini-style) โ โ
โ โ โข Unified conversation view โ โ
โ โ โข Voice/Text/Image tools โ โ
โ โ โข Audio controls (pause/resume) โ โ
โ โ โข Chat persistence (localStorage)โ โ
โ โ โข Language selector in toolbar โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ REST API (HTTP/JSON)
โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Flask Backend (Port 5000) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ /api/chat โ Google Gemini AI โ
โ /api/transcribe โ Groq Whisper STT โ
โ /api/tts โ gTTS + Translation โ
โ /api/analyze-image โ Gemini Vision โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Node.js 18+ and npm
- Python 3.9+
- Google Gemini API Key - Get it here
- Groq API Key - Get it here
# Copy environment template
copy .env.example .envEdit .env and add your API keys:
GOOGLE_API_KEY=your_google_api_key_here
GROQ_API_KEY=your_groq_api_key_hereOption A - All at once (Recommended):
npm run setupOption B - Separately:
# Install Python dependencies
pip install -r requirements.txt
# Install Node dependencies
npm run setup:frontendOption A - Both servers together (Recommended):
npm start
# or
npm run devOption B - Run separately:
Terminal 1 - Backend:
npm run backendBackend will run on http://localhost:5000
Terminal 2 - Frontend:
npm run frontendFrontend will run on http://localhost:3000
Navigate to http://localhost:3000 and start using AgroBot! ๐
| Command | Description |
|---|---|
npm run setup |
Install all dependencies (frontend + backend) |
npm start or npm run dev |
Start both backend and frontend servers |
npm run backend |
Start only Flask backend (port 5000) |
npm run frontend |
Start only React frontend (port 3000) |
npm run build |
Build frontend for production |
npm run check |
Validate setup configuration |
practice/
โ
โโโ ๐ backend/ # Python/Flask Backend
โ โโโ backend_api.py # Flask REST API server (MAIN)
โ โโโ agrobot_chat.py # Gemini chat logic
โ โโโ universal_stt.py # Groq Whisper STT
โ โโโ tts_engine.py # gTTS + translation
โ โโโ image.py # Image analysis module
โ
โโโ ๐ frontend/ # React Application
โ โโโ src/
โ โ โโโ App.jsx # Main app component
โ โ โโโ main.jsx # Entry point
โ โ โโโ index.css # Tailwind styles
โ โ โโโ components/
โ โ โโโ Header.jsx # App header with language selector
โ โ โโโ TabNavigation.jsx # Tab switcher
โ โ โโโ VoiceMode.jsx # Voice recording & STT
โ โ โโโ TextMode.jsx # Text chat interface
โ โ โโโ ImageAnalysis.jsx # Image upload & analysis
โ โ โโโ Footer.jsx # Footer with info
โ โโโ index.html
โ โโโ package.json
โ โโโ vite.config.js
โ โโโ tailwind.config.js
โ
โโโ ๐ docs/ # Documentation
โ โโโ QUICKSTART.md # Quick setup guide for expo
โ โโโ PRESENTATION_GUIDE.md # Full presentation guide
โ โโโ COMMANDS.md # Command reference
โ โโโ PROJECT_SUMMARY.md # Project overview
โ
โโโ ๐ scripts/ # Setup & Automation
โ โโโ setup.bat # One-click setup
โ โโโ start.bat # One-click start
โ โโโ check_setup.py # Pre-flight validation
โ
โโโ ๐ Configuration
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # API keys (create from .env.example)
โ โโโ .env.example # Environment template
โ โโโ .gitignore # Git ignore rules
โ
โโโ README.md # This file
AgroBot uses a modern agricultural theme with:
- Primary Colors: Green shades (๐ฟ #22c55e) representing growth and nature
- Secondary Colors: Earth tones (๐พ #bfa094) for warmth
- Typography: Inter font family for clarity
- Animations: Smooth transitions with Framer Motion
- Responsive: Mobile-first design approach
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check |
/api/chat |
POST | Get farming advice |
/api/transcribe |
POST | Convert speech to text |
/api/tts |
POST | Convert text to speech |
/api/analyze-image |
POST | Analyze plant disease |
- React 18 - UI framework
- Vite - Build tool
- Tailwind CSS - Styling
- Framer Motion - Animations
- Axios - HTTP client
- React Icons - Icon library
- Flask - Web framework
- Google Gemini - AI chat & vision
- Groq Whisper - Speech-to-text
- gTTS - Text-to-speech
- Deep Translator - Multi-language support
- Pillow - Image processing
- ๐ฌ๐ง English (en)
- ๐ฎ๐ณ Hindi (hi - เคนเคฟเคเคฆเฅ)
- ๐ฎ๐ณ Telugu (te - เฐคเฑเฐฒเฑเฐเฑ)
- Real-time audio recording with visual feedback
- Automatic transcription and AI response
- Voice playback in selected language
- Clean, chat-like interface
- Example questions for quick start
- Instant AI responses with audio
- Drag-and-drop image upload
- Disease detection and identification
- Organic treatment recommendations
- Crop Management - Get advice on planting, watering, and harvesting
- Disease Detection - Identify plant diseases from photos
- Pest Control - Learn organic and chemical pest management
- Soil Health - Understand soil improvement techniques
- Irrigation Planning - Optimize water usage
- API keys stored in
.env(not in version control) - CORS enabled for frontend communication
- Input validation on all endpoints
- File size limits for uploads
Frontend:
cd frontend
npm run build
# Files in frontend/dist/Backend:
gunicorn -w 4 -b 0.0.0.0:5000 backend_api:app- Frontend: Vercel, Netlify, or GitHub Pages
- Backend: Heroku, Railway, or AWS EC2
- Full Stack: DigitalOcean, Render, or Docker
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is licensed under the MIT License.