Skip to content

Latest commit

 

History

History
320 lines (219 loc) · 8.13 KB

File metadata and controls

320 lines (219 loc) · 8.13 KB

🌱 AgriTech — Smart Farming Solutions

AgriTech Banner

SWoC 2026 License: MIT PRs Welcome


📚 Table of Contents


⚠️ Note: For production deployment, use a WSGI server like gunicorn instead of Flask's built-in server.

⚠️ Never commit your .env file or API keys to the repository. Always keep secrets private!


AgriTech is an AI-powered smart agriculture platform designed to assist farmers with crop recommendations, yield prediction, plant disease detection, and community-driven collaboration—enabling sustainable and data-driven farming practices.


📌 Overview

  • AI-driven decision support for modern agriculture
  • Early-stage plant disease detection
  • Crop yield forecasting using machine learning models
  • Collaborative ecosystem for farmers and stakeholders

🚀 Quick Start

1️⃣ Clone the Repository

git clone https://github.com/omroy07/AgriTech.git
cd AgriTech

2️⃣ Run Backend (Primary – Flask)

pip install -r requirements.txt
python app.py

Backend URL:

http://localhost:5000

🔍 Backend Health Check

GET http://localhost:5000/health

Expected response:

{ "status": "ok" }

3️⃣ Run Frontend

cd src/frontend
python -m http.server 8000

Frontend URL:

http://localhost:8000

Note: Backend and frontend must be running simultaneously for proper functionality.


🖥️ Application Preview

AgriTech Dashboard AgriTech Dashboard

AgriTech Dashboard AgriTech Dashboard


🏗️ System Architecture

  1. User Input: Soil data and plant images
  2. Backend Processing: Flask APIs and model routing
  3. ML Inference:
    • CNNs for disease detection
    • Random Forest / XGBoost for crop recommendation
    • Regression models for yield prediction
  4. Output: Predictions with insights and actions

🌟 Core Features

  • 🌾 Crop Recommendation
  • 📉 Yield Prediction
  • 🔬 Disease Detection
  • 🤝 Farmer Community
  • 🛒 Shopkeeper Listings

🛠️ Tech Stack

🎨 Frontend

  • HTML5
  • CSS3
  • JavaScript (ES6)

⚙️ Backend

  • Python (Flask)
  • Node.js (Optional)

🤖 Machine Learning

  • TensorFlow
  • Scikit-learn
  • OpenCV

🗄️ Database & DevOps

  • MySQL
  • MongoDB
  • Firebase
  • Docker
  • GitHub Actions

📂 Project Structure

AGRITECH/
├── app.py                      # 🐍 Flask Backend (Main entry point)
├── server.js                   # 🟢 Node.js Server (Optional)
├── requirements.txt            # Python dependencies
├── firebase.js                 # Firebase config fetching
├── 📁 src/
│   └── 📁 frontend/            # 🌐 Frontend UI (HTML, CSS, JS)
│       ├── 📁 pages/           # Individual page files
│       ├── 📁 css/             # Stylesheets
│       └── 📁 js/              # Client-side scripts
├── 📁 Crop Recommendation/   # 🌾 Crop recommendation module
├── 📁 Disease Prediction/     # 🔬 Disease detection module
├── 📁 Crop Yield Prediction/   # 📊 Yield forecasting module
├── 📁 Community/               # 💬 community/forum backend
├── 📁 images/                  # 📸 Screenshots and assets
├── 📄 README.md                # This file
└── 📄 CONTRIBUTING.md          # Contribution guidelines

Backend vs Frontend

  • Backend (app.py at root): Flask server handling APIs, Firebase config
  • Frontend (src/frontend/): Static HTML/CSS/JS served via Python HTTP server
  • Optional Node Server (server.js): Alternative chat backend (not required)

🔐 Security & Reliability

  • Image sanitization using OpenCV
  • Secrets stored in .env files
  • ML models evaluated using standard performance metrics (accuracy varies by model and dataset)

⚙️ Environment Variables

GEMINI_API_KEY=your_api_key
FIREBASE_API_KEY=your_key
FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_STORAGE_BUCKET=your_bucket.appspot.com
FIREBASE_MESSAGING_SENDER_ID=your_sender_id
FIREBASE_APP_ID=your_app_id
FIREBASE_MEASUREMENT_ID=your_measurement_id

🛣️ Roadmap

  • Cloud Deployment
  • Mobile Application
  • Real-Time Weather API
  • AI Chatbot
  • Multilingual Support

🤝 Contribution Flow

Fork → Clone → Branch → Commit → Push → Pull Request → Review → Merge

Read CONTRIBUTING.md for SWoC 2026 guidelines.


👥 Team

Name Role
Om Roy Project Lead · Web · ML
Shubhangi Roy ML · Backend

🤝 Contributing & Support

We love contributions! Please read our CONTRIBUTING.md to get started with SWoC 2026 tasks. Whether it's fixing bugs, adding features, or improving documentation, your help is always welcome!


✨ Contributors

Thanks to all the wonderful people contributing to this project! 💖

Contributors

View full contribution graph


For production use, run the backend with a WSGI server like gunicorn:

pip install gunicorn
gunicorn app:app

🔑 API Keys Guide

  • Gemini API Key: Google AI Studio se generate karein.
  • Firebase Keys: Firebase Console se apne project ke liye keys lein.
  • API keys ko .env file me store karein (kabhi bhi repo me commit na karein).

🐞 Reporting Issues

Found a bug or want a new feature? Open an issue.


📄 License

This project is licensed under the MIT License.


❓ FAQ

Q: The project is not running. What should I do? A: Make sure all Python dependencies are installed, the .env file is properly configured, and the correct API keys are being used.

Q: How do I get a Gemini/Firebase API key? A: Refer to the “API Keys Guide” section above for step-by-step instructions.

Q: I am seeing the warning “This is a development server…” on the Flask server. What does it mean? A: This server is intended only for development. For production, use a WSGI server such as Gunicorn.

Q: I accidentally pushed my .env file. What should I do? A: Immediately rotate/regenerate your API keys, remove the .env file from Git tracking, add it to .gitignore, and clean the repository history if required.

Q: The /health endpoint is not responding. What could be wrong? A: Ensure the backend server is running correctly and that the /health route is properly implemented.


Made with ❤️ by the AgriTech Community — SWoC 2026