# md-owais-07/furniture-ios-swiftui architecture

> Architecture diagram of the GitHub repository md-owais-07/furniture-ios-swiftui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/md-owais-07/furniture-ios-swiftui
- Repository: https://github.com/md-owais-07/furniture-ios-swiftui

## Overview

##### Project type and purpose
- This is a native iOS mobile application built in SwiftUI (Furniture-iOS-SwiftUI).
- It serves as a client for browsing furniture catalogs, managing a shopping cart, performing authentication/authorization flows, and checkout/payment processes.
- The inclusion of GoogleService-Info.plist suggests integration with Firebase for things like analytics, authentication, or database.

##### File structure
- Top level: Xcode project files, GoogleService-Info.plist, README.
- “Furniture App” directory:
- Custom View: reusable SwiftUI view components (buttons, cards, image views).
- Sources/Screens: feature folders by screen, each following MVVM (Model, View, ViewModel).
- Supporting Files: core services (AppState, UserSessionManager), navigation manager, reusable utilities, toast components, animation JSON.
- No on-device database or backend code here, but networking likely happens via Firebase SDK or REST calls (not shown).

##### Detailed capture of essential elements
- Don’t omit the Supporting Files modules: AppState, NavigationManager, Toast components.
- That resources (fonts, assets, animations) feed into the UI layer.
- Shared AppCore (AppState, UserSessionManager) as a central hub for state.
- Out at least one full flow (e.g., product browse → add to cart → checkout → payment success).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        AppEntry["App Entry Point"]:::frontend
        CustomViews["Custom Views"]:::frontend
        ScreenViews["Screen Views"]:::frontend
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        LoginVM["LoginViewModel"]:::viewmodel
        RegisterVM["RegisterViewModel"]:::viewmodel
        ProfileVM["ProfileViewModel"]:::viewmodel
    end

    %% Domain/Data Layer
    subgraph "Domain/Data Layer"
        direction TB
        UserProfileModel["UserProfile Model"]:::domain
        ProductsModel["Products Model"]:::domain
        ProfileModel["Profile Model"]:::domain
        CartManager["Cart Manager"]:::domain
        UserSessionManager["UserSessionManager"]:::domain
        AppState["App State Store"]:::domain
        AppNavigationManager["App Navigation Manager"]:::domain
        SwipeBackHelper["Swipe Back Gesture Helper"]:::domain
        ToastComponents["Toast Components"]:::domain
        LottieAnimations["Lottie Animations"]:::domain
    end

    %% External Services
    subgraph "External Services"
        direction TB
        Firebase["Firebase SDK"]:::external
        PaymentGateway["Payment Gateway"]:::external
    end

    %% Resources Layer
    subgraph "Resources"
        direction TB
        FirebaseConfig["Firebase Configuration"]:::external
    end

    %% Connections
    AppEntry -->|launches| CustomViews
    AppEntry -->|launches| ScreenViews
    AppEntry -->|initializes| AppState
    AppEntry -->|initializes| UserSessionManager

    ScreenViews -->|binds to| LoginVM
    ScreenViews -->|binds to| RegisterVM
    ScreenViews -->|binds to| ProfileVM

    LoginVM -->|updates session| UserSessionManager
    RegisterVM -->|updates session| UserSessionManager
    ProfileVM -->|reads/writes| UserSessionManager

    LoginVM -->|loads profile| UserProfileModel
    ProfileVM -->|loads profile| ProfileModel
    ScreenViews -->|displays products| ProductsModel

    CartManager -->|manages| ProductsModel
    ProfileVM -->|manages cart| CartManager

    UserSessionManager -->|updates| AppState
    AppNavigationManager -->|controls| ScreenViews

    SwipeBackHelper -->|enhances| ScreenViews
    ToastComponents -->|presents| ScreenViews
    LottieAnimations -->|animates| ScreenViews

    UserSessionManager -->|auth calls| Firebase
    UserSessionManager -->|analytics| Firebase
    CartManager -->|sync cart| Firebase
    AppState -->|sync state| Firebase

    CartManager -->|process payment| PaymentGateway
    PaymentGateway -->|confirmation| CartManager

    FirebaseConfig -->|configures| Firebase

    %% Data Binding back to UI
    LoginVM -->|"data binding"| ScreenViews
    RegisterVM -->|"data binding"| ScreenViews
    ProfileVM -->|"data binding"| ScreenViews

    %% Click Events
    click AppEntry "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Furniture_AppApp.swift"
    click CustomViews "https://github.com/md-owais-07/furniture-ios-swiftui/tree/main/Furniture App/Custom View"
    click ScreenViews "https://github.com/md-owais-07/furniture-ios-swiftui/tree/main/Furniture App/Sources/Screens"
    click LoginVM "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Login/ViewModel/LoginViewModel.swift"
    click RegisterVM "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Register/ViewModel/RegisterViewModel.swift"
    click ProfileVM "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Tabbar/ProfileTab/ViewModel/ProfileViewModel.swift"
    click UserProfileModel "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Login/Model/UserProfile.swift"
    click ProductsModel "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Tabbar/HomeTab/Model/Products.swift"
    click ProfileModel "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Sources/Screens/Tabbar/ProfileTab/Model/ProfileModel.swift"
    click CartManager "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Supporting FIles/Utilities/CartManager.swift"
    click UserSessionManager "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Supporting FIles/App Core/UserSessionManager.swift"
    click AppState "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Supporting FIles/App Core/AppState.swift"
    click AppNavigationManager "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Supporting FIles/App NavigationController/AppNavigationManager.swift"
    click SwipeBackHelper "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/Supporting FIles/Utilities/EnableSwipeBackGesture.swift"
    click ToastComponents "https://github.com/md-owais-07/furniture-ios-swiftui/tree/main/Furniture App/Supporting FIles/Toast View"
    click LottieAnimations "https://github.com/md-owais-07/furniture-ios-swiftui/tree/main/Furniture App/Supporting FIles/App Animations"
    click FirebaseConfig "https://github.com/md-owais-07/furniture-ios-swiftui/blob/main/Furniture App/GoogleService-Info.plist"

    %% Styles
    classDef frontend fill:#D0E7FF,stroke:#0366d6,stroke-width:2px;
    classDef viewmodel fill:#DFFFD0,stroke:#2F8F2F,stroke-width:2px;
    classDef domain fill:#FFF8D0,stroke:#D6A500,stroke-width:2px;
    classDef external fill:#FFD0D0,stroke:#D62828,stroke-width:2px;
```
