Skip to content

A simple android application that demonstrates Mavericks (MvRx) architecture with feature modules.

License

Notifications You must be signed in to change notification settings

KryptKode/FoodDelivery

Repository files navigation

Actions Status codecov Kotlin Version AGP Gradle License

Food Delivery

A simple android application that demonstrates Mavericks (MvRx) architecture with feature modules.

Outline

  • App Walk-through
  • App Installation
  • Building source
  • Top Features
  • Architecture
  • Testing
  • Libraries
  • Extras

App Walkthrough

The app is based on this design by Dmitriy Kazarov.

Light mode screenshot Light mode Dark mode screenshot Dark mode

App Installation

You can download the APK from releases.

Building Source

To build this project, you require:

  • Android Studio 4.1.0 or higher
  • Gradle 6.5 or higher

Top features

Architecture

The application follows the clean architecture concept. As software architecture involves the design decisions that are hard to change, we should take an approach that does not result in coupling of the various components of the software. This makes it easy to make changes as it scales. The presentation layer for each feature uses an MvRx architecture. With this in mind, the project is organised into modules as follows:

Architecture

feature modules

This module contains features supported by the application. At present, only the shopping feature is implemented. Other features can be added as modules as the project scales.

The shopping feature has two screens. One that shows a list of food. The user can scroll through the list and add an item to their cart. The other for displaying the user cart information. The module defines both the view and presentation for the feature. The presentation is implemented using MavericksViewModel + Fragment combination with an MVRx architecture

core module

The core module just sets up the implementation of the data layer of the application. It provides the remote and cache layers. Concurrency in the application is implemented using RxJava and this module provides the implementation for the schedulers used in the application. The networking layer is mocked using hardcoded JSON data in the assets directory

common-android module

This module contains utility classes, extension functions, custom views shared by the android related modules. Most of the android modules depend on this module. Having the common classes here prevents duplication of code.

testShared module

This module contains classes shared in unit tests in all modules.

app module

This module connects all other modules. Provides navigation implementation with the Navigation Architecture Component library.

Testing

Testing is done with Junit4 testing framework, and with Google Truth for making assertions. Mockk is used to provide mocks in some of the tests. The tests run on the CI and the code coverage report is generated by jacoco can be tracked here.

Libraries

Extras

The Gradle script uses Kotlin Gradle DSL (buildSrc ) which brings Kotlin's rich language features to Gradle configuration. The project also uses detect to detect code smells and ktlint to enforce proper code style. Github actions handle continuous integration and run detekt, ktlint, lint and unit tests concurrently. A pre-commit git hook verifies the project's code style before committing code. Test coverage reports are uploaded to codecov.

About

A simple android application that demonstrates Mavericks (MvRx) architecture with feature modules.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published