# ibryitiz/flutter-jewelery-e-commerce-app architecture

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

- Interactive diagram: https://gitdiagram.com/ibryitiz/flutter-jewelery-e-commerce-app
- Repository: https://github.com/ibryitiz/flutter-jewelery-e-commerce-app

## Overview

##### Main Components Identification

a) Client-Side (Flutter App):
- UI Layer (Views)
- Business Logic Layer (ViewModels)
- Data Layer (Models)
- Services Layer
- Components Layer

b) Backend Services:
- Firebase Authentication
- Cloud Firestore
- Firebase Storage
- Gemini API Integration

**┌─ Presentation Layer ─────────────────────┐**
- Auth Views                             │
- Main Views (Home, Shop, Profile)       │
- Component Views                        │
- ┘

**┌─ Business Logic Layer ──────────────────┐**
- ViewModels                           │
- State Management (Provider)           │
- ┘

**┌─ Data & Services Layer ─────────────────┐**
- Models                               │
- Repositories                         │
- Firebase Services                    │
- External Services (Gemini API)       │
- ┘

##### Key Relationships to Highlight

a) Authentication Flow:
- Auth Views → Auth ViewModel → Firebase Auth Service

b) Data Flow:
- Views → ViewModels → Repositories → Firebase Services

c) External Services Integration:
- Chat Views → Gemini ViewModel → Gemini API

##### Component Details

For each major component, show:
- Main responsibilities
- Key dependencies
- Data flow direction
- State management connection points

##### Notes for Implementation

- MVVM architecture pattern
- Firebase integration points
- State management flow using Provider
- Clear separation of concerns
- User authentication flow
- Shopping features workflow

Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this e-commerce app unique, such as the integration of Gemini API for customer support and the comprehensive shopping features.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        AuthViews["Auth Views"]
        MainViews["Main Views"]
        ProfileViews["Profile Views"]
        ShopViews["Shop Views"]
        GeminiViews["Gemini Chat Views"]
        Components["Reusable UI Components"]
    end

    subgraph "Business Logic Layer"
        AuthVM["Auth ViewModels"]
        GeminiVM["Gemini Chat ViewModel"]
        GeneralVM["General ViewModels"]
        StateManagement["State Management (Provider)"]
    end

    subgraph "Data & Services Layer"
        Models["Data Models"]
        Repositories["Repositories"]
        
        subgraph "Firebase Services"
            FirebaseAuth["Authentication"]
            Firestore["Cloud Firestore"]
            Storage["Firebase Storage"]
        end
        
        GeminiAPI["Gemini API"]
        Constants["Constants & Config"]
    end

    %% Relationships
    AuthViews --> AuthVM
    MainViews --> GeneralVM
    ProfileViews --> GeneralVM
    ShopViews --> GeneralVM
    GeminiViews --> GeminiVM

    AuthVM --> FirebaseAuth
    GeminiVM --> GeminiAPI
    GeneralVM --> Repositories

    Repositories --> FirebaseAuth
    Repositories --> Firestore
    Repositories --> Storage

    %% State Management Connections
    StateManagement --> AuthVM
    StateManagement --> GeminiVM
    StateManagement --> GeneralVM

    %% Component Usage
    AuthViews --> Components
    MainViews --> Components
    ProfileViews --> Components
    ShopViews --> Components
    GeminiViews --> Components

    %% Click Events
    click AuthViews "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/views/auth_views/"
    click MainViews "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/views/"
    click ProfileViews "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/views/profile_views/"
    click ShopViews "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/views/shop_views/"
    click GeminiViews "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/views/gemini_chat_view/"
    click Components "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/components/"
    click AuthVM "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/view_model/auth_view_model/"
    click GeminiVM "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/view_model/gemini_chat_view_model/"
    click GeneralVM "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/view_model/"
    click Models "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/model/"
    click Repositories "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/repository/"
    click FirebaseAuth "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/blob/main/jewelry_app/lib/service/firebase/auth_service.dart"
    click Firestore "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/blob/main/jewelry_app/lib/service/firebase/firestore_service.dart"
    click Constants "https://github.com/ibryitiz/Flutter-Jewelery-E-Commerce-App/tree/main/jewelry_app/lib/constant/"

    %% Styling
    classDef presentation fill:#3498db,stroke:#2980b9,color:white
    classDef business fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white

    class AuthViews,MainViews,ProfileViews,ShopViews,GeminiViews,Components presentation
    class AuthVM,GeminiVM,GeneralVM,StateManagement business
    class Models,Repositories,Constants data
    class FirebaseAuth,Firestore,Storage,GeminiAPI external
```
