All Projects β†’ odaridavid β†’ Clean Mvvm Archcomponents

odaridavid / Clean Mvvm Archcomponents

Licence: apache-2.0
πŸ‘½ Android app consuming Star Wars API.Built with clean architecture ,MVVM pattern, Koin , Coroutines + Flows ,Architecture Components, Data Binding , Firebase , Unit/UI Tests ,Motion Layout

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Clean Mvvm Archcomponents

Mvvm Kotlin Android Architecture
MVVM + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow + mockK + Espresso + Junit5
Stars: ✭ 1,014 (+255.79%)
Mutual labels:  coroutines, mvvm, mvvm-architecture, android-architecture, junit, espresso, retrofit2
Coolweather
Weather App that uses Android best practices. Android Jetpack, clean architecture. Written in Kotlin
Stars: ✭ 154 (-45.96%)
Mutual labels:  coroutines, mvvm, clean-architecture, android-architecture, architecture-components, retrofit2
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (-55.44%)
Mutual labels:  coroutines, mvvm, clean-architecture, architecture-components, retrofit2
Movieapp Clean Architecture
Learning Project (Movie App) For Applying Android Architecture Components And Clean Architecture Using MVVM With Kotlin
Stars: ✭ 123 (-56.84%)
Mutual labels:  coroutines, mvvm, clean-architecture, mvvm-architecture, architecture-components
Kotlin Modular Tdd Coroutines Mvvm
A sample Kotlin app which was built with modular structure, Kotlin DSL, Kotlin Coroutines, TDD and MVVM patterns.
Stars: ✭ 256 (-10.18%)
Mutual labels:  coroutines, clean-architecture, mvvm-architecture, tdd, retrofit2
Android tmdb clean architecture
Showcase of clean architecture concepts along with Continuous Integration and Development for modular Android applications. Includes test suits (functional and unit tests) along with code coverage.
Stars: ✭ 63 (-77.89%)
Mutual labels:  clean-architecture, android-architecture, espresso, robolectric, retrofit2
paybill-manager
Your personal finance manager
Stars: ✭ 46 (-83.86%)
Mutual labels:  mvvm, clean-architecture, espresso, retrofit2, architecture-components
The Movie Db Kotlin
The Movie DB app using Kotlin with updated Android features
Stars: ✭ 176 (-38.25%)
Mutual labels:  coroutines, mvvm, architecture-components, retrofit2
Paging-3-Sample
This app is created as a sample app which loads movies from Tmdb api and uses Paging 3 library to show it in a Recycler view.
Stars: ✭ 96 (-66.32%)
Mutual labels:  coroutines, mvvm, retrofit2, architecture-components
Android-MVVM-News-App
MVVM News Application with clean code architecture & android jetpack components.
Stars: ✭ 38 (-86.67%)
Mutual labels:  clean-architecture, robolectric, retrofit2, architecture-components
Movietray
Its a playground application focusing on Paging3, MVVM architecture, Kotlin Extension functions, Retrofit, DSL, Navigation component, MotionLayout, SharedElementTransition, Single Activity Architecture, DataStore etc.
Stars: ✭ 78 (-72.63%)
Mutual labels:  coroutines, mvvm, mvvm-architecture, retrofit2
Web Dev Tools Android
Sample Android Application - MVVM, Clean Architecture, Modularization, Repository Pattern
Stars: ✭ 215 (-24.56%)
Mutual labels:  coroutines, mvvm, clean-architecture, android-architecture
FindTaek
πŸ“¦ λ‚΄κ°€ μ‹œν‚¨ 택배가 μ–΄λ””κΉŒμ§€ μ™”λŠ”μ§€ ν™•μΈν•΄λ³΄μ„Έμš”
Stars: ✭ 26 (-90.88%)
Mutual labels:  mvvm, android-architecture, retrofit2, mvvm-architecture
Android Kotlin Mvi Cleanarchitecture
Android + Kotlin + Modularization + Gradle Depedency managment + Gradle written in Kotlin DSL + Custom Gradle Plugin + MVVM + MVI + Clean Architecture + Repository Pattern + Coroutines + Flows + Koin + Retrofit2 + ROOM + Kotlin-Android-Extension + KtLints
Stars: ✭ 187 (-34.39%)
Mutual labels:  coroutines, clean-architecture, mvvm-architecture, retrofit2
Sample Code Movies
This repository contains sample code. Its purpose being, to quickly demonstrate Android and software development in general, clean code, best practices, testing and all those other must know goodies.
Stars: ✭ 81 (-71.58%)
Mutual labels:  coroutines, mvvm, clean-architecture, robolectric
Android Jetpack Playground
Pet project for cutting edge Android development with Jetpack
Stars: ✭ 266 (-6.67%)
Mutual labels:  coroutines, clean-architecture, espresso, robolectric
TDDWeatherApp
Android App trying to apply TDD and using MVVM, Kotlin Coroutines
Stars: ✭ 38 (-86.67%)
Mutual labels:  tdd, android-architecture, espresso, retrofit2
Kotlinjetpackinaction
πŸ”₯πŸ”₯ Kotlin Jetpack zero to hero. ζ–°ζ‰‹εˆ°ι«˜ζ‰‹
Stars: ✭ 264 (-7.37%)
Mutual labels:  coroutines, mvvm, clean-architecture, retrofit2
Marvelheroes
❀️ A sample Marvel heroes application based on MVVM (ViewModel, Coroutines, LiveData, Room, Repository, Koin) architecture.
Stars: ✭ 826 (+189.82%)
Mutual labels:  coroutines, mvvm, mvvm-architecture, retrofit2
FoodApp
Proof of concept for food app [JetPack + Coroutines + Flow + MockK + JaCoCo coverage + SonarQube]
Stars: ✭ 25 (-91.23%)
Mutual labels:  coroutines, clean-architecture, mvvm-architecture, architecture-components

