GithubHelp home page GithubHelp logo

akhilesh0707 / mvvm-clean-architecture Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 220 KB

MVVM with Clean Architecture demo project used truecaller blog api

Kotlin 100.00%
android kotlin rxjava rxjava-bindings architecture clean-architecture dagger2 mvvm-architecture

mvvm-clean-architecture's Introduction

Akhilesh StackOverflow Akhilesh LinkedIn

MVVM Clearn Architecture

An Android Clean Architecture app written in Kotlin, using Rxjava, Android Architecture Components and used Dagger2 for Dependency Injection.

Architecture

Uses concepts of the notorious Uncle Bob's architecture called Clean Architecture.

  • Better separation of concerns. Each module has a clear API., Feature related classes life in different modules and can't be referenced without explicit module dependency.
  • Features can be developed in parallel eg. by different teams
  • Each feature can be developed in isolation, independently from other features
  • faster compile time

Modules:

  • truecaller-ui - It uses all the components and classes releated to Android Framework. It gets the data from presentation layer and shows on UI. (access all the modules)
  • data - The data layer implements the repository interface that the domain layer defines. This layer provide a single source of truth for data. (Kotlin module that can only access domain module)
  • remote - Handles data interacting with the network. (can only access data module)
  • domain - The domain layer contains the UseCases that encapsulate a single and very specific task that can be performed. This task is part of the business logic of the application. (Kotlin module that cannot access any other module)
  • presentation - MVVM with ViewModels exposing LiveData that the UI consume. The ViewModel does not know anything about it's consumers. (Android module that can only access domain module)

Tech Stack:

  • RX Java A library for composing asynchronous and event-based programs using observable sequences for the Java VM.
  • RX Kotlin RxJava bindings for Kotlin.
  • RX Android RxJava bindings for Android.
  • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
  • LiveData for reactive style programming (from VM to UI).
  • Dagger2 for dependency injection.
  • Retrofit for REST api communication.
  • OkHttp HTTP client that's efficient by default: HTTP/2 support allows all requests to the same host to share a socket
  • Gson used to convert Java Objects into their JSON representation and vice versa.
  • Timber for logging.
  • Espresso for UI tests.
  • Mockito-Kotlin for mocking in tests.
  • MockWebServer for Instrumentation tests.
  • AndroidX Test Library for providing JUnit4 and functions as launchActivity in UI tests

Testing

Currently covered domain, data, presentation and remote module with moderate test coverage

TODO

  1. Instrumentation test cases.
  2. More unit test cases
  3. Improve UI
  4. Internet connectivity

mvvm-clean-architecture's People

Contributors

akhilesh0707 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.