Project structure · Mobile
Kotlin Multiplatform project structure
Opens with creditsFor students who want one Kotlin codebase for Android and iOS. The tree follows the current KMP wizard layout: a shared module with commonMain, androidMain and iosMain, a thin androidApp module, and an iosApp Xcode project, with Compose Multiplatform for shared UI. It grows into feature folders with Ktor, Room and Koin, adds tests that run on both platforms, signing and store releases, and for large teams, convention plugins and more modules.
How it grows
Each stage opens the explorer there
- 1Day 1What the scaffold and your first hour give you53 files and folders
- 2GrowingWhat a real app with features and tests adds+38 files and folders
- ProductionWhat running it for real users adds+25 files and foldersOpens with credits
- ExpertWhat a team needs to keep it healthy for years+22 files and foldersOpens with credits
How it is organised
- Share as much as is useful, not everything: business logic, networking, storage and usually UI go in commonMain; platform-only APIs stay in androidMain and iosMain behind small interfaces or expect/actual.
- Prefer interfaces injected with Koin over expect/actual for anything bigger than a function. Interfaces can be faked in tests; expect declarations cannot.
- Group commonMain by feature (orders, auth), with shared data and ui folders used by many features. A feature never imports another feature.
- The androidApp module and the iosApp Xcode project stay thin: entry points, icons, permissions and signing. If logic is creeping in there, it belongs in shared.
- Use multiplatform libraries for shared code: Ktor, kotlinx.serialization, kotlinx-coroutines, Room or SQLDelight, Koin, the JetBrains builds of ViewModel and Navigation.
- All versions live in gradle/libs.versions.toml. Kotlin, KSP and Compose Multiplatform move together.
- Write most tests in commonTest so they run on JVM, Android and iOS. CI must build and test both platforms on every pull request.
- Nothing secret is compiled into either app; tokens go to the Keychain on iOS and encrypted storage on Android.
At the top of the project
Open one in the explorer for the full story
- my-kmp-app/
- .gradle/Gradle's project cache and file hashes.
- .idea/IntelliJ IDEA or Android Studio project settings.
- .kotlin/Kotlin compiler data: session files and error reports.
- androidApp/The Android app module: MainActivity, the manifest, icons, signing and app-level settings.2 inside
- build/Root build output and reports.
- config/Static analysis settings shared by all modules.1 inside
- desktopApp/A desktop JVM app entry point, only if you ticked Desktop in the wizard.
- gradle/The version catalog and the Gradle wrapper settings.2 inside
- iosApp/The Xcode project for the iOS app. Not a Gradle module.3 inside
- scripts/Small helper scripts for the team and CI.1 inside
- shared/The Kotlin Multiplatform module: shared logic and shared Compose UI for Android and iOS.4 inside
- .editorconfigIndentation and ktlint style rules read by the IDE and formatters.
- .gitignoreIgnores build folders, .gradle, .kotlin, local.properties, IDE files and Xcode user data.
- AGENTS.mdInstructions for AI coding agents: modules, source set rules, commands.
- README.mdHow to run the Android and iOS apps and the tests.
- build.gradle.ktsRoot build file: declares every plugin with `apply false`.
- gradle.propertiesGradle and Kotlin flags: JVM memory, configuration cache, AndroidX.
- gradlewThe Gradle wrapper script for macOS and Linux.
- gradlew.batThe Gradle wrapper script for Windows.
- local.propertiesThe Android SDK path on this machine.
- settings.gradle.ktsNames the project, lists the modules and sets plugin and dependency repositories.
Learn more on Sefism
Roadmaps, cheat sheets and projects that go with Kotlin Multiplatform.
- Roadmap· AndroidMobile development roadmapApps for Android and iOS
- Roadmap· iOSMobile development roadmapApps for Android and iOS
- RoadmapSoftware design and clean code roadmapOOP, SOLID, design patterns, refactoring
- Cheat sheetMobile development cheat sheetApps for Android and iOS.
- FYP idea· IntermediateOffline Child Growth Monitoring App for Lady Health Workers with WHO Z-ScoresBuild an offline Android app that community health workers use at household visits to record a child's weight, length and arm circumference, compute WHO growth z-scores on the phone, flag faltering growth across visits and generate referrals. Paper growth charts are often incomplete and hard to read, and the WHO desktop software does not go to the doorstep. The core is correct z-score computation, validated against the WHO reference implementation, and a sync design that survives weeks offline.
- FYP idea· IntermediateVideo-Observed TB Treatment App with Offline Upload for Patients and Treatment SupportersBuild an Android app that lets a tuberculosis patient record a short video of taking each day's medicine, stores it encrypted, uploads it when there is signal and lets a treatment supporter review doses and follow up on missed ones. Daily in-person observation is hard for patients who work, live far from a clinic or have to travel. The project follows the model of a published randomised trial and focuses on making it work on cheap phones and poor connections.
- FYP idea· BeginnerOffline Bird Call Survey App for Wetland and Wildlife Field TeamsBuild an Android app that records bird calls during a structured field survey, identifies likely species on the phone with an open bird sound model, filters suggestions to species expected in that region and season, and sends uncertain recordings to an expert for review. Wildlife departments, university ecology groups and birdwatchers survey Pakistan's wetlands, often with paper forms and no signal. The project turns each survey into consistent, checkable data.
- QuestionWhat projects should I build in my first year of university?Build small, finished projects that solve problems you or people around you actually have: a script that automates a chore, a command line tool, a simple website for a society or family business. First year is about finishing things and using Git, not about impressive ideas.
- QuestionWhat does proof of work mean for a fresher developer?Proof of work is evidence someone can check in a few minutes that you can do the job: a deployed project real people could use, readable code with tests, a pull request merged into someone else's project, or a clear write-up of a problem you solved. It replaces the experience a fresher does not have yet, so it must be easy to find and easy to verify.
See 6 moreShow fewer
- QuestionWhat should I learn first to become a software engineer in 2026?Learn one language properly, then Git, the command line, how the web works and basic SQL, and build small things with them from week one. AI tools change how you write code, not what you need to understand. Pick a direction only after the foundations feel boring.
- Resource· GuideKotlin DocumentationThe official Kotlin documentation from JetBrains: a browser-based Kotlin tour for beginners, the full language reference, coroutines, and guides for Android, server-side and multiplatform development. It is the right starting point for anyone learning Kotlin before Android with Jetpack Compose, so that the language is not a second hurdle, and the reference settles questions about null safety, scope functions or generics.
- Resource· GuideAndroid Developers: Develop for AndroidThe official Android developer guides and reference: Jetpack Compose UI, data and files, permissions, navigation, background work with WorkManager, camera, location, connectivity, testing, performance tools and releasing your app, plus guides for phones, tablets, foldables, Wear OS, TV, cars and XR. It suits developers who have finished a beginner course such as Android Basics with Compose and need accurate, current answers while building real apps.
- Resource· GuideApple Developer DocumentationApple's official reference and guides for building apps on its platforms: Swift, SwiftUI, UIKit, SwiftData, Foundation, networking, notifications, location, testing, Instruments and app distribution. Tutorials get you started, but this is where iOS and macOS developers look things up once they are building their own app. Many framework pages include runnable sample code projects, and it is free to use without a paid developer account.
- Resource· GuideOWASP Mobile Application Security (MASVS and MASTG)OWASP's mobile security project for Android and iOS. The MASVS standard defines what a secure app must do across storage, cryptography, authentication, networking, platform interaction, code, resilience and privacy, and the MASTG testing guide shows how to check each on a real device. Use it to decide where tokens and personal data may live, and as a security checklist before release.
- Resource· GuideGitHub Actions DocumentationThe official documentation for GitHub Actions, GitHub's built in CI/CD and automation system: workflow syntax, triggers, runners, caching, artifacts, environments, secrets and OpenID Connect deployments to AWS, Azure and Google Cloud. Actions is free for public repositories on standard runners, so it is the CI tool most students and open source projects learn first. It suits developers setting up tests and deployments for the first time.
Checked against 18 official sources, October 2026. If something has changed, the docs win.Show sourcesHide sources
- Kotlin Multiplatform: Recommended project structure
- Kotlin Multiplatform: Migrate to AGP 9
- Kotlin Multiplatform wizard
- Get started with Compose Multiplatform (new project structure branch)
- Kotlin Multiplatform: Expected and actual declarations
- Kotlin Multiplatform: Hierarchical project structure
- Kotlin Multiplatform: iOS integration methods
- Compose Multiplatform: Resources
- Compose Multiplatform: Testing UI
- Kotlin coding conventions: directory structure
- Android: Set up the Android Gradle Library Plugin for KMP
- Android: Room (Kotlin Multiplatform)
- Android: ViewModel for Kotlin Multiplatform
- Ktor client: Multiplatform
- Koin for Compose Multiplatform
- Gradle: Version catalogs
- Maestro documentation
- detekt documentation
Best practices and checklists for this stack
Picked from the other libraries by shared topics.
Best practices
See all- React Native Best PracticesReact Native best practices for 2026: Expo and the New Architecture, fast lists, smooth animations, safe storage, deep links, accessibility and release builds.
- Flutter Best PracticesFlutter best practices for 2026: sound null safety, cheap build methods, layered architecture, smooth frames, go_router, accessibility, testing and safe releases.
- Software Testing Best PracticesTesting best practices for unit, integration and end-to-end tests: test design, test doubles, flaky tests, coverage and fast CI, with examples in TypeScript and Python.
Checklists
See all- App Store and Google Play Launch ChecklistLaunch a mobile app on the App Store and Google Play: accounts, build rules, review guidelines, privacy labels, Data safety, listing, in-app purchases, testing, crashes and staged rollout.
- Mobile App Security ChecklistCheck an Android or iOS app against OWASP MASVS: data storage, network security, authentication, platform interaction, code quality, resilience and privacy.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com