Complete installation and configuration guide for AgroBot AI Farming Assistant.
- Version: Node.js 18+ recommended
- Download: nodejs.org
- Verify Installation:
node --version # Should show v18.x or higher npm --version # Should show 9.x or higher
- Version: Python 3.9 or higher
- Download: python.org
- Verify Installation:
python --version # Should show 3.9.x or higher pip --version # Should show pip version
- Download: git-scm.com
- Required if cloning from repository
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API Key"
- Create a new API key
- Copy and save it securely
Features:
- Chat responses (Gemini 2.5 Flash)
- Image analysis (Gemini Vision)
- Visit Groq Console
- Sign up / Sign in
- Navigate to "API Keys"
- Click "Create API Key"
- Copy and save it securely
Features:
- Speech-to-text (Whisper)
# 1. Clone or download the project
git clone <repository-url>
cd practice
# 2. Copy environment template
copy .env.example .env
# 3. Edit .env and add your API keys
# (Use any text editor)
# 4. Install all dependencies
npm run setup
# 5. Start the application
npm startThat's it! 🎉 Your app will be running at:
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
git clone https://github.com/kanduri-adithya/agrobot.git
cd agrobot- Download the project ZIP file
- Extract to desired location
- Open terminal in the extracted folder
# If you already have the project files
git init
git remote add origin https://github.com/kanduri-adithya/agrobot.git
git branch -M main
git pull origin mainWindows (Command Prompt):
copy .env.example .envWindows (PowerShell):
Copy-Item .env.example .envLinux/Mac:
cp .env.example .envOpen .env in any text editor and add your API keys:
# Google Gemini API Key (REQUIRED)
GOOGLE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Groq API Key (REQUIRED)
GROQ_API_KEY=gsk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX- Replace the placeholder values with your actual API keys
- Do NOT share your
.envfile publicly - Do NOT commit
.envto Git (already in.gitignore)
npm run setupThis command will:
- Install frontend Node.js dependencies
- Install backend Python dependencies
Backend (Python):
pip install -r requirements.txtFrontend (Node.js):
cd frontend
npm install
cd ..npm startor
npm run devThis starts both backend and frontend concurrently.
Terminal 1 - Backend:
npm run backendTerminal 2 - Frontend:
npm run frontendNavigate to http://localhost:3000
You should see the AgroBot landing page! 🌾
Default: 5000
To change, edit backend/backend_api.py:
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000) # Change port hereDefault: Frontend origin allowed
To modify, edit backend/backend_api.py:
CORS(app, resources={r"/api/*": {"origins": "http://localhost:3000"}})Default: backend/temp/
Temporary TTS audio files are stored here and cleaned automatically.
Default: 3000
To change, edit frontend/vite.config.js:
export default {
server: {
port: 3000 // Change port here
}
}Default: Proxies /api to http://localhost:5000
To modify, edit frontend/vite.config.js:
server: {
proxy: {
'/api': 'http://localhost:5000' // Change backend URL here
}
}Create frontend/.env.local:
VITE_API_URL=http://localhost:5000Problem: ModuleNotFoundError or Cannot find module
Solution:
# For Python
pip install -r requirements.txt
# For Node.js
cd frontend
npm installProblem: Port 3000/5000 is already in use
Solution:
- Kill the process using the port
- Or change the port in configuration (see above)
Windows:
netstat -ano | findstr :5000
taskkill /PID <PID> /FLinux/Mac:
lsof -ti:5000 | xargs kill -9Problem: Invalid API key or Unauthorized
Solution:
- Verify API keys in
.envfile - Ensure no extra spaces or quotes
- Check if keys are active on respective platforms
Problem: CORS policy blocked
Solution:
- Ensure backend is running on port 5000
- Check CORS configuration in
backend_api.py - Restart backend server
Problem: AttributeError: 'Audio' object has no attribute 'transcriptions'
Solution:
# Downgrade to groq 0.9.0
pip uninstall groq
pip install groq==0.9.0Problem: UnicodeEncodeError in console
Solution:
Already handled in code with safe_print() wrapper. If issues persist:
chcp 65001 # Change console to UTF-8Problem: Frontend build fails
Solution:
cd frontend
rm -rf node_modules dist
npm install
npm run buildnpm run checkThis verifies:
- Python installation
- Node.js installation
- Required dependencies
- Environment variables
- API key presence
curl http://localhost:5000/api/healthExpected response: {"status": "healthy"}
Open browser: http://localhost:3000
You should see:
- ✅ Landing page loads
- ✅ "Start Chatting Now" button visible
- ✅ No console errors
- Click "Start Chatting Now"
- Type: "What is farming?"
- Should receive AI response
- Click microphone button
- Speak a question
- Should see transcription and response
- Click image upload button
- Upload a plant photo
- Should receive analysis
- OS: Windows 10, macOS 10.15, Ubuntu 20.04
- RAM: 4 GB
- Storage: 2 GB free space
- Internet: Required for API calls
- OS: Windows 11, macOS 12+, Ubuntu 22.04
- RAM: 8 GB
- Storage: 5 GB free space
- Internet: Broadband connection
After successful setup:
- Explore Features - Try voice, text, and image modes
- Read Documentation - Check
/docsfolder - Customize - Modify colors, themes, languages
- Deploy - Follow deployment guide for production
- Documentation: Check
/docsfolder - README: See main
README.md - Issues: Check GitHub issues (if applicable)
Before asking for help:
- ✅ Verified all prerequisites installed
- ✅ API keys correctly set in
.env - ✅ Dependencies installed (
npm run setup) - ✅ Both servers running
- ✅ Checked console for errors
- ✅ Tried troubleshooting steps above
# Setup
npm run setup # Install all dependencies
# Development
npm start # Start both servers
npm run backend # Start backend only
npm run frontend # Start frontend only
# Build
npm run build # Build frontend for production
# Verification
npm run check # Verify setup.env # API keys (DO NOT COMMIT)
requirements.txt # Python dependencies
package.json # Node.js dependencies
backend/backend_api.py # Backend entry point
frontend/src/App.jsx # Frontend entry point
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
- API Base: http://localhost:5000/api