Skip to content

Repository files navigation

🌾 FasalSathi

Smart Agricultural Assistant for Farmers in India

License: MIT Platform Kotlin Python

Typing SVG

πŸ“‹ Quick Navigation

πŸš€ Get Started
Setup in 5 minutes
🌟 Features
What we offer
πŸ€– ML Models
95% accurate AI
🀝 Contribute
Join the team

🌟 Features

πŸ“± Core Functionality

  • Modern Dashboard - Material Design 3 interface with quick access to all features
  • User Profiles - Personalized farmer accounts with location-based services
  • Multi-language - Hindi, English, Marathi, Gujarati & more

🌀️ Weather Intelligence

  • Real-time Data - Integration with OpenWeatherMap API for 200+ Indian cities
  • 7-Day Forecast - Hourly weather breakdowns with farming recommendations
  • Offline Mode - Realistic simulation when internet unavailable

πŸ€– AI Assistant

  • Voice Recognition - Ask farming questions using voice
  • Image Analysis - Upload crop photos for AI-powered diagnosis
  • Text-to-Speech - Listen to responses in local languages
  • Smart Chat - Interactive conversation for agricultural queries

🌾 ML Crop Recommendation

  • 95% Accurate - AI-based crop recommendations using soil & environmental data
  • Soil Analysis - Advanced soil type detection with 92% accuracy
  • Smart Suggestions - Region-specific recommendations with confidence scores

πŸ›οΈ Government Schemes

  • Scheme Database - Access agricultural government programs
  • Eligibility Check - Verify eligibility for different schemes
  • Application Guide - Step-by-step help with applications

��️ Tech Stack


Mobile Machine Learning Backend
Kotlin 1.9.10 Random Forest (95% accuracy) OpenWeatherMap API
Material Design 3 Gradient Boosting (92% accuracy) Firebase
Room Database TensorFlow + scikit-learn RESTful APIs
MVVM Architecture OpenCV Image Processing Cloud Storage

πŸš€ Quick Start

⚑ One-Command Setup

# Clone repository
git clone https://github.com/AnuranjanJain/FasalSathi.git
cd FasalSathi

# For Android Development
./build.sh -i

# For ML Development  
./setup_ml.sh

πŸ“± Android Setup

Click to expand detailed steps

Prerequisites: Android Studio, JDK 8+, Android SDK (API 21+)

  1. Open in Android Studio

    • File β†’ Open β†’ Select FasalSathi folder
    • Wait for Gradle sync
  2. Build & Run

    ./build.sh -i              # Build and install
    ./gradlew assembleDebug    # Build only
  3. Run in Android Studio

    • Press Shift+F10 or click Run ▢️

🐍 ML Pipeline Setup

Click to expand detailed steps

Prerequisites: Python 3.8+, pip

  1. Automated Setup (Recommended)

    ./setup_ml.sh
  2. Manual Setup

    python3 -m venv venv
    source venv/bin/activate          # Linux/Mac
    # venv\Scripts\activate           # Windows
    pip install -r requirements.txt
    python ml_pipeline/train_models.py

πŸ€– ML Models

Model Type Accuracy Speed Size
🌾 Crop Recommendation Random Forest 95.2% <100ms 484 MB
πŸ”οΈ Soil Detection Gradient Boosting 92.1% <50ms 32 MB
πŸ“Έ Image Classifier CNN (TensorFlow) 89.5% <200ms 116 MB

Quick Test

from ml_pipeline.fixed_predictor import FixedModelPredictor

predictor = FixedModelPredictor("ml_pipeline/models")
result = predictor.predict_crop({
    'n': 90, 'p': 42, 'k': 43, 'ph': 6.5,
    'temperature': 25, 'humidity': 70, 'rainfall': 800
})

print(f"🌾 Crop: {result['crop']}")
print(f"πŸ“Š Confidence: {result['confidence']:.1%}")

πŸ“ Project Structure

FasalSathi/
β”œβ”€β”€ app/                    # Android application (Kotlin)
β”‚   β”œβ”€β”€ src/main/          # Source code
β”‚   β”‚   β”œβ”€β”€ java/          # Kotlin files (UI, data, ML integration)
β”‚   β”‚   └── res/           # Resources (layouts, strings, images)
β”‚   └── src/test/          # Unit & integration tests
β”œβ”€β”€ ml_pipeline/            # Machine Learning (Python)
β”‚   β”œβ”€β”€ train_models.py    # Model training
β”‚   β”œβ”€β”€ fixed_predictor.py # Production predictor
β”‚   └── models/            # Trained models (516 MB)
β”œβ”€β”€ Datasets/              # Training datasets
β”œβ”€β”€ build.sh               # Build automation script
β”œβ”€β”€ setup_ml.sh            # ML setup script
└── README.md              # This file

πŸ”¨ Build Commands

./build.sh        # Build debug APK
./build.sh -i     # Build and install on device
./build.sh -r     # Build release APK
./build.sh -c     # Clean build
./gradlew test    # Run tests

πŸ§ͺ Testing

# Unit tests
./gradlew test

# Integration tests (requires device)
./gradlew connectedAndroidTest

# Test coverage report
./gradlew jacocoTestReport

🀝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'feat: add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Commit Convention

feat: new feature
fix: bug fix
docs: documentation
style: formatting
refactor: code restructuring
test: add tests
chore: maintenance

πŸ› Troubleshooting

Gradle Sync Failed
./gradlew clean
./gradlew build --refresh-dependencies
Device Not Detected
adb devices
adb kill-server
adb start-server
Python Import Errors
source venv/bin/activate
pip install --upgrade -r requirements.txt
Out of Memory

Add to gradle.properties:

org.gradle.jvmargs=-Xmx4096m
org.gradle.daemon=true
org.gradle.parallel=true

πŸ“Š Performance

Metric Value
APK Size (Debug) 15-20 MB
APK Size (Release) 10-15 MB
Cold Start Time < 2s
Memory Usage 50-80 MB
ML Inference < 100ms

πŸ—ΊοΈ Roadmap

Current (v1.1) βœ…

  • Core features, ML models, Weather system, Multi-language

Next (v1.2) 🚧

  • Offline mode, Enhanced disease detection, Market prices, Push notifications

Future (v2.0) πŸ’‘

  • Community forum, SMS access, Satellite imagery, Government API integration

πŸ“„ License

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


πŸ™ Acknowledgments

  • Smart India Hackathon 2025 - Project opportunity
  • OpenWeatherMap - Weather data API
  • scikit-learn - ML framework
  • Android Community - Libraries and support

πŸ“ž Contact

GitHub Issues Discussions


⭐ Star us on GitHub if you find this helpful!


Footer

⬆ Back to Top

About

Mobile App

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages