← Todos os modelos

Camadas de domínio e dados compartilhadas, UI nativa em cada plataforma.

Constitution — Kotlin Multiplatform

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Shared domain and data layers. Models, use cases, repositories, networking (Ktor) and local storage (SQLDelight) live in commonMain. Shared code references no UI types from either platform.

  2. Native UI on each platform. iOS uses SwiftUI and Android uses Jetpack Compose. Shared code exposes state as Flow and suspend functions, adapted for Swift with SKIE or KMP-NativeCoroutines.

  3. expect/actual only for platform features. expect and actual are used only where a platform capability is needed; otherwise an interface is injected. Each actual has a test on its own platform.

  4. A Swift-friendly API. The public API of the shared module is reviewed from the Swift side before it is merged. Types that come out awkward in Swift are wrapped, and the exported framework stays within its size budget.

  5. Tests in commonTest. The domain and data layers are covered in commonTest, which CI runs on the JVM and on the iOS simulator. A test that passes on only one target is a defect.

  6. One reproducible build. Kotlin, Gradle and library versions live in the version catalog. The shared module ships to iOS as an XCFramework through Swift Package Manager, built by CI, never from a laptop.