Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RIBs-KMP

An imperative RIBs-style (RIBs · RIBs-iOS) architecture framework for Kotlin Multiplatform — Router / Interactor / Builder / Presenter + View, with a coroutine-based Workflow engine for deep-link and cross-tree navigation.

Free, and on Maven Central — one dependency gives you the framework on Android, iOS, macOS, desktop/JVM, and web.

⚠️ Beta (0.x). The API is still stabilizing — expect breaking changes between releases until 1.0. Pin an exact version and check the release notes before upgrading.

Inspired by Uber's RIBs, independently reimplemented and substantially extended for Kotlin Multiplatform. Not affiliated with or endorsed by Uber. See THIRD-PARTY-NOTICES.

Install

Kotlin / Android / KMP

mavenCentral() is already in most projects. Add the dependency to your shared module (commonMain):

commonMain.dependencies {
    implementation("io.mobileengineer:ribs:0.1.0")          // the framework
    implementation("io.mobileengineer:ribs-compose:0.1.0")  // only if you render with Compose
}

That one coordinate covers Android (AAR), JVM/desktop, iOS, macOS, and JS — Gradle picks the right target automatically. Imports are com.ribs.*:

import com.ribs.Router
import com.ribs.Interactor

Browse the artifact: https://central.sonatype.com/artifact/io.mobileengineer/ribs

iOS / macOS (native UIKit / SwiftUI / AppKit)

Two layers, as in any KMP + native app:

  1. Shared logic — your shared Kotlin module depends on ribs from Maven Central (above); your Gradle build compiles it into the framework Xcode embeds. You do not add ribs to Xcode directly.

  2. Native view bridges (RibsUIKit / RibsSwiftUI) — a Swift package. In Xcode: File → Add Package Dependencieshttps://github.com/The-Mobile-Engineer/RIBs-KMP → pick RibsUIKit and/or RibsSwiftUI. Or in Package.swift:

    .package(url: "https://github.com/The-Mobile-Engineer/RIBs-KMP.git", from: "0.1.0")

    These are pure Swift (no Kotlin dependency); you implement the KMP-defined view interfaces against them via DI.

Scaffolding CLI

ribs is a small native CLI (no JVM) that generates a RIB — Builder / Router / Interactor / Presenter / View, one class per file, matching the framework conventions.

Install (macOS + Linux):

curl -fsSL https://raw.githubusercontent.com/The-Mobile-Engineer/RIBs-KMP/main/install.sh | sh

Then, from inside your source tree:

ribs new Foo

It infers the package from the current directory (override with --package / --dir) and writes a foo/ folder with the six files ready to fill in.

The installer also drops two Claude Code skills into ~/.claude/skillscreate-rib (scaffold and fill a RIB by the conventions) and review-rib (check a RIB against them). See skills/.

ribs keeps itself up to date: once a day it checks for a newer signed release in the background and applies it (Ed25519-verified), so you stay current without doing anything. Force it any time with ribs self-update. To turn it off:

ribs config set auto-update false     # persistent
RIBS_AUTO_UPDATE=false ribs new Foo   # one-off

Settings live in ~/.config/ribs/config.json; run ribs config to see them.

Platforms

Platform How you consume it
Android io.mobileengineer:ribs (AAR) from Maven Central
JVM / Desktop io.mobileengineer:ribs (jar) from Maven Central
iOS / macOS (Kotlin) io.mobileengineer:ribs (klib) from Maven Central
iOS / macOS (native views) RibsUIKit / RibsSwiftUI Swift package (SPM, this repo)
Web (JS/TS) @mobileengineer/ribs-web on npm (planned)

Docs

License

Free to use — see LICENSE. Includes components derived from Uber's RIBs (Apache-2.0); see THIRD-PARTY-NOTICES.

About

RIBs-KMP — a RIBs-style architecture framework for Kotlin Multiplatform. Install, docs, and the iOS Swift bridges.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages