# suhail-sharieff/project-eco_earth architecture

> Architecture diagram of the GitHub repository suhail-sharieff/project-eco_earth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suhail-sharieff/project-eco_earth
- Repository: https://github.com/suhail-sharieff/project-eco_earth

## Overview

##### Project type and purpose
- This is a cross‑platform Flutter application (Android, iOS, Web) for sustainable waste management and recycling (Eco_Earth).
- It uses an MVVM pattern with GetX for state management, Firebase for authentication (and likely messaging), Supabase (PostgreSQL) for data storage, and the Gemini API for AI‑based waste classification.

##### File structure
- Top‑level platform folders: `android/`, `ios/`, `web/` (native build configs, assets, HTML)
- Core application under `lib/` subdivided into:
- `pages/` (UI views)
- `controllers/` (GetX ViewModels)
- `models/` (data classes, Freezed/Gson)
- `Utils/`, `constants/` (shared widgets and constants)
- Config files: `firebase_options.dart`, `pubspec.yaml`, `firebase.json`
- Build outputs under `build/web/`

##### README
- Confirms MVVM + GetX, Flutter 3.24.5, Dart 3.5.4, Firebase Auth, Supabase with RLS, Gemini AI API.
- Describes key user flows: authentication, reusables marketplace, complaint registration, discover centers, orders, leaderboard, AI classifier, vendor registration, notifications.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients Layer
    subgraph "Clients"
        Android_App["Android App"]:::presentation
        iOS_App["iOS App"]:::presentation
        Web_App["Web App"]:::presentation
    end

    %% Presentation Layer
    Flutter_UI["Flutter UI (lib/pages/)"]:::presentation

    %% Business Logic Layer
    subgraph "Business Logic (GetX Controllers)"
        Controllers["GetX Controllers (lib/controllers/)"]:::business
        Auth_Controller["Auth Methods (auth_methods.dart)"]:::business
        Splash_Screen["Splash Screen View"]:::presentation
        Waste_Classify_UI["Waste Classification Page"]:::presentation
        Chat_Bot_UI["AI Chat Bot Page"]:::presentation
    end

    %% Data Models & Utilities
    subgraph "Models & Config"
        Models["Data Models (lib/models/)"]:::business
        Utils["Shared Utilities (lib/Utils/)"]:::business
        Constants["App Constants (lib/constants/)"]:::business
        Firebase_Options["Firebase Config"]:::business
    end

    %% Services Layer
    subgraph "Data & Service Layer"
        Firebase_Auth["Firebase Auth Service"]:::services
        Supabase_Client["Supabase Client"]:::services
        Gemini_API["Gemini AI API"]:::external
        FCM["Firebase Cloud Messaging"]:::services
    end

    %% Backend & External
    subgraph "Backends & External"
        Postgres_DB["PostgreSQL (Supabase)"]:::external
    end

    %% Flows
    Android_App -->|"HTTP/GRPC"| Flutter_UI
    iOS_App -->|"HTTP/GRPC"| Flutter_UI
    Web_App -->|"HTTP"| Flutter_UI

    Flutter_UI -->|"user events"| Controllers
    Controllers -->|"calls"| Firebase_Auth
    Controllers -->|"calls"| Supabase_Client
    Controllers -->|"requests"| Gemini_API
    Controllers -->|"push tokens"| FCM

    Firebase_Auth -->|"auth tokens"| Controllers
    Supabase_Client -->|"CRUD data"| Postgres_DB
    Postgres_DB -->|"data response"| Supabase_Client
    Gemini_API -->|"classification result"| Controllers
    FCM -->|"push notification"| Flutter_UI

    Controllers -->|"uses"| Models
    Controllers -->|"uses"| Utils
    Controllers -->|"uses"| Constants
    Firebase_Auth -->|"config"| Firebase_Options

    %% Click Events
    click Android_App "https://github.com/suhail-sharieff/project-eco_earth/tree/main/android/"
    click iOS_App "https://github.com/suhail-sharieff/project-eco_earth/tree/main/ios/"
    click Web_App "https://github.com/suhail-sharieff/project-eco_earth/tree/main/web/"
    click Flutter_UI "https://github.com/suhail-sharieff/project-eco_earth/tree/main/lib/pages/"
    click Controllers "https://github.com/suhail-sharieff/project-eco_earth/tree/main/lib/controllers/"
    click Models "https://github.com/suhail-sharieff/project-eco_earth/tree/main/lib/models/"
    click Utils "https://github.com/suhail-sharieff/project-eco_earth/tree/main/lib/Utils/"
    click Constants "https://github.com/suhail-sharieff/project-eco_earth/tree/main/lib/constants/"
    click Firebase_Options "https://github.com/suhail-sharieff/project-eco_earth/blob/main/lib/firebase_options.dart"
    click Auth_Controller "https://github.com/suhail-sharieff/project-eco_earth/blob/main/lib/controllers/_01_auth_controllers/auth_methods.dart"
    click Splash_Screen "https://github.com/suhail-sharieff/project-eco_earth/blob/main/lib/pages/_01_auth_pages/_00_splash_screen.dart"
    click Waste_Classify_UI "https://github.com/suhail-sharieff/project-eco_earth/blob/main/lib/pages/_10_waste_classify/_01_classify_waste.dart"
    click Chat_Bot_UI "https://github.com/suhail-sharieff/project-eco_earth/blob/main/lib/pages/_10_waste_classify/chat_bot.dart"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#000,color:#000
    classDef business fill:#98FB98,stroke:#000,color:#000
    classDef services fill:#FFA500,stroke:#000,color:#000
    classDef external fill:#D3D3D3,stroke:#000,color:#000
```
