Menu

1 / 2

How I Reached 90.64% Shared Code in Kotlin Multiplatform Across Android, iOS, Desktop, and LAN Sync

DEV Community: kotlin·WolfOf420Stret·1 day ago
#9hH5dNzm
#devtokotlin#devto#dev#shared#platform
Long article (600 words) — no AI summary yet.
Reading 0:00
15s threshold

SnapLedger is a local-first receipt and expense tracker I built for the KotlinConf Student Coding Competition . It targets Android, iOS, and Desktop, with a standalone server and an embedded Desktop LAN Hub for synchronization. I measured the shared-code ratio with the repository’s own ./scripts/shared-code-ratio.sh : 7,396 shared production Kotlin lines out of 8,160 client lines, or 90.64% .

The high-level module layout is intentionally small:

:core pure domain logic :app:shared Compose Multiplatform app and data layer :app:androidApp Android shell :app:desktopApp Desktop JVM shell :sync-host embedded LAN sync engine :server standalone Ktor backend

Enter fullscreen mode

Exit fullscreen mode

Module boundaries did most of the work

The biggest architectural decision was keeping :core free from Android and UI dependencies.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.