# developeracademy-postech/2024-macc-a14-namudi-etc architecture

> Architecture diagram of the GitHub repository developeracademy-postech/2024-macc-a14-namudi-etc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/developeracademy-postech/2024-macc-a14-namudi-etc
- Repository: https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc

## Overview

- Main Application (Harubee)
– App Layer (“Harubee/Sources/App” contains the AppDelegate, main SwiftUI entry point (HarubeeApp.swift), and the Coordinator files demonstrating the MVVM-C structure).
– Presentation Layer (e.g., “Harubee/Sources/Presentation” folders for Calendar, Today, Onboarding, Setting, etc.).
– Domain Layer (“Harubee/Sources/Domain” with domain models, use cases, protocols, and repository interfaces that capture business logic).
– Data Layer (“Harubee/Sources/Data” providing DTOs, service implementations, repository implementations, and error handling).
– Helper and Utility Components (e.g., “Harubee/Sources/Helper” for constants, design system components, extensions, managers, and keys).
– Dependency Injection (DI) containers (“Harubee/Sources/App/DI”) that manage the provision of repositories, services, and use cases.

- Widget Extension (HarubeeWidget)
– Contains separate resources, sources, managers, models, and views targeted for WidgetKit.
– Note its role as an external component that provides glanceable information and integrates partially with the architecture from the main application (e.g., shared models where applicable).

- Testing (HarubeeTests)
– A separate suite for unit tests (e.g., tests for Budget logic in SalaryBudgetPeriodTests.swift).

##### Out the Relationships and Data Flow
- Use a layered design where higher-level components (Presentation/Coordinator) interact with the Domain layer via well-defined use cases.
- The Domain layer, representing business logic, invokes operations on interfaces defined in the Data layer.
- The Data layer implements persistence (e.g., using UserDefaults, FirebaseAnalytics service, etc.) and DTO conversion.
- The DI system links these layers, ensuring that the coordinators and view models receive the correct concrete implementations of repositories and services.
- For the Widget, illustrate its entry point and how it retrieves or synchronizes data (for instance, through a widget manager in “HarubeeWidget/Sources/Managers”) from the same domain or data layers if shared.

##### Architectural Patterns and Frameworks
- MVVM-C (separating the coordinator, view models, and views), which is clearly delineated in the “Coordinator” and “Presentation” directories.
- Use of Clean Architecture by separating the presentation (UI), domain (business logic), and data (storage/services) concerns.
- Technologies like SwiftUI for UIs, SwiftData for storage, WidgetKit for the extension, and Firebase for analytics.

- Optionally, represent the “Testing” module as a side component that interacts with the Domain and Data layers.

- Flow from the Presentation components (user actions) to the Domain layer (via use cases).
- The Domain layer calling the Data layer via repository interfaces.
- Connections from the DI block to all layers that require dependency injection.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Main Application (Harubee)"
        A["App Layer"]:::app
        P["Presentation Layer"]:::presentation
        D["Domain Layer"]:::domain
        DA["Data Layer"]:::data
        H["Helper & Utility"]:::helper
        DI["Dependency Injection"]:::di

        A -->|"launches"| P
        P -->|"calls"| D
        D -->|"accesses"| DA
        H -->|"supports"| P
        DI -->|"injects"| A
        DI -->|"injects"| P
        DI -->|"injects"| D
        DI -->|"injects"| DA
    end

    subgraph "Widget Extension (HarubeeWidget)"
        W["Widget Module"]:::widget
        WM["Widget Manager"]:::widget
        W -->|"retrieves"| WM
    end

    subgraph "Testing Module (HarubeeTests)"
        T["Unit Tests"]:::testing
    end

    WM -->|"syncs"| D
    T -->|"testsDomain"| D
    T -->|"testsData"| DA

    click A "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/App"
    click P "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/Presentation"
    click D "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/Domain"
    click DA "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/Data"
    click H "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/Helper"
    click DI "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/Harubee/Sources/App/DI"
    click W "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/HarubeeWidget/Sources"
    click T "https://github.com/developeracademy-postech/2024-macc-a14-namudi-etc/tree/develop/HarubeeTests"

    classDef app fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef presentation fill:#add8e6,stroke:#000080,stroke-width:2px;
    classDef domain fill:#90ee90,stroke:#006400,stroke-width:2px;
    classDef data fill:#ffdead,stroke:#cd853f,stroke-width:2px;
    classDef helper fill:#e6e6fa,stroke:#483d8b,stroke-width:2px;
    classDef di fill:#f0e68c,stroke:#b8860b,stroke-width:2px;
    classDef widget fill:#d3d3d3,stroke:#696969,stroke-width:2px;
    classDef testing fill:#ffd700,stroke:#b8860b,stroke-width:2px;
```
