NFL is a Kotlin app utilizing the ESPN API to provide league news, scores, and rosters. The user can check the latest news and scores from around the league and select favorite teams for customized news preferences.
The purpose of this app is to showcase my understanding of properly utilizing a reliable, scalable pattern of building an app.
The architecture of this project is MVVM (Model View ViewModel) Clean Architecture. The app is built in a way for easy readability by other developers. I have followed the recommended app architecture from Android.
The architecture is divided into three layers:
- UI Layer (Presentation Layer)
- Domain Layer (Mapping & Use Case)
- Data Layer (Data Source & Repository)
The responsibility of the UI layer (or presentation layer) is to display the application data on the screen. In this project, the UI layer includes UI elements such as Jetpack Compose functions, State Holders, and the UI States. All the UI element designing is done using declarative UI (Jetpack Compose) instead of XML.
I've created UI states to ensure Unidirectional Data Flow.
The domain layer site between the UI and data layers. The domain layer is responsible for encapsulating complex business logic, or simple business logic that is reused by multiple ViewModels. It includes all the Use Cases of the app, for example, PlanetsListUseCase. This is also the layer where we map response, Dto models to domain, UI models. This helps fitler out what we do not need in the UI layer from the response.
The data layer contains business logic and repositories containing data sources. In this app, DataRepository contains two data sources such as RemoteDataSource and LocalDataSource. The RemoteDataSource fetches data from API, whereas, LocalDataSource gets data from the Room database.
I am using Hilt dependency injection library to provide all the dependencies I have to pass among different layers.
The image below provides context to the architecture pattern used in this app:
- AirBnB Epoxy library - Defines UI utilizing the Epoxy RecyclerView library.
- Jetpack Navigation - interactions that let users navigate across, into, and back out from the different pieces of content within your app.
- View Binding - View binding is a feature that makes it easier to write code that interacts with views.
- Modern App Architecture - This guide encompasses best practices and recommended architecture for building robust, high-quality apps.
- Retrofit - Interacts with the API and send network requests with OkHttp.
- Room - Create, store, and manage persistent data backed by an SQLite database.
- Hilt - Dependency injection plays a central role in the architectural pattern used.
- Kotlinx Coroutines - Library Support for coroutines. I used this for asynchronous programming to obtain data from the network.
- Moshi - JSON Parser, used to parse requests on the data layer for Entities and understands Kotlin non-nullable and default parameters.
- Picasso - A powerful image downloading and caching library for Android.
- Flows - A flow is conceptually a stream of data that can be computed asynchronously. The emitted values must be of the same type.








