How vishvendra01/popflix works
Main Components
a. Client Layer (UI):
• Fragments (MovieListingFragment, MovieDetailsFragment)
• Adapters (MovieListingAdapter)
• ViewModels (MovieListingViewModel)
b. Domain Layer:
• Repository (MovieRepository)
• Entity Models (MovieEntity)
• Data Models (Movie)
• Mappers (MovieMapper)
c. Data Layer:
• Split into two main sources:
• Local Source (Room Database)
• MovieDatabase
• MovieDao
• Remote Source (API)
• TMDb API Client
• NetworkSource
d. Dependencies/External Services:
• TMDb API
• Image Loading (Glide)
• Dependency Injection (Dagger components)
Connection Flow
• UI → ViewModel (one-way data binding)
• ViewModel → Repository (data requests)
• Repository ← → Local Source (Room DB)
• Repository ← → Remote Source (TMDb API)
Specific Implementation Details
a. Dependency Injection Structure:
• AppComponent
• MovieListingComponent
• Various Modules (NetworkModule, RepositoryModule, etc.)
b. Data Flow Patterns:
• RxJava Streams
• LiveData Observers
• Room Database flows
Technical Specifications
• Used Technologies:
• Kotlin
• RxJava
• Room
• Retrofit
• Glide
• Dagger
[UI Layer (Fragments, ViewModels)]
• ↓
[Domain Layer (Repository, Models)]
• ↓
[Data Layer (Local/Remote Sources)]
• ↓
[External Services (TMDb API)]
Important Considerations:
Offline-first architecture by showing the data flow
• First check local database
• If data not available/stale, fetch from network
• Cache network response
MVVM pattern
• Unidirectional data flow
• Clear separation of concerns
• ViewModel as the mediator
Single-Activity architecture
• MainActivity as the container
• Fragment navigation
• Shared ViewModel scopes
Pagination handling
• PaginationListener
• Data loading states
• Cache management