# omarelhassanialaoui/mealtime_app architecture

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

- Interactive diagram: https://gitdiagram.com/omarelhassanialaoui/mealtime_app
- Repository: https://github.com/omarelhassanialaoui/mealtime_app

## Overview

##### High-Level Architecture Overview

**┌─ Presentation Layer ─────────────────────┐**
- (UI, Widgets, Pages, Bloc)               │
- ┬─────────────────────┘
- ↓
**┌─ Domain Layer ────────────────────────────┐**
- (Use Cases, Entities, Repository          │
- Interfaces)                              │
- ┬─────────────────────┘
- ↓
**┌─ Data Layer ──────────────────────────────┐**
- (Repository Implementations, Data Sources, │
- Models)                                  │
- ┬─────────────────────┘
- ↓
**┌─ External Services ────────────────────────┐**
- (Supabase, Other APIs)                    │
- ┘

##### Component Breakdown

- Authentication Module (Login, Signup, Reset Password)
- Onboarding Flow
- Meal Management
- User Preferences
- Common Widgets

b) Core Components:
- Dependency Injection
- Route Management
- Theme Management
- Resource Management

c) External Services:
- Supabase Authentication
- Supabase Database

##### Data Flow Visualization

**User Input → Presentation Layer (Bloc) → Use Cases → Repository → Data Sources → External Services**

##### Specific Implementation Details

a) Widget Tree Structure:
**MealTimeApp**
- Core Widgets
- ButtonWidget
- TextFieldWidget
- MealCardWidget
- Features
- Auth
- LoginPage
- SignUpPage
- Welcome
- WelcomePage

b) State Management Flow:
**User Action → Bloc Event → Bloc State → UI Update**

##### Technical Stack Indicators

Technology badges:
- Flutter
- Bloc
- Supabase
- Clean Architecture

##### Cross-Platform Support

Platform-specific implementations:
- Android
- iOS
- Web
- Desktop (Windows, macOS, Linux)

Important Considerations:

##### Demonstrate how the router configuration connects different pages.

This system design should emphasize the scalability of the architecture while showing how current features (authentication, theming) and planned features (meal planning, preferences) fit into the overall structure.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        UI["UI Components"]
        Auth["Authentication Module"]
        Welcome["Welcome/Onboarding"]
        CommonWidgets["Common Widgets"]
        
        subgraph "Common Widget Components"
            Button["Button Widget"]:::widget
            TextField["Text Field Widget"]:::widget
            MealCard["Meal Card Widget"]:::widget
            TextBlock["Text Block Widget"]:::widget
        end
        
        subgraph "Auth Components"
            Login["Login Page"]:::page
            Signup["Signup Page"]:::page
        end
    end
    
    subgraph "Core Components"
        DI["Dependency Injection"]
        Router["Route Management"]
        Theme["Theme Management"]
        Resources["Resource Management"]
        
        subgraph "Theme Components"
            Palette["App Palette"]:::theme
            Spacing["App Spacing"]:::theme
            Typography["App Typography"]:::theme
            Themes["App Themes"]:::theme
        end
        
        subgraph "Resource Components"
            Assets["Assets Manager"]:::resource
            Constants["Constants Manager"]:::resource
            Strings["Strings Manager"]:::resource
        end
        
        subgraph "Route Components"
            RouterConfig["Router Config"]:::route
            Routes["App Routes"]:::route
        end
    end
    
    subgraph "Application Entry"
        MealTimeApp["MealTime App"]
        Main["Main Entry"]
    end
    
    subgraph "External Services"
        Supabase["Supabase"]
        SupabaseAuth["Supabase Auth"]
        SupabaseDB["Supabase Database"]
    end
    
    %% Relationships
    UI --> Auth
    UI --> Welcome
    UI --> CommonWidgets
    CommonWidgets --> Button
    CommonWidgets --> TextField
    CommonWidgets --> MealCard
    CommonWidgets --> TextBlock
    Auth --> Login
    Auth --> Signup
    Auth --> SupabaseAuth
    
    MealTimeApp --> UI
    MealTimeApp --> DI
    MealTimeApp --> Router
    MealTimeApp --> Theme
    Main --> MealTimeApp
    
    Theme --> Palette
    Theme --> Spacing
    Theme --> Typography
    Theme --> Themes
    
    Resources --> Assets
    Resources --> Constants
    Resources --> Strings
    
    Router --> RouterConfig
    Router --> Routes
    
    SupabaseAuth --> Supabase
    SupabaseDB --> Supabase
    
    %% Click Events
    click Auth "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/presentation/auth/"
    click Login "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/presentation/auth/pages/login_page.dart"
    click Signup "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/presentation/auth/pages/sign_up_page.dart"
    click Welcome "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/presentation/welcome/"
    click Button "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/app/widgets/Button-widget/"
    click TextField "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/app/widgets/Text-field-widget/"
    click MealCard "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/app/widgets/meal-card-widget/"
    click TextBlock "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/app/widgets/TextBlockWidget/"
    click DI "https://github.com/OmarElhassaniAlaoui/MealTime_app/tree/dev/lib/src/app/core/dependancy-injection/"
    click Assets "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/resources/assets_manager.dart"
    click Constants "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/resources/constants_manager.dart"
    click Strings "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/resources/strings_manager.dart"
    click Palette "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/themes/app_palette.dart"
    click Spacing "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/themes/app_spacing.dart"
    click Typography "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/themes/app_typography.dart"
    click Themes "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/themes/app_themes.dart"
    click RouterConfig "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/routes/app_router_config.dart"
    click Routes "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/app/routes/app_routes.dart"
    click MealTimeApp "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/src/meal_time_app.dart"
    click Main "https://github.com/OmarElhassaniAlaoui/MealTime_app/blob/dev/lib/main.dart"
    
    %% Styling
    classDef widget fill:#a8e6cf
    classDef page fill:#ffd3b6
    classDef theme fill:#ffaaa5
    classDef resource fill:#ff8b94
    classDef route fill:#dcedc1
    
    %% Legend
    subgraph Legend
        L1["Widget"]:::widget
        L2["Page"]:::page
        L3["Theme"]:::theme
        L4["Resource"]:::resource
        L5["Route"]:::route
    end
```
