Rollback is simple application, which uses Fake store API, to serve as demo e-commerce application which allows users to login to existing account; preview list of products, add and delete product.
The main purpose of the project, which follows variation of Clean Architecture, is to demonstrate how to break your application into several modules, how to use them, how to split the work and via dependency injection and interfaces use functions, classes and their methods etc. as sort of a black box.
Clone the repository, and run the project, no additional setup is needed. Simple as that.
This project is loosely following clean architecture approach as recommended by Antonio Levia in his article Clean architecture for Android with Kotlin: a pragmatic approach for starters. The idea is to split your app into several modules and via dependency injection and interfaces provide their usage (what we said in the intorduction). Modules are as follows:
All data related, from repositories, API calls, mappers for our models, datasource (only its interface) is in here. Essentially core of the app is in this module
Our response and request models, as well as our mapping classes.
Given we have many API calls, to handle them nicely, we split each call into its use-case. That way we can focus on single flow.
Here we provide an implementation for our datasource (this can be local and/or remote); because we implement it in the app module we can use Android specific components (interface is in data module) so the data module (or core) is still isolated, while specific client provides the implementation however they want. And here are all UI parts (fragments, view models, and adapters).
Flow in this case is pretty simple: api call -> datasource -> repository -> usecase -> viewmodel -> fragment
Since we, due to use-cases, only focus on one flow, following this won't be an issue. And we handle data, however we want, so we know what we get back (for instance, in datasource, we might want to re-map our response to some other model because we won't use all that information).
This app uses MVI (Model View Intent) architecture.
If you want to contribute to this repository, you're always welcome!
If you need any help, feel free to contact me: [email protected].