Example KMM app for showing about layered architecture

Overview

Layered Architecture in a Kotlin Multiplatform project

This project was created by a series of posts you can find on my blog https://jflavio.com

The domain and data layers are both inside the shared module of the Kotlin Multiplatform project. The final architecture looks like this:

Image of architecture


Core or shared module

Here is where all the business logic is defined. It contains cross code for all platform. This includes: repositories interfaces, repositories implementations, data sources implementation, networking access for consuming REST APIs, interactors and main domain models.

We are using the following libraries:

androidMain

Here we only have an implementation of the database driver interface defined in the commonMain package but for Android.

iOSMain

Here we only have an implementation of the database driver interface defined in the commonMain package but for the iOS project.

commonMain

Here is where magic happens. We define the domain and data layers inside this package. By the way, we support Kotlin Coroutines 😉 .


Android module

Implements the MVVM pattern using Jetpack Compose. The ViewModels depends on the interactors interfaces that are defined in the domain layer inside the shared module.


iOS module

Implements the MVVM pattern using SwiftUI. The ViewModels depends on the interactors interfaces that are defined in the domain layer inside the shared module (currently in progress).

You might also like...
Example of migrating from Dagger to Hilt with a real service/repository example

DaggerToHilt Overview This repo provides a real example of using Hilt for dependency injection. It hits endpoints provided by the Movie Database, and

A sample app showing different kind of memory leaks and their solutions

MemoryLeakApp A sample app showing different kind of memory leaks and their solutions. Make sure to check the source code to understand the concept of

ConstraintSetChangesTest - Simple project showing Changes of ConstraintSet value as part of mutable state in JetpackCompose.

ConstraintSetChangesTest Simple project showing Changes of ConstraintSet value as part of mutable state in JetpackCompose. Version: implementation

An example of using The Elm Architecture in Android

GreenTea [Work in progress] An example of using The Elm Architecture in Android. There is a working example and the most important base clases. Still,

Cleanarchitecture MVVM Hilt base - Android Clean Architecture example project
Cleanarchitecture MVVM Hilt base - Android Clean Architecture example project

Android Clean Architecture example project Note: This is project based on MVVM c

Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components
Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components

ModularDynamicFeatureHilt An Android template project following a multi module approach with clean architecture. It has been built following Clean Arc

FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language
FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

This repository contains a FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

LifecycleMvp 1.2 0.0 Kotlin  is MVP architecture implementation with Android Architecture Components and Kotlin language features
LifecycleMvp 1.2 0.0 Kotlin is MVP architecture implementation with Android Architecture Components and Kotlin language features

MinSDK 14+ Download Gradle Add to project level build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' }

A fork of our clean architecture boilerplate, this time using the Android Architecture Components

Android Clean Architecture Components Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have swi

Owner
Jose Flavio Quispe Irrazábal
Mobile Software Engineer, MQTT and IoT. Public & private repos.
Jose Flavio Quispe Irrazábal
An unofficial Mangadex app using KMM

Mochi An unofficial Mangadex app using KMM. The app uses Mangadex new Public API, which may change at any time. ☢️ !!!Currently in Production. Not int

Michael24884 2 Jan 25, 2022
Kamper - a small KMM/KMP library that provides performance monitoring for your app.

?? Kamper Kamper is a KMP/KMM library that implements a unified way to track application performances. The solution is based on plugin design patterns

S. Mellouk 31 Jun 10, 2022
A simple KMM app

Getting Ready Install latest Android Studio version (I’m using RC Dolphin). Make sure your Kotlin Plugin has 1.7.x version. Make sure you have Ruby ge

Lena Stepanova 2 Sep 20, 2022
Template (pure) for KMM application with DI support

KMM di template Template (pure) for KMM application with DI support. Uses Multiplatform-DI for Dependency Injection Features Common architecture (VIP)

Anna Zharkova 8 Oct 18, 2022
An awesome list that curates the best KMM libraries, tools and more.

Awesome KMM Kotlin Multiplatform Mobile (KMM) is an SDK designed to simplify creating cross-platform mobile applications. With the help of KMM, you ca

Konstantin 994 Dec 28, 2022
Ricky and Morty episode guide using KMM and Apollo GraphQL Native

Ricky And Morty Episodes - Kmm Ricky and Morty episode guide using KMM and Apollo GraphQL Native This is a simple guide on how to create an KMM projec

Julio Ribeiro 2 Apr 15, 2022
use kmm to write a flutter plugin

use KMM to write a flutter plugin The reference plugin_codelab example plugin that accompanies the How to write a Flutter plugin codelab. I changed pl

libill 8 Nov 9, 2022
KMM RSS Reader: an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile.

KMM RSS Reader This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you ca

Kotlin 1.4k Jan 4, 2023
Demo for Jetbrains webinar on "How to share data layer in KMM"

RealmDemo Demo application demostrating how to share data layer in an KMM project using Realm Kotlin SDK and Atlas App Service. Webinar Link : https:/

MongoDB Developer Relations 9 Dec 15, 2022