Skip to content

App for searching products from the market place of Mercado Libre

Notifications You must be signed in to change notification settings

hjdealba96/mercaapp-android

Repository files navigation

Merca App Android

This app allows you to find and see information about products exposed on the marketplace of Mercado Libre. You can see information about prices, shipping, condition and also you can take a look at the product on the official store.

How it looks 🎬

video

Specifications ✅

Current version: 1.0.0

Minimum OS version: Android 9 - Pie (API level 28)

Maximum OS version: Android 13 (API level 32)

Percentage of support devices (based on OS version): ~69%

Support for landscape: Yes

Dark mode: No

Offline support: No

Permissions required: ACCESS_NETWORK_STATE, INTERNET

Architecture 🛠

Following concepts of clean architecture, there 3 packages that represents the data, domain and UI. There's also one package for dependency injection.

Screen Shot 2022-05-02 at 9 52 58 PM

  • In the data layer, network operations resides inside a RemoteProductsDataSource and it is accessible through and implementation of ProductsRepository. Data models are converted to entities using mappers, this way complex deserialization logic doesn't not require changes on the business logic models.

  • In the domain layer, business logic operations lives in usecases and real life objects are represented as entities. There's also the definition of the ProductsRepository, this, in order to follow the dependency inversion principle.

  • In the UI layer, ProductsViewModel handles the events from the UI components and interacts with the domain layer through usecases, the data is presented to the interface using LiveData observables and compose States. observables All the screens are built using composables instead of the view system (XML).

Stack 📝

This apps was built using this libraries and frameworks:

UI

Jetpack Compose, Accompanist , Compose Material , LiveData , Splash Screen

Image Loading:

Coil

Logging:

Timber , OkHttp Logging Interceptor

Dependency Injection:

Hilt

Serialization:

Gson

Networking:

Retrofit

Testing:

MockK , Robolectric , JUnit , kotlinx.coroutines

Testing 🔎

Due to time reasons, testinng efforts were focused on the bussines logic and some part of the data layer. Mappers and networking logic are under unit tests. In the domain layer, some methods and logic of the ProductsViewModel are covered with unit tests, here's the coverage report:

Test coverage

Assumptions/Restrictions 👈

  • Based on the API documentation provided, searchs are limit up to 1000 results because at the endpoint for searching products (search?q) requires an authentication token.

  • There are two entities that wraps the information about a product, ProductEntity and ProductsDetailsEntity, the first one is used for showing the basic information of a product in the search results list. The second one provides the information of the details screen, this is done with the purpose of presenting the the most recent data.

  • Filters are not available and the sorting criteria of the products is the same as the received from the API.

TROUBLESHOOTING ⚠️

If you are experiencing having troubles when trying to see Previews of composables, upgrade Android Studio to the most recent version. The AS version used for building this project was 2021.1.1 Path 3 with Gradle Plugin 7.1.3 and Gradle Version 7.2.

Sometimes, unit tests that depends on the test coroutines returns failed results when they're in fact successful (false positives), if this happens, please re-run the test again and try to rebuild the project.

That's it! Thanks for checking the repo

About

App for searching products from the market place of Mercado Libre

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages