Animal-Kingdom - CLEAN Architecture with MVVM and Jetpack-Compose

Overview

CLEAN Architecture with MVVM and Jetpack-Compose.

About the app

I have created this small app to showcase my skills. Launching screen in an app will show you the list of random animals and you will see the new random list if you do swipe to refresh into it.

Code structuring approach

  1. MVVM separates your view (i.e. Activitys and Composable) from your business logic. MVVM is enough for small projects, but when your codebase becomes huge, your ViewModels start bloating. Separating responsibilities becomes hard.

  2. MVVM with Clean Architecture goes one step further in separating the responsibilities of your code base. It clearly abstracts the logic of the actions that can be performed in your app.

CLEAN Architecture:

First of all the layers in CLEAN architecture has been separated into individual modules in a single Android project. For example android modules like app, presentation, data and domain. Notice the dependency of these modules, as per the depedency rule of CLEAN architecture, all the dependencies directly or indirectly point towards the the domain layer. The domain layer incorporates Entities, Use-cases and interfaces required to cross boundaries, Repository in this case. The Data layer handles data and communicates with data source remote in this case, to provides required data requested by the presentation layer. View layer will observe on the presentation layer's stateFlow object, to get the updated data on state change.

Having separate modules is not necessary, you can create all the layers in the app modules itself. Having separate modules and depending on the intended modules prevent accidental usage of a classes in unintended places. There are also couple of benefits mentioned below.

CLEAN Architecture in Android

Reason for using CLEAN architecture

  • Your code will be even more easily testable than with plain MVVM
  • Your code will be further decoupled
  • The project will be even easier to maintain.
  • Your team can add new features even more quickly.
  • Inner layer module dont know about outer layer, hence, outer data formats can’t be used in inner layer
  • Dependencies can only point inwards (from concretions towards abstractions)
  • The project will point towards Stability
  • Your code will point towards Abstractions

Libraries

  • Jetpack-Compose: For view and design to give modern looks and feel.
  • Kotlin-Coroutine-Flow:for asynchronous task, reactive programming, mapping, transformation.
  • Hilt: for Dependency Injection
  • Compose-Navigation: for switching between screens
  • Retrofit: Netwoking Library
  • ViewModel: For persisting data across configuration changes
  • Expresso, Mockk, Junit - For testing
  • Coil - for Image loading

App screenshot

You might also like...
🚀 Sample Android Clean Architecture on Rorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
🚀 Sample Android Clean Architecture on Rorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Clean Architecture Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development u

Android weather app using Hilt, Coroutines, Retrofit, Jetpack (Compose, Room, ViewModel) based on MVVM architecture
Android weather app using Hilt, Coroutines, Retrofit, Jetpack (Compose, Room, ViewModel) based on MVVM architecture

Atmostate A weather app written with Jetpack Compose using OpenWeatherMap Get the APK Features offline caching fetching data for current user location

A Native Andorid App developed in Jetpack Compose MVVM architecture
A Native Andorid App developed in Jetpack Compose MVVM architecture

Astronomy Picture of the Day This is a Native Andorid App developed in Jetpack Compose MVVM architecture, To view the Astronomy Picture of the day fro

Navigation-Compose - A sample to showcase Kotlin, MVVM, Hilt, Coroutines, StateFlow, Jetpack compose

Navigation-Compose A sample to showcase Kotlin, MVVM, Hilt, Coroutines, StateFlo

TipperCompose - A simple & clean tip calculator using Jetpack Compose
TipperCompose - A simple & clean tip calculator using Jetpack Compose

TipperCompose - A simple & clean tip calculator using Jetpack Compose

An example concepts of MVVM and Kotlin. Display, Filter & Sort the given restaurants from assets with Jetpack Compose and AAC
Compose-navigation - Set of utils to help with integrating Jetpack Compose and Jetpack's Navigation

Jetpack Compose Navigation Set of utils to help with integrating Jetpack Compose

FullMangement - an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries, and MVVM design pattern.
FullMangement - an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries, and MVVM design pattern.

Full Management is an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries and MVVM design pattern.

ToDo-Task-App - An Android App built to demonstrate the use of Jetpack Compose, Material You, Room Database, and MVVM

ToDo Task App ToDo Task App is a sample Android app built with Jetpack Compose.

Owner
null
Android Clean Architecture That Screams (MVVM + JetPack Compose UI + Flow + State)

Android Clean Architecture That Screams (MVVM + JetPack Compose UI + Flow + State)

Praveen Sharma 9 May 11, 2022
Android Clean Architecture with MVVM using Jetpack component

Android Clean Architecture with MVVM using Jetpack component ?? What is Clean Architecture? Clean architecture is a category of software design patter

Jbsolutions 6 Dec 10, 2022
This is a simple video games discovery app showcasing UI using Jetpack Compose with Clean Architecture and also tests for composable UI.

Jetpack-Compose-Video-Games-Example ?? This is a simple video games discovery app showcasing UI using Jetpack Compose and also tests for composable UI

Ruben Quadros 60 Dec 27, 2022
CoinList is a simple app based on Jetpack Compose, modern tech-stack and Clean Architecture.

CoinList is a simple app based on Jetpack Compose, modern tech-stack and Clean Architecture. The project is quite simple which shows the list of crypto currencies and their general info details gets from API.

Yıldırım Tam 18 Aug 28, 2022
Jet-CoinList is a simple app based on Jetpack Compose, modern tech-stack and Clean Architecture.

Jet-CoinList is a simple app based on Jetpack Compose, modern tech-stack and Clean Architecture. The project is quite simple which shows the list of crypto currencies and their general info details gets from API.

Yıldırım Tam 18 Aug 28, 2022
PapriCoin demonstrates Jetpack Compose usage to build modern app based on Clean Architecture and newest Tech-Stack

PapriCoin demonstrates Jetpack Compose usage to build modern app based on Clean Architecture and newest Tech-Stack. Repository also has loca

Malik Mukhametzyanov 15 Nov 9, 2022
Snapchat Clone with Jetpack Compose and Clean Architecture

Snapchat Clone with Jetpack Compose and Clean Architecture - Navigation Components, CamaraX, android-maps-compose, Exoplayer, Detekt, Coil, Gradle Secrets, Permission Handling.

Debanshu Datta 121 Dec 28, 2022
Jetpack Compose app gets data from REST API using KTOR Client. Clean Architecture, Dependency Injection...

posts-ktor-client Jetpack Compose app gets data from REST API using KTOR Client. Clean Architecture, Dependency Injection... Posts KTOR Client Demo ap

Raheem 12 Dec 12, 2022
A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose

Authentication A simple authentication application using Jetpack compose to illustrate signin and sign up using Mvvm, Kotlin and jetpack compose Scree

Felix Kariuki 5 Dec 29, 2022
📝 Note List app based on MVVM architecture (ViewModel, LiveData, Coroutines, Room and Jetpack Compose)

Note list app built with Jetpack Compose Download Go to the releases page to download the latest available apk. Screenshots Architecture Features Home

Marcos Paulo Farias 45 Dec 25, 2022