home

   

The-Force

An Android app consuming a Star Wars API to display Movie Characters it has been built with clean architecture principles, Repository Pattern and MVVM pattern as well as Architecture Components.

Min Api Level : 21 Supports Over 87% Devices

Build System : Gradle

Table of Contents

Prerequisite

To run the release build successfully in travis you will need to replace the default values in keystore.properties.samplefile with your own in a keystore.properties file.

Next archive your keystore file and the properties file with the following command

 tar cvf secrets.tar keystore.properties theforce.jks

Next encrypt the archive and add config to travis with the following command

travis encrypt-file --pro secrets.tar --add

Verify that in your travis.yml in the before_install it looks something like

before_install:
  - openssl aes-256-cbc -K $encrypted_5880cf525281_key -iv $encrypted_5880cf525281_iv -in secrets.tar.enc -out secrets.tar -d
  - tar xvf secrets.tar

Make sure to add only the *.enc file to git,leave out the keystore.properties and *.jks file. Add the following to the root .gitignore just to be sure

*.jks
*.tar
keystore.properties

If you encounter any error check this site out.

To setup the Travis CLI tools see this

Architecture

NB: Work in Progress - Feature Modularisation 🚧

The Application is split into a three layer architecture:

  • Presentation
  • Domain
  • Data

Architecture Flow Diagram

This provides better abstractions between framework implementations and the underlying business logic.It requires a number of classes to get things running but the pros outweigh the cons in terms of building an app that should scale.

The 3 layered architectural approach is majorly guided by clean architecture which provides a clear separation of concerns with its Abstraction Principle.

Presentation

app contains the UI files and handles binding of DI components from other modules. Binding of data is facilitated by jetpacks data binding by serving data from the viewmodel to the UI.The data being received is part of a viewstate class that has properties contained in the relevant state.

Domain

The domain module contains domain model classes which represent the data we will be handling across presentation and data layer.

Use cases are also provided in the domain layer and orchestrate the flow of data from the data layer onto the presentation layer and a split into modular pieces serving one particular purpose.

The UseCases use a BaseUseCase interface that defines the parameters its taking in and output this helps in creating fakes using in testing.

Data

  • data-remote

Handles data interacting with the network and is later serverd up to the presentation layer through domain object

  • data-local

Handles persistence of object with Room ORM from.This module is responsible for handling all local related logic and serves up data to and from the presentation layer through domain objects.

With this separation we can easily swap in new or replace the database being used without causeing major ripples across the codebase.

Testing

Each module has its own tests except for the domain module which is catered for since its part of the behavior under test.

All server responses in the tests are served by mock web server by appending relative urls to the localhost and the connected port as the base url.

In the data-remote module the responses are mocked using the mockwebserver and verified that they are what we expect.

In the data-local module an in memory database is being used to run the tests,this makes it a little faster compared to an actual db.

In the app module there are unit tests for the viewmodels and util classes and connected tests for the UI Screens.

The test instrumentation app uses modules that have been swaped with fakes for the network module so as to run requests on localhost with mockwebserver,this removes flakiness compared to relying on actual data from the real server aspects such as internet connection or network service might bring up issues and an in memory database for local data that also allows main thread queries since tests should also be fast and we are just asserting stuff works.

View models testing on live data were guided by this article

Libraries

Libraries used in the whole application are:

  • JetpackπŸš€
    • Viewmodel - Manage UI related data in a lifecycle conscious way and act as a channel between use cases and ui
    • Data Binding - support library that allows binding of UI components in layouts to data sources,binds character details and search results to UI
    • Room - Provides abstraction layer over SQLite
  • Retrofit - type safe http client and supports coroutines out of the box.
  • Moshi - JSON Parser,used to parse requests on the data layer for Entities and understands Kotlin non-nullable and default parameters
  • okhttp-logging-interceptor - logs HTTP request and response data.
  • kotlinx.coroutines - Library Support for coroutines,provides runBlocking coroutine builder used in tests
  • Truth - Assertions Library,provides readability as far as assertions are concerned
  • MockWebServer - web server for testing HTTP clients ,verify requests and responses on the star wars api with the retrofit client.
  • Leak Canary - Leak Detection Library
  • Material Design - build awesome beautiful UIs.πŸ”₯πŸ”₯
  • Firebase - Backend As A Service for faster mobile development.
    • Crashylitics - Provide Realtime crash reports from users end.
  • Koin - A pragmatic lightweight dependency injection framework for Kotlin
  • Robolectric - Unit test on android framework.
  • Espresso - Test framework to write UI Tests
  • recyclerview-animators - Recycler View Animations
  • AboutLibraries -provide info on used open source libraries.
  • Stetho - debug bridge
  • Kiel - Kiel RecyclerView Adapter Builders

Contributors

  • Thanks to Zafer Celaloglu for the Dagger to Koin Refactor and additional test cases.

Feel free to contribute in any way to the project from typos in docs to code review are all welcome.

Demo

The codebase in most cases will be ahead of whats on the store.

Get it on Google Play

Google Play and the Google Play logo are trademarks of Google LLC.

Copyright Notice

Star Wars and all associated names are copyright Lucasfilm ltd.

Related Posts

Handling Dynamic Urls

License

  Copyright 2019 David Odari
  
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].