Hi everyone, I have a question regarding Kotlin Mu...
# multiplatform
a
Hi everyone, I have a question regarding Kotlin Multiplatform. I’m working on a project that involves three different types of apps: one for club employees, one for trainers, and one for clients. Each app will have its own unique UI and user flow, but they will share a significant amount of common code. My question is: Can we build one Kotlin Multiplatform project that ultimately generates three separate apps, each with its own distinct flow and interface, while reusing the shared logic? Or do we need to maintain three separate projects for each app? I’d appreciate any insights or best practices from the community. I really appreciate any help you can provide.
j
Your question reads to me as "can we have 3 separate projects with shared code, or do we need to have 3 separate projects with shared code?" Your shared code is one project, and each app is its own project that uses the shared code
1
👍 1
a
Thanks for your response. Yeah, I want a shared code with three separate projects. In the end, I want to get 3 different apps (Android/IOS)
👍 1
j
Yes, that's plenty possible. You're essentially describing how libraries work today
🙌 1
a
Ok, that is great, I will go see how to create it. Thanks a lot for your help
😎 1
m
The easy way is to create a KMP project with IntelliJ, that will give you the base, write all the code you might need in your shared project and then create different app type modules that will be your android and iOS apps. Then you include your shared code as a dependency, and it all lives in the same project
🙌 1
j
fwiw Gradle calls modules "subprojects" Adds to the confusion 😅