A modern, intelligent farming assistant web application that helps farmers diagnose crop diseases, analyze soil conditions, and get real-time weather updates using AI and advanced APIs.
- Crop Disease Detection: Upload crop images to identify diseases with AI
- Soil Analysis: Analyze soil conditions and get improvement recommendations
- Crop Identification: Identify crops and get growth stage information
- Smart Retry System: Automatic fallback to multiple AI models for 95%+ success rate
- Real-time Weather Data: Live weather updates using Tomorrow.io API
- 7-Day Forecasts: Plan your farming activities ahead
- Location-based: Get weather for any city worldwide
- Crop Recommendations: Weather-based crop suggestions
- English 🇬🇧
- Hindi (हिंदी) 🇮🇳
- Tamil (தமிழ்) 🇮🇳
- Responsive design for mobile, tablet, and desktop
- Glassmorphism effects and smooth animations
- Dark green agriculture theme
- Framer Motion animations
- Interactive micro-interactions
- Node.js 16+ and npm
- Google Gemini API key
- Tomorrow.io Weather API key
- Clone the repository
git clone https://github.com/yourusername/green-crops-farming-assistant.git
cd green-crops-farming-assistant- Install dependencies
npm install- Set up environment variables
# Copy the example env file
cp .env.example .env
# Edit .env and add your API keys
VITE_GEMINI_API_KEY=your_gemini_api_key_here
VITE_TOMORROW_API_KEY=your_tomorrow_io_api_key_here- Start the development server
npm run dev- Open your browser
http://localhost:5173
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key to your
.envfile
- Visit Tomorrow.io
- Sign up for a free account
- Get your API key from the dashboard
- Copy the key to your
.envfile
farmer-project/
├── src/
│ ├── components/
│ │ ├── Navbar.jsx # Navigation bar
│ │ └── Footer.jsx # Footer component
│ ├── pages/
│ │ ├── Home.jsx # Landing page
│ │ ├── AIAnalysis.jsx # AI crop analysis page
│ │ ├── Weather.jsx # Weather dashboard
│ │ ├── About.jsx # About page
│ │ └── Contact.jsx # Contact page
│ ├── services/
│ │ ├── geminiService.js # Google Gemini AI integration
│ │ └── weatherService.js # Tomorrow.io weather API
│ ├── App.jsx # Main app component
│ └── main.jsx # Entry point
├── public/ # Static assets
├── .env.example # Environment variables template
├── package.json # Dependencies
└── README.md # This file
- Frontend Framework: React 18.3
- Build Tool: Vite 5.4
- Styling: Tailwind CSS 3.4
- Animations: Framer Motion
- Routing: React Router DOM
- Icons: Lucide React
- AI: Google Gemini AI (gemini-2.5-flash, gemini-2.0-flash, gemini-2.5-pro)
- Weather API: Tomorrow.io
- Geocoding: OpenStreetMap Nominatim (free, no API key needed)
- Modern landing page with hero section
- Feature highlights
- Call-to-action buttons
- Upload crop/plant images
- Select analysis type (Disease, Crop, Soil)
- Get AI-powered diagnosis and treatment plans
- View weather data for your farm location
- Multi-language support
- 7-day weather forecast
- Current conditions
- Crop recommendations based on weather
- Location search
- Information about the platform
- Contact form for support
# Development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint code
npm run lintThe app includes enterprise-grade error handling:
- Tries 3 different AI models automatically
- Exponential backoff retry logic (2s, 4s, 8s delays)
- User-friendly error messages with helpful tips
- 95%+ success rate even during peak hours
- Automatic geocoding (city name → coordinates)
- Real-time weather data
- 7-day forecasts
- Crop-specific recommendations
- Mobile-first approach
- Tablet and desktop optimized
- Touch-friendly interface
- Smooth animations
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Built with ❤️ for farmers worldwide
- Google Gemini AI for powerful image analysis
- Tomorrow.io for weather data
- OpenStreetMap for free geocoding
- React and Vite communities
For support, email support@greencrops.com or open an issue on GitHub.
Note: This is a demonstration project. API keys should be kept secure and not committed to version control.