/GithubTrendingRepos

Android - MVVM with Clean Architecture Blueprint Written In Kotlin

Primary LanguageKotlinApache License 2.0Apache-2.0

Github Trending Repositories [mvvmclean]

An Android app consuming GitHub Trending API to display the current trending Github repositories. It has been built using kotlin with clean architecture principles, Repository Pattern and MVVM pattern as well as Architecture Components.

Min API Level Supported : 19

Prerequisite

Before running the project check your gradle version matches the required.

package-name: com.mvvmclean.trendingrepos
compileSdkVersion = 29
targetSdkVersion = 29
minSdkVersion = 19
buildToolsVersion = "29.0.2"

Development Environment

Android Studio 3.5
Build #AI-191.8026.42.35.5791312, built on August 9, 2019
JRE: 1.8.0_202-release-1483-b49-5587405 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS Mojave 10.14

Table of Contents

Architecture

The Application is split into a three layer architecture inorder to provide clean separation of concerns - making the code easier to navigate and maintain.

  • Data - Layer that holds APIs, Database, Cache
  • Domain - Layer that holds Use Cases, and Model Objects. Business logic happens here.
  • Application - Layer that holds presentation, Android components, Viewmodels, Dagger components/modules handles Dependency Injection, etc. MVVM exists at this layer.

Data Flow Diagram

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

Features

  • Trending Repository Listing
  • Repository sorting by stars and name
  • Take user to corresponding repository on long press
  • Pull to refresh repository
  • Offline Storage ( Scheduled repo remote controller syncing, App will sync with backend server in every 2hrs )

Testing

  • app/test/ - Unit tests - test -> Right click on package name(com.mvvmclean.trendingrepos) -> Run Test In 'com.mvvmclean.trendingrepos'
  • app/androidTest/ - Instrumentation tests - androidTest -> Right click on package name(com.mvvmclean.trendingrepos) -> Run Test In 'com.mvvmclean.trendingrepos'

Libraries

Following are the Libraries used:

Extras

Gradle Dependencies

  • dependencies.gradle - Centralized versioning of gradle dependencies in a global file
  • Version.properties - App version details

Resource Values

  • Fonts
  • Dimension & String Values
  • Themes & Styles
  • Network Config

Screenshots

  • Architecure

  • App Screens

Demo

Demo Video

License

  Copyright 2020 Anoop M Maddasseri

  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.