Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Agrow-AI

Agrow-AI Logo

GitHub stars

GitHub forks

GitHub issues

GitHub license

AI-Powered Solutions for Sustainable Agriculture and Enhanced Crop Management

Live Demo | Documentation

πŸ“– Overview

Agrow-AI is a full-stack web application designed to revolutionize agriculture through artificial intelligence. It provides farmers and agricultural experts with intelligent tools for crop management, disease detection, yield prediction, and personalized recommendations. By leveraging AI, Agrow-AI aims to optimize agricultural practices, increase productivity, and promote sustainable farming.

This repository contains both the frontend web interface and the backend API, integrated to deliver a seamless and powerful agricultural intelligence platform.

✨ Features

Based on the project name and structure, Agrow-AI is built to offer a comprehensive suite of features:

  • 🎯 AI-Driven Crop Analysis: Integrate machine learning models for detecting crop diseases, predicting yield, and analyzing soil health.
  • 🌱 Personalized Recommendations: Provide tailored advice for irrigation, fertilization, pest control, and optimal planting times.
  • πŸ“Š Interactive Dashboards: Visualize key agricultural data, trends, and AI insights through a user-friendly interface.
  • πŸ” User Authentication & Management: Secure user registration, login, and profile management for personalized experiences.
  • πŸ“ˆ Data Management: Efficiently store and retrieve crop data, farm statistics, and environmental parameters.
  • πŸ“± Responsive Design: A modern, adaptive user interface ensuring accessibility across various devices.
  • ⚑ Scalable Backend API: A robust API infrastructure capable of handling data processing and AI model interactions.

πŸ–₯️ Screenshots

πŸ› οΈ Tech Stack

Frontend:

React

Vite

Tailwind CSS

JavaScript

Backend:

Node.js

Express.js

JavaScript

Database:

MongoDB

DevOps:

Shell Script

πŸš€ Quick Start

Follow these steps to get Agrow-AI up and running on your local machine.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: v18.x or higher (recommended). You can download it from nodejs.org.
  • npm: Comes bundled with Node.js.
  • MongoDB: Ensure a MongoDB instance is running locally or accessible via a connection string. You can download MongoDB Community Server from mongodb.com.

