How mitshah2406/ecosaathi_waste-management works
Project Type and Purpose
• EcoSaathi is a full-stack, multi-component waste-management system built for a hackathon.
• It comprises:
• A Node.js/Express backend (pict_backend) exposing REST APIs and serving an admin UI.
• A Flutter mobile front-end (pict_frontend) implementing BLoC/Provider for state management.
• A Django microservice (route_optimization) for route-optimization (CVRP) using Google Maps APIs.
• ML modules (in ML/, waste_ml_model/, wastebot/) for bin-fill detection, litterbug detection, and chatbot.
Top-Level Component Breakdown
A. IoT Edge & Sensors
B. Backend Services
C. Route-Optimization Microservice
D. Mobile Frontend
E. External Services & Datastores
Relationships & Data Flows
• IoT devices (bin-fill sensors or CCTV) → HTTP/ MQTT → Node Backend “pict_backend.”
• pict_backend → WhatsApp API (Meta Developers) for notifications.
• pict_backend → Flutter Web-admin UI (EJS views + frontend-js assets).
• Flutter Mobile App ↔ pict_backend REST API (auth, events, biowaste, reports, tasks, chat, user profile).
• Flutter Mobile App → Django Route-Optimization Service → Google Maps API (Distance Matrix, Directions, Geocoding).
• Flutter Mobile App → Gemini API via ChatBotService for “WasteBot” queries.
• ML Detection:
• Litterbug Detector (YOLOv8 trained on Taco Trash) could be hosted as a separate service or embedded on device (waste_ml_model).
• pict_frontend/utils/recognition.dart hints at on-device inference or a proxied endpoint.
Architectural Patterns & Design Principles
• pict_backend uses MVC:
• models/ (Mongoose or Sequelize models in models/)
• controllers/ (REST logic)
• routes/router.js (HTTP routing)
• views/ + public/ + frontend-js for web-admin UI
• Flutter client uses BLoC + Provider pattern for state management (lib/bloc/, lib/providers/).
• The route optimizer is a self-contained Django app exposing REST endpoints.
• Separation of concerns:
• Microservices for domain-specific logic (route optimization)
• On-device or server-hosted ML modules
• Single Node backend for core business logic
• Node.js, Express, EJS, MongoDB or SQL (whichever db.js config uses)
• Docker & Docker Compose (pict_backend/Dockerfile + compose.yaml)
• Flutter (pict_frontend) with Dart, BLoC, Provider
• Django, Python, Google Maps APIs, SQLite (route_optimization)
• YOLOv8, OpenCV or TensorFlow Lite (ML folder & waste_ml_model)
• Gemini API (for WasteBot chats)
• Meta WhatsApp API (notification module)
Don’t Overthink – Be Detailed
• Break out each major module into its core parts even if lightly: e.g., pict_backend/controllers vs. pict_backend/models.
• External dependencies explicitly.