A lightweight, expressive, quick learning curve, multiplatform MVI architecture for Kotlin Multiplatform
StelleMVI is a small but powerful library designed to simplify state management using the *
Model–View–Intent (MVI)* architecture across Kotlin Multiplatform targets.
It provides a clean, predictable, unidirectional data-flow system built on top of Kotlin Flows, with
minimal boilerplate and high extensibility.
StelleMVI structures your application around:
- Intent – user actions or external events
- Reducer – pure functions that update the state
- State – the single source of truth
- Effect / Side-Effect – ephemeral actions such as navigation or IO
- Store – (divided in viewmodel and data) the engine that binds everything together
StelleMVI is organized into several modules so you only include what you need.
mvi: The core of the architecture. ContainsStelleViewModel,StelleState, etc.mvi-compose: Base classes likeStelleScreento integrate MVI with Jetpack/JetBrains Compose.mvi-koin: Integration classes for injecting ViewModels and their children using Koin.mvi-compose-koin: A convenience module that combines Compose and Koin integrations.usecase: Provides theStelleUseCaseinterface for business logic.dispatchers: Provides a standardized set ofCoroutineDispatchersfor KMP.
You can download this library from MavenCentral
- groovy
sourceSets {
commonMain {
dependencies {
implementation "io.github.stellelibs:mvi:$stelleMVIVersion"
}
}
}- kts
sourceSets {
commonMain.dependencies {
dependencies {
implementation("io.github.stellelibs:mvi:$stelleMVIVersion")
}
}
}
In the sample folder you can find a sample project showing how to use Stelle MVI in a Kotlin Multiplatform project with Compose Multiplatform.
-
The MVI Pattern
Start here to understand the core principles of the Model-View-Intent architecture and how StelleMVI implements it. -
Basic Tutorial (No Dependency Injection)
Learn the fundamentals of StelleMVI by building a feature without any dependency injection framework. -
Koin Integration Guide
A dedicated guide to integrating StelleMVI with Koin for robust dependency injection in your KMP project. -
Advanced Guide: Parent-Child ViewModels
Explore the powerful Parent-Child pattern for managing complexity in large screens. -
UseCase Module Guide
Learn how to use theusecasemodule to structure your business logic cleanly and effectively. -
Dispatchers Module Guide Understand the
dispatchersmodule and how it provides a consistent way to manage coroutine dispatchers across all platforms.