Installation

  1. Clone the repository

    git clone https://github.com/Vishok-2006/Agrow-AI.git
    cd Agrow-AI
  2. Install Backend Dependencies Navigate to the backend directory and install the required packages:

    cd backend
    npm install
    cd .. # Go back to the root directory
  3. Install Frontend Dependencies Navigate to the frontend directory and install the required packages:

    cd frontend
    npm install
    cd .. # Go back to the root directory
  4. Environment setup Create .env files for both the backend and frontend.

    For the backend:

    cp backend/.env.example backend/.env

    Open backend/.env and configure your environment variables. A typical setup would include:

    PORT=5000
    MONGODB_URI="mongodb://localhost:27017/agrow_ai_db"
    JWT_SECRET="your_jwt_secret_key"
    AI_API_KEY="your_ai_service_api_key" # If integrating with external AI services
    

    For the frontend:

    cp frontend/.env.example frontend/.env

    Open frontend/.env and configure your environment variables. A typical setup would include:

    VITE_API_URL="http://localhost:5000/api" # Matches your backend port and API prefix
    
  5. Database setup Ensure your MongoDB server is running. No specific migration commands are usually needed for MongoDB. The backend application will handle schema creation on first use.

  6. Start the development servers The start.sh script is provided to simplify running both the frontend and backend concurrently.

    sh start.sh

    This script will:

    • Start the backend server (typically on http://localhost:5000).
    • Start the frontend development server (typically on http://localhost:5173).
  7. Open your browser Visit http://localhost:5173 to access the Agrow-AI application.

πŸ“ Project Structure

Agrow-AI/
β”œβ”€β”€ .gitignore             # Specifies intentionally untracked files to ignore
β”œβ”€β”€ AI_INTEGRATION_FIX_SUMMARY.md # Summary of AI integration fixes
β”œβ”€β”€ BACKEND_FIX_SUMMARY.md # Summary of backend fixes
β”œβ”€β”€ README.md              # This README file
β”œβ”€β”€ backend/               # Node.js/Express.js API
β”‚   β”œβ”€β”€ src/               # Backend application source code
β”‚   β”‚   β”œβ”€β”€ config/        # Configuration files (e.g., database connection)
β”‚   β”‚   β”œβ”€β”€ models/        # Mongoose/database schemas
β”‚   β”‚   β”œβ”€β”€ routes/        # API route definitions
β”‚   β”‚   β”œβ”€β”€ controllers/   # Logic for handling API requests
β”‚   β”‚   β”œβ”€β”€ middleware/    # Express middleware (e.g., authentication)
β”‚   β”‚   └── server.js      # Main entry point for the backend server
β”‚   β”œβ”€β”€ package.json       # Backend dependencies and scripts
β”‚   └── .env.example       # Example environment variables for backend
β”œβ”€β”€ docs/                  # Project documentation and resources
β”‚   └── architecture.md    # Example: system architecture documentation
β”œβ”€β”€ frontend/              # React/Vite web application
β”‚   β”œβ”€β”€ public/            # Static assets (index.html, images)
β”‚   β”œβ”€β”€ src/               # Frontend application source code
β”‚   β”‚   β”œβ”€β”€ assets/        # Images, icons, fonts
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/         # Application pages/views
β”‚   β”‚   β”œβ”€β”€ services/      # API communication logic
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ styles/        # Global styles, Tailwind CSS configuration
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main application component
β”‚   β”‚   └── main.jsx       # Frontend entry point
β”‚   β”œβ”€β”€ package.json       # Frontend dependencies and scripts
β”‚   └── .env.example       # Example environment variables for frontend
└── start.sh               # Script to run both frontend and backend development servers

βš™οΈ Configuration

Environment Variables

Both the frontend and backend use environment variables for sensitive information and configuration settings. These are loaded from .env files in their respective directories.

Backend (backend/.env)

| Variable | Description | Default | Required |

| :------------ | :------------------------------------------------ | :---------------- | :------- |

| PORT | Port for the backend server to listen on. | 5000 | Yes |

| MONGODB_URI | Connection string for MongoDB database. | mongodb://localhost:27017/agrow_ai_db | Yes |

| JWT_SECRET | Secret key for signing JWT tokens. | your_jwt_secret_key | Yes |

| AI_API_KEY | API key for external AI services (if applicable). | (none) | No |

Frontend (frontend/.env)

| Variable | Description | Default | Required |

| :-------------- | :------------------------------------------------ | :------------------------- | :------- |

| VITE_API_URL | Base URL for the backend API. | http://localhost:5000/api| Yes |

Configuration Files

  • backend/src/config/: May contain database connection settings, API configurations, or other backend-specific settings.

πŸ”§ Development

Available Scripts

The package.json files in frontend and backend define various scripts for development and building.

In frontend/

| Command | Description |

| :------------- | :-------------------------------------------- |

| npm run dev | Starts the frontend development server. |

| npm run build| Builds the frontend for production. |

| npm run lint | Lints the frontend source code. |

| npm run preview | Serves the production build locally. |

In backend/

| Command | Description |

| :------------- | :-------------------------------------------- |

| npm run start| Starts the backend server in production mode. |

| npm run dev | Starts the backend server in development mode (e.g., with nodemon). |

| npm test | Runs backend tests (if implemented). |

Development Workflow

For a unified development experience, use the start.sh script from the project root. This script orchestrates the launch of both frontend and backend development servers.

sh start.sh

πŸ§ͺ Testing

While specific test files are not provided in the directory structure, it is common practice to include tests for both frontend and backend.

Backend Testing

If testing frameworks like Jest or Mocha are configured in the backend/package.json, you would typically run:

cd backend
npm test

Frontend Testing

Similarly, for frontend testing with frameworks like Vitest or React Testing Library, you would run:

cd frontend
npm test

πŸš€ Deployment

Production Build

To create a production-ready build of the frontend application:

cd frontend
npm run build

This will generate optimized static assets in the frontend/dist directory.

Deployment Options

  • Local Deployment (start.sh): The start.sh script is suitable for local development. For production, you would typically run the backend separately and serve the frontend build assets.
  • Cloud Hosting (e.g., Vercel, Netlify, Render):
    • The frontend/dist folder can be deployed to static site hosts like Vercel or Netlify.
    • The backend can be deployed to platforms like Render, Heroku, AWS EC2, or Google Cloud Run.
  • Docker: For a more containerized deployment, consider adding Dockerfiles to both frontend and backend directories.

πŸ“š API Reference

The backend API exposes various endpoints to interact with the Agrow-AI system.

Authentication

The API likely uses JSON Web Tokens (JWT) for user authentication. Users will typically register and log in to obtain a token, which must be included in subsequent requests to protected routes.

Endpoints

(Based on typical full-stack applications with AI integration for agriculture)

| Method | Endpoint | Description | Authentication |

| :----- | :-------------------------- | :------------------------------------------- | :------------- |

| POST | /api/auth/register | Register a new user. | None |

| POST | /api/auth/login | Log in and receive a JWT. | None |

| GET | /api/users/me | Get current user profile. | JWT Required |

| GET | /api/crops | Retrieve all crop entries. | JWT Required |

| POST | /api/crops | Add a new crop entry. | JWT Required |

| GET | /api/crops/:id | Get a specific crop entry by ID. | JWT Required |

| PUT | /api/crops/:id | Update a crop entry. | JWT Required |

| DELETE| /api/crops/:id | Delete a crop entry. | JWT Required |

| POST | /api/ai/predict-yield | Get AI-driven yield prediction. | JWT Required |

| POST | /api/ai/detect-disease | Detect crop diseases using AI. | JWT Required |

| GET | /api/recommendations | Get personalized agricultural recommendations.| JWT Required |

🀝 Contributing

We welcome contributions to Agrow-AI! If you're interested in improving the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix: git checkout -b feature/your-feature-name.
  3. Make your changes.
  4. Commit your changes with clear and concise messages.
  5. Push your branch to your forked repository.
  6. Open a Pull Request to the main branch of this repository.

Please see our CONTRIBUTING.md for more detailed guidelines.

Development Setup for Contributors

The development setup is identical to the "Quick Start" guide. Ensure all prerequisites are met, dependencies installed in both frontend and backend, and environment variables are configured. Use sh start.sh to begin development.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Node.js & Express.js: For a powerful backend runtime and framework.
  • React & Vite: For an efficient and modern frontend development experience.
  • MongoDB: For flexible and scalable data storage.
  • AI/ML Libraries: (Specify any specific libraries used, e.g., TensorFlow.js, scikit-learn, PyTorch, if known)
  • Special thanks to all contributors and the open-source community for their valuable tools and resources.

πŸ“ž Support & Contact


⭐ Star this repo if you find it helpful!

Made with ❀️ by Vishok-2006

```

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages