# edabarutcu/themeapp architecture

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

- Interactive diagram: https://gitdiagram.com/edabarutcu/themeapp
- Repository: https://github.com/edabarutcu/themeapp

## Overview

##### Project type and purpose
- This is an iOS application (“ThemeApp”) written in Swift, structured using VIPER (View-Interactor-Presenter-Entity-Router) per module.
- Its purpose is to let users browse, purchase, and apply themes (with widget support), plus user profile and authentication features.

##### File structure
- Top-level entries:
- ThemeApp-.xcodeproj / .xcworkspace – Xcode project & workspace files.
- Podfile – CocoaPods dependencies, including Firebase (GoogleService-Info.plist) and possibly other SDKs.
- Common/ – Shared code (authentication helpers, UI components, models, utilities).
- Modules/ – Feature modules, each following VIPER: Market, Profile, Purchased, ThemeDetail, WidgetManager.
- Resources/ – Localizable strings for en & tr.
- VIPER pattern:
- Each module has Contracts, Interactor, Presenter, Router, View (and supporting UI artifacts like ThemeCard, MenuRow).
- Common is a “shared library” layer providing UI building blocks and cross-cutting concerns (localization, auth).

##### Detail without over-splitting
– Capture every VIPER component per feature, but group them logically.
– Do not omit the Common layer – it underpins all modules.
– Highlight external dependencies (Firebase, Apple Sign-In, WidgetKit) to show integration points.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% App Shell
    subgraph "App Shell / Entry Point"
        AS["ThemeApp.swift"]:::appshell
    end

    %% Common Layer
    subgraph "Common Layer"
        Auth["AppleSignInManager"]:::common
        AuthBtn["AppleSignInButton"]:::common
        UserCard["UserInfoCard"]:::common
        UI1["CustomTabBar"]:::common
        UI2["TabBarButton"]:::common
        UI3["PurchasedThemeCard"]:::common
        UI4["WidgetPreviewCard"]:::common
        Model1["Theme"]:::common
        Model2["UserProfile"]:::common
        Loc1["LocalizationHelper"]:::common
        Loc2["LocalizationKeys"]:::common
        ResEn["en.lproj Localizable.strings"]:::common
        ResTr["tr.lproj Localizable.strings"]:::common
    end

    %% Feature Modules
    subgraph "Modules (VIPER)"
        subgraph "Market Module"
            MV["MarketView"]:::viper
            MP["MarketPresenter"]:::viper
            MI["MarketInteractor"]:::viper
            MR["MarketRouter"]:::viper
            MC["MarketContracts"]:::viper
            TC["ThemeCard"]:::viper
        end
        subgraph "Profile Module"
            PV["ProfileView"]:::viper
            PP["ProfilePresenter"]:::viper
            PI["ProfileInteractor"]:::viper
            PR["ProfileRouter"]:::viper
            PC["ProfileContracts"]:::viper
            MR2["MenuRow"]:::viper
        end
        subgraph "Purchased Module"
            PurV["PurchasedView"]:::viper
            PurP["PurchasedPresenter"]:::viper
        end
        subgraph "ThemeDetail Module"
            TDV["ThemeDetailView"]:::viper
            TDP["ThemeDetailPresenter"]:::viper
            TDI["ThemeDetailInteractor"]:::viper
            TDR["ThemeDetailRouter"]:::viper
            TDC["ThemeDetailContracts"]:::viper
        end
        subgraph "WidgetManager Module"
            WMV["WidgetManagerView"]:::viper
            WMP["WidgetManagerPresenter"]:::viper
            WMI["WidgetManagerInteractor"]:::viper
            WMR["WidgetManagerRouter"]:::viper
            WMC["WidgetManagerContracts"]:::viper
        end
    end

    %% Data & Services
    subgraph "Data & Services"
        Firebase["Firebase Auth & Firestore"]:::external
        LocalStorage["UserDefaults / Cache"]:::external
    end

    %% External Systems
    subgraph "External Systems"
        AppleSignIn["Apple Sign-In"]:::external
        WidgetKit["WidgetKit"]:::external
    end

    %% Flows & Relationships
    AS -->|launch| MR
    MR -->|builds| MI
    MI -->|"fetch/save"| Firebase
    MI -->|"cache"| LocalStorage
    MI -->|uses| Auth
    Auth -->|integrates| AppleSignIn

    MI --> MP
    MP --> MV
    MV --> MR

    MV --> UI1
    MV --> UI2
    MV --> UI3
    MV --> UI4

    %% Common models & utils usage
    MI --> Model1
    MI --> Model2
    MI --> Loc1
    MI --> Loc2

    %% Other modules follow VIPER flow
    MR -->|nav| PR
    PR --> PI --> PP --> PV --> PR

    MR -->|nav| WMR
    WMR --> WMI --> WMP --> WMV --> WMR
    WMR -->|widget api| WidgetKit

    %% Additional modules
    MR -->|nav| TDR
    TDR --> TDI --> TDP --> TDV --> TDR

    MR -->|nav| PC
    PC --> PI --> PP --> PV --> PR

    MR -->|nav| MC
    MC --> MI --> MP --> MV --> MR

    MR -->|nav| PurP
    PurP --> PurV --> MR

    %% Click Events
    click AS "https://github.com/edabarutcu/themeapp/blob/dev/ThemeApp-.xcodeproj"
    click Auth "https://github.com/edabarutcu/themeapp/blob/dev/Common/Authentication/AppleSignInManager.swift"
    click AuthBtn "https://github.com/edabarutcu/themeapp/blob/dev/Common/Authentication/AppleSignInButton.swift"
    click UserCard "https://github.com/edabarutcu/themeapp/blob/dev/Common/Authentication/UserInfoCard.swift"
    click UI1 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Components/CustomTabBar.swift"
    click UI2 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Components/TabBarButton.swift"
    click UI3 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Components/PurchasedThemeCard.swift"
    click UI4 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Components/WidgetPreviewCard.swift"
    click Model1 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Models/Theme.swift"
    click Model2 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Models/UserProfile.swift"
    click Loc1 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Utils/LocalizationHelper.swift"
    click Loc2 "https://github.com/edabarutcu/themeapp/blob/dev/Common/Utils/LocalizationKeys.swift"
    click ResEn "https://github.com/edabarutcu/themeapp/blob/dev/Resources/en.lproj/Localizable.strings"
    click ResTr "https://github.com/edabarutcu/themeapp/blob/dev/Resources/tr.lproj/Localizable.strings"
    click MV "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/MarketView.swift"
    click MP "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/MarketPresenter.swift"
    click MI "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/MarketInteractor.swift"
    click MR "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/MarketRouter.swift"
    click MC "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/MarketContracts.swift"
    click TC "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Market/ThemeCard.swift"
    click PV "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/ProfileView.swift"
    click PP "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/ProfilePresenter.swift"
    click PI "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/ProfileInteractor.swift"
    click PR "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/ProfileRouter.swift"
    click PC "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/ProfileContracts.swift"
    click MR2 "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Profile/MenuRow.swift"
    click PurV "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Purchased/PurchasedView.swift"
    click PurP "https://github.com/edabarutcu/themeapp/blob/dev/Modules/Purchased/PurchasedPresenter.swift"
    click TDV "https://github.com/edabarutcu/themeapp/blob/dev/Modules/ThemeDetail/ThemeDetailView.swift"
    click TDP "https://github.com/edabarutcu/themeapp/blob/dev/Modules/ThemeDetail/ThemeDetailPresenter.swift"
    click TDI "https://github.com/edabarutcu/themeapp/blob/dev/Modules/ThemeDetail/ThemeDetailInteractor.swift"
    click TDR "https://github.com/edabarutcu/themeapp/blob/dev/Modules/ThemeDetail/ThemeDetailRouter.swift"
    click TDC "https://github.com/edabarutcu/themeapp/blob/dev/Modules/ThemeDetail/ThemeDetailContracts.swift"
    click WMV "https://github.com/edabarutcu/themeapp/blob/dev/Modules/WidgetManager/WidgetManagerView.swift"
    click WMP "https://github.com/edabarutcu/themeapp/blob/dev/Modules/WidgetManager/WidgetManagerPresenter.swift"
    click WMI "https://github.com/edabarutcu/themeapp/blob/dev/Modules/WidgetManager/WidgetManagerInteractor.swift"
    click WMR "https://github.com/edabarutcu/themeapp/blob/dev/Modules/WidgetManager/WidgetManagerRouter.swift"
    click WMC "https://github.com/edabarutcu/themeapp/blob/dev/Modules/WidgetManager/WidgetManagerContracts.swift"
    click Firebase "https://github.com/edabarutcu/themeapp/tree/dev/Podfile"
    click Firebase "https://github.com/edabarutcu/themeapp/blob/dev/GoogleService-Info.plist"

    %% Styles
    classDef viper fill:#AED6F1,stroke:#1F618D,color:#1B4F72;
    classDef common fill:#ABEBC6,stroke:#196F3D,color:#145A32;
    classDef external fill:#F5B041,stroke:#A04000,color:#78281F;
    classDef appshell fill:#D7BDE2,stroke:#6C3483,color:#4A235A;
```
