# jeremiekounoudji/trendygenie architecture

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

- Interactive diagram: https://gitdiagram.com/jeremiekounoudji/trendygenie
- Repository: https://github.com/jeremiekounoudji/trendygenie

## Overview

##### Project Type and Purpose
- This is a Flutter project named “trendygenie” that serves as a starting point for a cross-platform application. The project is built primarily as a client-side application using Flutter, targeting multiple platforms (Android, iOS, web, Windows, Linux, macOS).
- The README does not provide detailed business requirements so assume this is a front‐end focused application with some built in patterns (using controllers, models, pages, and widgets) that follow an MVC or MVVM-like approach.

##### Main Components
– Authentication pages (login, register, etc.)
– Home and Listing pages (views for different sections and services)
– Provider dashboard pages for additional use cases.
- Business Logic / Controller Layer: The lib/controllers folder contains various controllers handling authentication, service operations, categories, companies, etc. This layer manages user interactions, state handling, and navigation logic.
- Data/Model Layer: The lib/models folder defines data structures like category_model, company_model, service_item, support_ticket_model, and user_model. This represents the data side of your architecture.
- Service Integration: The lib/services directory (with supabase_service.dart) is used to connect to external backend services (possibly Supabase), indicating that the application’s data persistence and authentication could be backed by a remote service.
- Platform Abstraction and Native Integrations: The project includes platform-specific directories (android, ios, web, windows, linux, macos) which illustrate how Flutter wraps native views and functionalities. These directories contain configuration files, native code, assets, and launch screens tailored to each platform.

##### Relationships and Interactions
- The UI layer (pages and widgets) interacts with the controller layer to retrieve and update application state.
- Controllers manipulate data models, which are defined in the models directory.
- For data fetch/store operations, controllers delegate to service layers (e.g., supabase_service) to interact with external backend services.
- Platform-specific wrappers (Android, iOS, etc.) are responsible for initiating the Flutter engine and rendering the unified Flutter UI across different platforms.

##### Architectural Patterns and Design Principles
- The structure follows a layered architecture (presentation, business logic, and data layers).
- Use of an MVC/MVVM pattern is indicated by the separation between views (pages/widgets), controllers (handling user actions and navigation), and models (defining the data).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Flutter Core (lib/)"
        subgraph "UI Layer"
            Auth["Authentication Pages"]:::ui
            Home["Home & Listing Pages"]:::ui
            Provider["Provider Dashboard Pages"]:::ui
            Widgets["Other Pages & Widgets"]:::ui
        end
        CTR["Controller Layer (lib/controllers)"]:::ctrl
        MOD["Data/Model Layer (lib/models)"]:::model
        SV["Supabase Service (lib/services/supabase_service.dart)"]:::svc
    end

    Auth -->|"userAction"| CTR
    Home -->|"userAction"| CTR
    Provider -->|"userAction"| CTR
    Widgets -->|"userAction"| CTR

    CTR -->|"managesData"| MOD
    CTR -->|"apiCalls"| SV

    FLUTTER["Flutter Engine"]:::engine
    CTR -->|"compiledInto"| FLUTTER

    subgraph "Native Platforms"
        AND["Android"]:::native
        IOS["iOS"]:::native
        WEB["Web"]:::native
        WIN["Windows"]:::native
        LNX["Linux"]:::native
        MAC["macOS"]:::native
    end

    FLUTTER -->|"rendersOn"| AND
    FLUTTER -->|"rendersOn"| IOS
    FLUTTER -->|"rendersOn"| WEB
    FLUTTER -->|"rendersOn"| WIN
    FLUTTER -->|"rendersOn"| LNX
    FLUTTER -->|"rendersOn"| MAC

    click Auth "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/pages/authentication"
    click Home "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/pages/home"
    click Provider "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/pages/provider_dashboard"
    click Widgets "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/widgets"
    click CTR "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/controllers"
    click MOD "https://github.com/jeremiekounoudji/trendygenie/tree/main/lib/models"
    click SV "https://github.com/jeremiekounoudji/trendygenie/blob/main/lib/services/supabase_service.dart"
    click AND "https://github.com/jeremiekounoudji/trendygenie/tree/main/android/"
    click IOS "https://github.com/jeremiekounoudji/trendygenie/tree/main/ios/"
    click WEB "https://github.com/jeremiekounoudji/trendygenie/tree/main/web/"
    click WIN "https://github.com/jeremiekounoudji/trendygenie/tree/main/windows/"
    click LNX "https://github.com/jeremiekounoudji/trendygenie/tree/main/linux/"
    click MAC "https://github.com/jeremiekounoudji/trendygenie/tree/main/macos/"

    classDef ui fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef ctrl fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef model fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef svc fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef engine fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef native fill:#ede7f6,stroke:#673ab7,stroke-width:2px;
```
