How developeracademy-postech/2024-macc-a14-namudi-etc works
• 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.