Skip to content
Sov-ereignPublic

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

77 Commits

Folders and files

Repository files navigation

GreenGrow

Typing SVG

πŸ“‹ Problem Statement

GreenGrow – An AI-Powered Farming Assistant Platform

GreenGrow is a comprehensive agricultural advisory platform that leverages artificial intelligence to help farmers make informed decisions about crop cultivation, disease management, weather patterns, and market prices. It's designed to bridge the gap between traditional farming knowledge and modern AI technology, making advanced agricultural insights accessible to farmers everywhere.

🎬 Demo

🎯 Click to explore the live experience of GreenGrow's user-friendly interface and advanced AI-powered features.

πŸ“‹ Features Overview

πŸ€– AI-Powered Chat Assistant

  • Text-based queries: Ask questions about crop cultivation, pest management, soil health, and farming best practices
  • Context-aware responses: AI understands your location and provides location-specific advice
  • Multi-turn conversations: Maintain conversation context for better assistance

πŸ–ΌοΈ Image-Based Disease Detection

  • Upload crop images for instant disease diagnosis
  • Powered by TensorFlow deep learning model
  • Detects 15+ plant diseases across Pepper, Potato, and Tomato crops
  • Integration with Google Gemini Vision API for enhanced analysis
  • Provides treatment recommendations and prevention tips

🎀 Voice Assistant

  • Live voice interaction with AI farming advisor
  • Voice command processing for hands-free operation
  • Real-time context injection from multiple data sources
  • Natural language understanding for farming queries

🌀️ Weather Information

  • Real-time weather forecasts for your location
  • 7-day weather predictions
  • Weather alerts and notifications
  • Location-based weather data integration
  • Interactive weather widgets

πŸ“Š Market Prices (Mandi Rates)

  • Real-time agricultural commodity prices
  • Multiple mandi (market) information
  • Price trends and historical data
  • Crop-specific market insights
  • Help farmers make informed selling decisions

🌾 Crop Management

  • Crop recommendations based on location and season
  • Detailed crop information and growing guides
  • Pest and disease management for specific crops
  • Seasonal planting calendars
  • Farm data tracking and management

πŸ›οΈ Government Schemes

  • Information about available agricultural schemes
  • Eligibility criteria and application processes
  • Scheme benefits and requirements
  • Location-based scheme recommendations

πŸ“ Farm Profile Management

  • Create and manage farm profiles
  • Track farm statistics and metrics
  • Store farm location and details
  • View farm-specific recommendations

πŸ”” Community & Support

  • Community forum for farmer discussions
  • Help center with FAQs and guides
  • Support system for technical assistance
  • Knowledge sharing platform

βš™οΈ Settings & Personalization

  • User profile management
  • Notification preferences
  • Location settings
  • Theme and display preferences

πŸ” Authentication & Security

  • Secure user registration and login
  • JWT-based authentication
  • Protected routes and API endpoints
  • User session management

πŸ› οΈ Tech Stack

Frontend

  • React 18 with TypeScript
  • Vite for fast development and building
  • Tailwind CSS for modern, responsive UI
  • React Router for navigation
  • Lucide React for icons
  • Axios for API calls
  • VAPI AI for voice assistant integration

Backend

  • Node.js with Express.js
  • MongoDB with Mongoose for database
  • JWT for authentication
  • Multer for file uploads
  • CORS enabled for cross-origin requests
  • Morgan for HTTP request logging

AI & ML

  • Google Gemini 2.0 Flash for chat and vision analysis
  • TensorFlow/Keras for disease detection model
  • Flask for Python ML backend
  • Axicov for AI workflow management

APIs & Services

  • OpenWeatherMap API for weather data
  • Government Mandi APIs for market prices
  • News APIs for agricultural news

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • Python 3.8+ (for Flask backend)
  • MongoDB (local or cloud instance)
  • Git

Installation Steps

1. Clone the Repository

git clone https://github.com/your-username/GreenGrow.git

# Navigate to the project directory
cd GreenGrow

2. Backend Setup (Node.js Server)

# Navigate to server directory
cd server

# Install dependencies
npm install

# Create .env file (copy from .env.example if available)
# Add your environment variables:
# MONGODB_URI=your-mongodb-connection-string
# JWT_SECRET=your-jwt-secret-key
# GEMINI_API_KEY=your-google-gemini-api-key
# OPENWEATHER_API_KEY=your-openweather-api-key
# FLASK_API_URL=http://localhost:5001

