How dedulka22/nba-app works
Main Components
• UI Layer:
• ViewModel Layer:
– Contains state management and business logic coordination via ViewModels (PlayersViewModel, PlayerDetailViewModel, TeamDetailViewModel).
• Domain Layer:
– Holds core business logic: UseCases (GetPlayersUseCase, GetPlayerDetailUseCase, GetTeamDetailUseCase), domain models (Player, PlayerDetail, Team), and repository interface definitions.
• Data Layer:
– Implements repository interfaces via classes in data/repository (PlayerRepositoryImpl, PlayerDetailRepositoryImpl, TeamDetailRepositoryImpl). This layer also includes data models (e.g., PlayerResponse, TeamResponse), API clients (NBAApi, UnsplashApi via ApiClient.kt), paging sources (PlayersPagingSource), and data services (e.g., PlayerImageService).
• Dependency Injection Layer:
– The DI module (in di/appModule.kt) sets up dependency injection using Koin.
• External Services:
– Represents integration with external APIs: the Ball Don't Lie API (for player and team information) and Unsplash API (for images).
• Testing:
– A separate testing structure for both instrumentation and unit tests (JUnit, MockK, etc.) to verify the functionality of components.
Understand Relationships and Data Flow
• The UI layer (built with Jetpack Compose and Material 3) interacts with its ViewModels.
• ViewModels invoke use cases defined in the Domain layer.
• Use cases use repository interfaces to fetch data.
• The repository implementations in the Data layer connect to API clients (Retrofit integrated with OkHttp) and PagingSources to manage remote API calls.
• Dependency Injection, configured via Koin (in di/appModule.kt), wires these components together.
• Data flows from external services (Ball Don't Lie API, Unsplash API) through the Data layer, then flows through Domain logic and to the UI.
Architectural Patterns and Design Principles
• MVVM: Ensure you capture the clear separation between UI (View), ViewModel (presentation logic), and Model (domain/data).
• Clean Architecture: Highlight the separation into Data, Domain, and Presentation layers.
• Dependency Injection: Mark the DI layer that decouples component instantiation (using Koin in this project).
• Modern asynchronous programming with Kotlin Coroutines & Flow is used in the data fetching and processing layers.
• Navigation: Note the integration with Voyager Navigation to manage screen transitions.
– In the center, show the Data layer linking out to these APIs.
– Above that, the Domain layer sits as a mediator presenting business logic.
– The UI and ViewModel layers sit at the top as the interaction point with users.
– The DI layer can be shown as a “glue” element (or a separate module on the side) that provides dependency wiring across layers.
Important Reminders for the Principal Software Engineer
• Every component is clearly segmented and labeled.
• Keep annotations concise but informative — focus on showing how the MVVM pattern, clean architecture, and dependency injection bring all parts together.
• Asynchronous data handling via Kotlin Coroutines & Flow where appropriate.
• Optionally, indicate test components to show how the application’s functionality is verified.