๐ŸŒพ Green Crops - AI-Powered Farming Assistant

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.

React Vite TailwindCSS Google Gemini AI

โœจ Features

๐Ÿค– AI-Powered Analysis

  • 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

๐ŸŒค๏ธ Weather Integration

  • 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

๐ŸŒ Multi-Language Support

  • English ๐Ÿ‡ฌ๐Ÿ‡ง
  • Hindi (เคนเคฟเค‚เคฆเฅ€) ๐Ÿ‡ฎ๐Ÿ‡ณ
  • Tamil (เฎคเฎฎเฎฟเฎดเฏ) ๐Ÿ‡ฎ๐Ÿ‡ณ

๐ŸŽจ Modern UI/UX

  • Responsive design for mobile, tablet, and desktop
  • Glassmorphism effects and smooth animations
  • Dark green agriculture theme
  • Framer Motion animations
  • Interactive micro-interactions

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 16+ and npm
  • Google Gemini API key
  • Tomorrow.io Weather API key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/green-crops-farming-assistant.git
    cd green-crops-farming-assistant
    
  2. Install dependencies

    npm install
    
  3. 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


4. **Start the development server**
```bash
npm run dev
  1. Open your browser http://localhost:5173

๐Ÿ”‘ Getting API Keys

Google Gemini AI API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the key to your .env file

Tomorrow.io Weather API Key

  1. Visit Tomorrow.io
  2. Sign up for a free account
  3. Get your API key from the dashboard
  4. Copy the key to your .env file

๐Ÿ“ Project Structure

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

๐Ÿ› ๏ธ Technologies Used

  • 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)

๐Ÿ“ฑ Pages

Home

  • Modern landing page with hero section
  • Feature highlights
  • Call-to-action buttons

AI Analysis

  • 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

Weather

  • 7-day weather forecast
  • Current conditions
  • Crop recommendations based on weather
  • Location search

About & Contact

  • Information about the platform
  • Contact form for support

๐Ÿ”ง Available Scripts

# Development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Lint code
npm run lint

๐ŸŒŸ Key Features Explained

AI Error Handling

The 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

Weather Integration

  • Automatic geocoding (city name โ†’ coordinates)
  • Real-time weather data
  • 7-day forecasts
  • Crop-specific recommendations

Responsive Design

  • Mobile-first approach
  • Tablet and desktop optimized
  • Touch-friendly interface
  • Smooth animations

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ‘จโ€๐Ÿ’ป Author

Built with โค๏ธ for farmers worldwide

๐Ÿ™ Acknowledgments

  • Google Gemini AI for powerful image analysis
  • Tomorrow.io for weather data
  • OpenStreetMap for free geocoding
  • React and Vite communities

๐Ÿ“ž Support

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.

Built With

Share this project:

Updates