Skip to content

Android app that allows users to navigate the catalog of artworks exposed by the Art Institute of Chicago API

Notifications You must be signed in to change notification settings

alejandro-rios/Art-Catalog-App-Android

Repository files navigation

Build Kotlin badge-android

Art Catalog App 🎉🎉

Art Catalog App is an app that allows users to navigate the catalog of artworks exposed by the Art Institute of Chicago API.

The app runs from API 24 and above, just clone the project and run it as you normally run an Android project.

⚙️ Architecture

The architecture used for the application consists of the following:

This project uses basic UiStates(ArtworkDetailUIState, ArtworkFavoritesUIState, ArtworksUiState) to handle the application interface state at a given moment.

📚 Tech stack

  • Retrofit2: Type-safe client for Android and Java/Kotlin, used to make API REST calls.
  • Koin: A smart Kotlin injection library.
  • Kotlin Coroutines: Simple library used to run Asynchronous or non-blocking calls.
  • Kotlin Serialization: Simple library used to serialize data.
  • Material components: Interactive building blocks for creating a user interface and animations between views.
  • Jetpack Compose: Recommended modern toolkit for building native UI.
  • Accompanist permissions: A library which provides Android runtime permissions support for Jetpack Compose.
  • ViewModel: A business logic or screen level state holder.
  • Room: Room is an abstraction layer on top of a SQLite database.
  • Navigation: Navigation is a framework for navigating between 'destinations' within an Android application.
  • Lifecycle: Build lifecycle-aware components that can adjust behavior based on the current lifecycle state.
  • Coil: Image loading for Android and Compose Multiplatform.
  • Mockk: Open source library focused on making mocking test more easily.
  • Kluent: Fluent Assertion-Library for Kotlin.
  • Turbine: A small testing library for kotlinx.coroutines Flow.

🧱 Project Structure

.
├── data
│   ├── db
│   ├── mappers
│   ├── models
│   ├── network
│   ├── repository
│   └── utils
├── di
├── domain
│   ├── models
│   └── repository
├── helpers
└── ui
    ├── components
    ├── navigation
    ├── screens
    ├── theme
    └── utils

Data Package

  • db all the classes related to local storage with Room.
  • mappers as the name suggests, this folder contains the required files to pass the info from the API response to the domain models in the project.
  • models data class files for the API call response.
  • network representation for the API Network client calls.
  • repository class implementation for each interface call declared in Domain package.
  • utils contains a Result Wrapper(CallResult), Exception file and extension used to process the Retrofit response.

Domain Package

  • models data class files for the API call response as we need it in the app.
  • repository interface that define the use case to be performed by Data package.

UI Package

  • components reusable UI components that can be used throughout the application.
  • navigation holds the navigation logic used on the app.
  • screens contains files that represents each screen, includes composable function, view model and ui state.
  • theme contains defined values of colors, shapes, typografy used by the app's theme.
  • utils contains a Modifier file that has some custom modifiers.
  • it also contains the MainActivity.

App Package

  • di all the classes related to dependency injection(appModule, dataModule, domainModule, databaseModule).
  • helpers contains the NotificationHelper which is a class to handle notifications.

🧪 Testing

This project includes unit tests for:

  • Extensions
  • Mappers
  • Repository
  • ViewModels

unit_tests

It also includes integration test for Room Database:

room_tests

And an integration test for Navigation:

navigation_tests

And an ui test for Screens:

ui_tests

And End to End tests with Maestro

🖼️ Images

home_screen home_screen_pagination favorites_screen favorites_empty_screen artwork_detail artwork_detail_saved artwork_detail_removed error_view

📓 Notes and considerations

  • Most of the colors where taken from the original website, but I'm not an expert 😅.
  • Normally, I use Koin for DI, but I also have experience with hilt.
  • warning image taken from here
  • placeholder image taken from here
  • empty_box image taken from here
  • logo image taken from here
  • no_image icon taken from here

About

Android app that allows users to navigate the catalog of artworks exposed by the Art Institute of Chicago API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages