How vancelopes/composecat works
Main Architectural Components
A. Presentation Layer (UI)
• Jetpack Compose components
• CatListScreen
• CatViewItem
• Theme components
• ViewModel (CatsViewModel)
B. Domain Layer
• Use Cases (GetCats)
• Repository Interfaces
• Domain Models (Cat)
C. Data Layer
• Repository Implementation
• API Services
• DTOs (Data Transfer Objects)
• Network Infrastructure
Dependencies and Injection Layer
• Dependency Injection modules (Hilt/Dagger)
• ApiModule
• CatRepositoryModule
• GetCatsUseCaseModule
┌─────────────────────────────────────────────────────┐
• Presentation Layer │
• ┌─────────────┐ ┌─────────────┐ │
• ComposableUI │←───│ViewModel │ │
• ┘ └─────────────┘ │
• ┬─────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────┐
• Domain Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Use Cases │←───│Repository │ │
• Interface │ │
• ┘ └─────────────┘ │
• ┬─────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────┐
• Data Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Repository │←───│ API │ │
• Implementation│ │ Service │ │
• ┘ └─────────────┘ │
• ┘
Data Flow Representation
• Flow of data from API to UI
Detailed Component Breakdown
A. Presentation Layer Details:
• CatListScreen (Composable)
• CatViewItem (Composable)
• CatsViewModel
• UI Theme components
B. Domain Layer Details:
• GetCats UseCase
• CatRepository Interface
• Cat Domain Model
C. Data Layer Details:
• CatRepositoryImpl
• CatApi and CatApiService
• RequestInterceptor
• CatDto