This application leverages the JSONPlaceholder API to exhibit album lists and the associated photo details.
This project primarily adopts the Model-View-ViewModel (MVVM) pattern and certain principles of clean architecture, emphasizing the separation of concerns and encapsulation. Despite not strictly adhering to every facet of clean architecture, such as the absence of Use Cases and exact division of modules like Domain and Data, the application is designed with a focus on maintainability and scalability.
โโโ photo-album
โโโ data // Handles API response models and network requests
โ โโโ remote
โ โโโ model (AlbumModel.kt, PhotoModel)
โ โโโ WebService
โโโ di // Contains all dependencies, provided in AppModule
โ โโโ AppModule
โโโ domain // Hosts business logic components (repositories, mappers)
โ โโโ model (AlbumItem, PhotoItem)
โ โโโ PhotoMapper
โ โโโ PhotoRepository
โโโ ui // Houses UI-related classes (components, screens)
โ โโโ album (AlbumScreen, AlbumUiState, AlbumViewModel)
โ โโโ component (AlbumCard, DetailView, ErrorView, PhotoCard)
โ โโโ photo (PhotoDetailScreen, PhotoScreen, PhotoUiState, PhotoViewModel)
โ โโโ theme // Contains classes related to the application's UI.
โ โโโ MainActivity
โโโ util // Includes utility and exception handling classes
โ โโโ exception (AppException, ExceptionExtension)
โ โโโ Constant
โ โโโ Route
โ โโโ UiUtil
โโโ PhotoAlbumApp
- Displays all available albums.
- Shows photos within each album.
- Provides a detailed view for each photo.
- Asynchronous data loading.
- Utilizes popular libraries for network requests and dependency injection.
The following libraries and tools were utilized in the project:
- Kotlin as the main language.
- Jetpack Compose for building the UI.
- AndroidX Paging Library for handling pagination in the application.
- Navigation-Compose for handling in-app navigation.
- Coil for image loading.
- Kotlin Coroutines & Flow for handling asynchronous tasks.
- Hilt for dependency injection.
- Retrofit for making network requests.
- OkHttp3 for implementing interceptor, logging and networking.
- GSON Converter for parsing JSON.
- JUnit, MockK and Kotlinx Coroutines Test for Testing.
While the project is functional and robust, there are areas that could see improvements in the future:
- Paging: Since the JSONPlaceholder API does not support pagination, the app currently does not feature pagination capabilities. If the API were to support it in the future, pagination would be an ideal addition.
- Expanded Test Coverage: More comprehensive unit and UI tests to ensure the app's stability.
- User Experience: Refine the UI and UX design of the app for a more engaging user experience.