Code Monkey home page Code Monkey logo

karic-kenan / rollback Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 578 KB

Simple android client that uses MVI architecture and Fake store API to serve as demo e-commerce application while using modern development tools. (Kotlin, Coroutines,, Koin, Architecture Components, MVI, Retrofit, Moshi, Material Components)

License: Apache License 2.0

Kotlin 100.00%
kotlin coroutines coroutines-android mvi mvi-architecture clean-architecture moshi koin-android retrofit2 gson okhttp3 viewbinding navigation-architecture-component material-components aethibo kenankaric mvi-clean-architecture

rollback's Introduction

logo

Rollback

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.

Disclaimer

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.

Install

Clone the repository, and run the project, no additional setup is needed. Simple as that.

Clean architecture

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:

1. data

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

2. domain

Our response and request models, as well as our mapping classes.

3. usecases

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.

4. app - standard

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

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).

Architecture

This app uses MVI (Model View Intent) architecture.

Contribute

If you want to contribute to this repository, you're always welcome!

Contact

If you need any help, feel free to contact me: [email protected].

License

License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.