# Start the backend server
npm run dev
# Or for production
npm start

The server will start on http://localhost:5000

3. Flask Backend Setup (Disease Detection)

# Navigate to backend directory
cd backend

# Create virtual environment (Windows)
python -m venv venv
venv\Scripts\activate

# Or on Linux/Mac
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Or use the setup script
# Windows: setup_venv.bat
# Linux/Mac: chmod +x setup_venv.sh && ./setup_venv.sh

# Start Flask server
python app.py

The Flask server will start on http://localhost:5001

4. Frontend Setup (React Client)

# Open a new terminal and navigate to Client directory
cd Client

# Install dependencies
npm install

# Create .env file if needed
# VITE_API_URL=http://localhost:5000/api

# Start the development server
npm run dev

The frontend will start on http://localhost:5173 (or another port if 5173 is busy)

5. Environment Variables

Create .env files in both server and Client directories:

server/.env:

MONGODB_URI=mongodb://localhost:27017/greengrow
JWT_SECRET=your-super-secret-jwt-key-here
GEMINI_API_KEY=your-google-gemini-api-key
OPENWEATHER_API_KEY=your-openweather-api-key
FLASK_API_URL=http://localhost:5001
AXICOV_API_KEY=your-axicov-api-key (optional)
AXICOV_API_BASE=https://api.axicov.com/v1 (optional)

Client/.env:

VITE_API_URL=https://greengrow-n9g5.onrender.com/api

Running the Complete Application

  1. Start MongoDB (if running locally)
  2. Start Flask backend: cd backend && python app.py
  3. Start Node.js server: cd server && npm run dev
  4. Start React frontend: cd Client && npm run dev
  5. Open http://localhost:5173 in your browser

πŸ“ Project Structure

GreenGrow/
β”œβ”€β”€ backend/              # Flask backend for disease detection
β”‚   β”œβ”€β”€ app.py           # Flask application
β”‚   β”œβ”€β”€ requirements.txt # Python dependencies
β”‚   └── venv/            # Python virtual environment
β”œβ”€β”€ Client/              # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/  # React components
β”‚   β”‚   β”œβ”€β”€ pages/       # Page components
β”‚   β”‚   β”œβ”€β”€ context/     # React context providers
β”‚   β”‚   β”œβ”€β”€ hooks/       # Custom React hooks
β”‚   β”‚   └── lib/         # Utility libraries
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.ts
β”œβ”€β”€ server/              # Node.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/      # API routes
β”‚   β”‚   β”œβ”€β”€ controllers/ # Route controllers
β”‚   β”‚   β”œβ”€β”€ models/      # Database models
β”‚   β”‚   β”œβ”€β”€ middleware/  # Express middleware
β”‚   β”‚   β”œβ”€β”€ services/    # Business logic services
β”‚   β”‚   └── config/      # Configuration files
β”‚   β”œβ”€β”€ package.json
β”‚   └── uploads/         # Uploaded files directory
β”œβ”€β”€ model/               # ML model files
β”‚   └── disease_model/   # TensorFlow model
└── Readme.md           # Project documentation

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout
  • GET /api/auth/me - Get current user

Chat & AI

  • POST /api/chat/message - Send text message to AI assistant
  • POST /api/chat/image-analysis - Upload image for disease detection
  • POST /api/chat/voice-command - Process voice commands
  • POST /api/chat/live-voice - Live voice assistant session

Market & News

  • GET /api/mandi - Get market prices
  • GET /api/news - Get agricultural news

Health Checks

  • GET /api/health - Node.js server health
  • GET /health - Flask server health (port 5001)

πŸ§ͺ Testing

# Test backend API
cd server
npm test

# Test frontend
cd Client
npm test

πŸ“¦ Deployment

Backend Deployment

cd server
npm run build
npm start

Frontend Deployment

cd Client
npm run build
# Deploy the 'dist' folder to your hosting service

Flask Backend Deployment

The Flask backend can be deployed using:

  • Heroku
  • AWS Elastic Beanstalk
  • Google Cloud Run
  • Railway
  • Render

🀝 Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ™ Acknowledgments

  • Google Gemini API for AI capabilities
  • TensorFlow team for ML framework
  • OpenWeatherMap for weather data
  • All open-source contributors

Made with ❀️ by the GreenGrow Team

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages