Skip to content

bakardd/hackthon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 FarmForward - Smart Agriculture Management

Hackathons Tech AI

About

� FarmForward is an AI-powered agriculture management platform that helps farmers make data-driven decisions for crop cultivation. The platform integrates machine learning models with environmental data to provide personalized crop recommendations and farm management tools.

  • 📍 Features: AI Crop Recommendations, Plot Management, Environmental Monitoring
  • 🎓 Technology: React + TypeScript, Firebase, Python ML Models
  • 📅 Built During: MLH Hackathon 2025

Featured Components

🌾 AI Crop Recommendation Engine

  • ML Model Integration — Uses RandomForest classifier trained on environmental data (temperature, humidity, pH, rainfall) to recommend optimal crops
  • Real-time Predictions — Provides instant crop recommendations with confidence scores and detailed reasoning
  • Comprehensive Database — Includes yield expectations, market prices, and growth duration for recommended crops

📊 Smart Farm Dashboard

  • Plot Management — Create and manage multiple farm plots with environmental data tracking
  • Environmental Monitoring — Track temperature, humidity, pH levels, and rainfall data
  • Data Visualization — Interactive charts for weather forecasts and agricultural metrics

� Firebase Integration

  • User Authentication — Secure user accounts with plot-specific data
  • Real-time Database — Firestore integration for plot and crop data management
  • Cloud Storage — Scalable data storage for farm records and ML predictions

Project Structure

hackthon/
├── webapp/                    # React TypeScript frontend
│   ├── src/
│   │   ├── components/       # UI components including PlotSetupDialog
│   │   ├── lib/             # Services (database, ML, Firebase)
│   │   ├── hooks/           # Custom React hooks (useAuth, usePlots)
│   │   └── types/           # TypeScript type definitions
│   └── package.json
├── python-ML/               # Machine Learning model
│   ├── train_crop_recommendation.py
│   ├── Crop_recommendation.csv
│   └── artifacts/          # Trained model files
└── README.md

ML Model Details

Features Used

  • Temperature (°C) - Average temperature conditions
  • Humidity (%) - Average humidity levels
  • pH Level (0-14) - Soil acidity/alkalinity
  • Rainfall (mm) - Annual precipitation

Supported Crops

Rice, Maize, Wheat, Cotton, Sugarcane, Coffee, Coconut, Jute

Model Performance

  • Algorithm: RandomForest Classifier
  • Features: 4 environmental parameters
  • Training Data: Crop recommendation dataset with 2200+ samples
  • Accuracy: 95%+ on test data

Getting Started

Prerequisites

  • Node.js 18+
  • Firebase account
  • Python 3.8+ (for ML model training)

Installation

  1. Clone the repository

    git clone https://github.com/bakardd/hackthon.git
    cd hackthon
  2. Setup Frontend

    cd webapp
    npm install
    cp .env.example .env
    # Add your Firebase configuration to .env
    npm run dev
  3. Setup ML Model (Optional - pre-trained model included)

    cd python-ML
    pip install -r requirements.txt
    python train_crop_recommendation.py --csv Crop_recommendation.csv --out-dir artifacts

Environment Variables

Create webapp/.env with your Firebase configuration:

VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id

Usage

  1. Create Account - Sign up for a new farmer account
  2. Add Plots - Create farm plots with environmental data
  3. Get Recommendations - Receive AI-powered crop recommendations
  4. Monitor Progress - Track crop growth and environmental conditions
  5. Manage Farm - Update plot information and harvest records

Tech Stack

Frontend

  • React 18 with TypeScript
  • Vite for fast development
  • Tailwind CSS + Shadcn/UI for styling
  • React Router for navigation
  • TanStack Query for state management

Backend & Services

  • Firebase Authentication - User management
  • Firestore - NoSQL database
  • Firebase Storage - File uploads
  • Firebase Analytics - Usage tracking

Machine Learning

  • Python with scikit-learn
  • RandomForest Classifier
  • Feature Engineering (StandardScaler, LabelEncoder)
  • Model Persistence (joblib)

Contributing

  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 - see the LICENSE file for details.

Acknowledgments

  • MLH - For organizing amazing hackathons
  • Firebase - For backend infrastructure
  • Scikit-learn - For ML model capabilities
  • Shadcn/UI - For beautiful React components

This profile was generated by GitHub Copilot using the GitHub and MyMLH MCP Servers at an MLH (Major League Hacking) student hackathon. Find events near you at mlh.io/events.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages