Skip to content

A simple app to showcase modern Android development architecture (MVVM Clean + Compose + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow)

Notifications You must be signed in to change notification settings

dharmik1992/MVVM-Clean-Kotlin-Android-Architecture

Repository files navigation

MVVM-Clean-Kotlin-Android-Architecture

A minimalistic Android application consuming a TMDB Movie API to display popular movie list. Built with Clean architecture and Jetpack component (Jetpack Compose, MVVM Clean, Kotlin, HILT, ROOM DB, Retrofit2, Coroutines, Kotlin Flow and many more..). It was made to describe the latest android development trend. This app will be updated further to adapt to latest development trend.

App features:

  • List of latest popular movies
  • Movie Detail Screen

Screenshots

Image 1 Image 2

Architecture

Uses concepts of the 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

This architecture design is mostly inspired by Android-Clean-Architecture-Boilerplate.

Modules:

  • app - It uses all the components and classes related to Android Framework. It gets the data from domain layer and shows on UI. (access all the modules)
  • 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)
  • 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)
  • cache - Handles data interacting with the local storing (Room DB). (can only access data module)

Tech stack - Library:

  • Kotlin - Kotlin is Google's preferred language for Android app development.
  • Kotlin Coroutines - A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously
  • Flow API - Flow is used to pass (send) a stream of data that can be computed asynchronously
  • Dagger-Hilt - for dependency injection.
  • Android Architecture Components
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
    • Room - Used to create room db and store the data.
    • Navigation - Used to navigate between fragments.
    • Compose - Jetpack Compose is Android’s recommended modern toolkit for building native UI.
  • Material-Components - Material design components like ripple animation, cardView.
  • Retrofit - Used 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
  • Moshi - Used to convert Java Objects into their JSON representation and vice versa.
  • Coil - An image loading library for Android backed by Kotlin Coroutines
  • Accompanist - Accompanist is a group of libraries that aim to supplement Jetpack Compose with features that are commonly required by developers but not yet available.
  • Mockito - Mockito is a popular open source framework for mocking objects in software test.
  • Junit - JUnit is one of the most popular unit testing framework

TODO

  • Kotlin-DSL
  • Paging 3.0

How to run this app

  • Clone this repository
  • Register in TMDB and get the API_KEY , BASE_URL and POSTER_URL
  • Build the application

Releases

No releases published

Packages

No packages published

Languages