Understand the Layered Architecture responsibilities
masterThe project follows a layered architecture inspired by Domain-Driven Design (DDD) and Clean Architecture. The layers are structured as follows:
- Domain: Encapsulates core business logic, rules, entities, value objects, and aggregates. It contains
UseCasedefinitions and implementations. It is isolated from UI and infrastructure. - Features: Implements UI business requirements and individual screens. It coordinates
DomainUseCases. Features can use different UI patterns (e.g., MVVM or TCA) without affecting other layers. Feature modules depend only on theDomainlayer and theUI. - Application: Responsible for creating the main user interface, managing navigation, and instantiating concrete
UseCaseimplementations. It uses the@Dependencylibrary to inject dependencies into theFeatureslayer. - Platform: Provides concrete implementations by utilizing the
Corelayer andDomainbusiness rules. It acts as a "plugin architecture" where implementations (likeMoviesAPIorMoviesDB) can be swapped (e.g., changing a database or API provider) without affecting business rules. - Core: Provides foundational infrastructure such as HTTP libraries, SwiftData extensions, Apollo extensions, and
FileCache.