JetBrains Just Changed KMP Structure. Here's What They Didn't Tell You.

JetBrains Just Changed KMP Structure. Here's What They Didn't Tell You.

posted Originally published at medium.com 2 min read

JetBrains announced a new default project structure for KMP. Two shared modules — sharedLogic and sharedUI — plus separate application modules for each platform. Clean. Simple. Obvious.

New KMP template

It's also a trap.

The problem with sharedLogic and sharedUI

A fresh sharedLogic module looks innocent. Business logic, models, repositories. sharedUI holds your Composables. What could go wrong?

Three months later sharedLogic contains:

  • Business logic
  • Network clients
  • Database models
  • Constants
  • Utility functions
  • Something called CommonUtils.kt that nobody understands but everyone is afraid to delete

sharedLogic has no internal boundaries. Everything depends on everything. You can import a database model from a use case and nobody stops you. The compiler certainly won't.

JetBrains tells you where to start. They don't tell you what happens when two modules become 50,000 lines.

What actually happens

You try to split sharedLogic into more modules. But there are no rules. So you end up with:

  • :sharedLogic:core — the new dumping ground
  • :sharedLogic:data — which also contains business logic somehow

The dependencies look like spaghetti. Changing one module breaks three others. You didn't enforce boundaries early, and now every refactoring is a gamble.

FLIP: the next step after sharedLogic

FLIP is an architectural pattern that gives you rules for splitting sharedLogic before it becomes a problem.

Five layers. One direction. Zero horizontal dependencies.

Layer Purpose Depends on
:common:core Foundation Nothing
:service Domain logic without UI :common:core
:feature UI features :service, :common:core
:entrypoint DI assembly + slot composition Everything above
:platform Platform entry point :entrypoint

The rule is simple: features don't know about other features. services don't know about other services. Dependencies only flow down.

Your IDE enforces this. You literally cannot import a feature from another feature — Gradle won't compile. The structure prevents the dumpster fire before it starts.

Start with JetBrains. Grow with FLIP.

The new KMP structure is a great starting point. Two modules is better than one. But when sharedLogic starts feeling like a junk drawer, you know what to do.

FLIP is at github.com/numq/flip. Template included. Konsist tests included. Rules over conventions.

More Posts

FLIP: Modular Architecture for KMP

numq - May 16

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

Just completed another large-scale WordPress migration — and the client left this

saqib_devmorph - Apr 7

What Is an Availability Zone Explained Simply

Ijay - Feb 12

Type-safe Kotlin Multiplatform i18n: auto-convert Android strings to cross-platform translations.

Ismoy - Oct 14, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!