# boostcampwm-2024/ios10-memorialhouse architecture

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

- Interactive diagram: https://gitdiagram.com/boostcampwm-2024/ios10-memorialhouse
- Repository: https://github.com/boostcampwm-2024/ios10-memorialhouse

## Overview

##### High-Level Architecture Overview
The system follows Clean Architecture with MVVM pattern, divided into distinct layers:

a. Presentation Layer (MHPresentation)
- Implement MVVM pattern
- Handle UI components and user interactions
- Contains ViewControllers, Views, and ViewModels

b. Domain Layer (MHDomain)
- Contains business logic
- Defines use cases and repository interfaces
- Houses core entities and business rules

c. Data Layer (MHData)
- Implements repository interfaces
- Manages data persistence
- Handles local storage operations

##### Key Components

a. Core Modules:

- Presentation  |     |    Domain     |     |     Data      |
- Layer      |<--->|     Layer     |<--->|     Layer     |

b. Storage Systems:

- CoreData      |     |    FileManager    |
- (Metadata & URLs) |     | (Media Storage)   |

##### Detailed Component Breakdown

- UI Components     |
- Book Views      |
- Media Editors   |
- Settings        |
- ^----------+

- v----------+
- View Models      |
- Book VM           |
- Media VM          |
- Settings VM       |
- ^----------+

- v----------+
- Use Cases        |
- Book Management   |
- Media Handling    |
- User Preferences  |
- ^----------+

- v----------+
- Repositories      |
- Book Repository   |
- Media Repository  |
- ^----------+

- v----------+
- Local Storage      |
- CoreData         |
- FileManager      |

##### Media Handling Flow

- Media     |     |  Media     |     |   Storage   |
- Capture UI  |---->| Processor  |---->| Manager     |

##### Important Relationships to Highlight
- Dependency flow (always pointing inward to the domain layer)
- Data flow between components
- Media handling pathways
- Storage interaction patterns

##### Additional Elements
- Notes about key architectural decisions
- Critical paths for main features
- Error handling flow

- Clean Architecture boundaries
- MVVM pattern implementation
- Media handling capabilities
- Local storage strategy (CoreData + FileManager)
- Key user flows for book creation and management

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef presentation fill:#3498db,stroke:#2980b9,color:white
    classDef domain fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#e67e22,stroke:#d35400,color:white
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1[Presentation Layer]:::presentation
        L2[Domain Layer]:::domain
        L3[Data Layer]:::data
        L4[Storage Systems]:::storage
    end

    %% Presentation Layer
    subgraph PresentationLayer
        UI[UI Components]:::presentation
        subgraph Features
            BookViews[Book Management]:::presentation
            MediaEditors[Media Editors]:::presentation
            Settings[Settings]:::presentation
        end
        
        subgraph ViewModels
            BookVM[Book ViewModels]:::presentation
            MediaVM[Media ViewModels]:::presentation
            SettingsVM[Settings ViewModels]:::presentation
        end
    end

    %% Domain Layer
    subgraph DomainLayer
        UseCases[Use Cases]:::domain
        Entities[Entities]:::domain
        RepositoryInterfaces[Repository Interfaces]:::domain
    end

    %% Data Layer
    subgraph DataLayer
        DTOs[Data Transfer Objects]:::data
        LocalRepos[Local Repositories]:::data
        
        subgraph Storage
            CoreData[CoreData Storage]:::storage
            FileManager[File Manager]:::storage
        end
    end

    %% Relationships
    UI --> Features
    Features --> ViewModels
    ViewModels --> UseCases
    UseCases --> Entities
    UseCases --> RepositoryInterfaces
    RepositoryInterfaces --> LocalRepos
    LocalRepos --> DTOs
    LocalRepos --> Storage
    
    %% Click Events
    click PresentationLayer "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHPresentation/MHPresentation/Source/"
    click DomainLayer "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHDomain/MHDomain/"
    click DataLayer "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHData/MHData/"
    click CoreData "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHData/MHData/LocalStorage/CoreData/"
    click FileManager "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHData/MHData/LocalStorage/FileManager/"
    click UseCases "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHDomain/MHDomain/UseCase/"
    click Entities "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHDomain/MHDomain/Entity/"
    click RepositoryInterfaces "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHDomain/MHDomain/Repository/"
    click DTOs "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHData/MHData/DTO/"
    click BookViews "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHPresentation/MHPresentation/Source/Book/"
    click MediaEditors "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHPresentation/MHPresentation/Source/EditBook/"
    click Settings "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHPresentation/MHPresentation/Source/Setting/"
    click LocalRepos "https://github.com/boostcampwm-2024/iOS10-MemorialHouse/tree/develop/MemorialHouse/MHData/MHData/Repository/"
```
