/star-wars-jetpack

A sample application to show how implements the Clean Architecture with the new features of Jetpack

Primary LanguageKotlin

Star Wars Jetpack

CircleCI Codacy Badge

A sample application to show how to implement the Clean Architecture with the new features of Jetpack.

The project tries demonstrate how to implement a project uncoupled, trying to follow all of the concepts of Clean Architecture.

On this occasion the project was implemented with SOLID concepts to have a better code organization. '-'

Architecture:

  • Local

    Contains the implementation of LocalData interface, translating the libraries included in this layer. The room persistence and shared preferences (Until this moment) was implemented in this layer to segregate all local dependencies in project.

  • Remote

    Contains the implementation of RemoteData. This layer includes all external requests, retrofit was inserted here.

  • Data

    Contains the implementation of repository. This layer translate all data received by remote and local sources, your respectives interfaces are injected in the repository implementation.

  • Domain

    In this layer we can do our business rules consuming the interface of repositories or other use cases.

    ** Coming soon, I'll try to grow the project to use this functional use case composition.

  • Presention

    Consumes the repository through viewmodel. Your view logic is here. :)

  • App

    The injection of view models is here, at this layer the project is applying the jetpack navigation in only one activity.

  • Shared

    This module contains all shared methods and common classes in the project, in my case the mapper is used in bounders of modules.

** Extension methods are applied to their respective layer using internal modifier, making them invisible to others layers.

Gradle

In project we have some gradle scripts representing a default setup for respective layer, it was created to decrease the boiler plate in scripts.

  • default-config

    Include android default config and your build types.

  • android-build

    Represents android setup, all layers needing android specifications, including this script in your local gradle.

  • commons

    Include common project dependencies in module.

Libraries

For more specifications, consult the wiki... The complete project wiki coming soon

Inspired by: Nelson Glauber - Books Jetpack