How devmfawzy/weatherapp works
Main Components
• Domain Layer: This contains the core business logic, entities (e.g., Weather, Location), repository interfaces (WeatherRepositoryProtocol, SearchHistoryRepositoryProtocol), services (LocationServiceProtocol), and use cases (GetWeatherUseCase, GetCurrentLocationUseCase, ManageSearchHistoryUseCase).
• Data Layer: This layer handles data management and includes:
• Data Sources: Remote (WeatherRemoteDataSource) and Local (SearchHistoryLocalDataSource, WeatherLocalDataSource).
• Repository Implementations: (WeatherRepository and SearchHistoryRepository) which conform to the protocol contracts defined in the Domain layer.
• DTOs/Models for mapping external data (WeatherResponseDTO, WeatherLocal).
• Services that manage low-level details such as Location services (LocationService).
• Presentation Layer: This includes:
• UI Components (Views and subcomponents such as WeatherView, WeatherContentView, SearchView, WeatherCardView, ErrorView, LoadingView, LocationPermissionInfoView).
• View Models (WeatherViewModel) that manage state and translate Domain data to UI models.
• UIModels (WeatherUIModel) to structure data for the view.
Architectural Patterns and Technologies
• For each component, annotate with the relevant technologies. For example, mention that the Presentation layer leverages SwiftUI and the ViewModel pattern.