Skip to content

tamnguyenhuy/IB_KMP_Sample

Repository files navigation

This is a Kotlin Multiplatform project targeting Android, iOS.

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:

    • commonMain is for code that’s common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, iosMain would be the right folder for such calls.
  • /iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.

Learn more about Kotlin Multiplatform

Kotlin Multiplatform Compose Sample

Note: Replace with your own GitHub API key to increase rate limit in RemoteRepoBase.kt file.

Screenshots

Android

List User List User Error User Detail

iOS

List User List User Error User Detail

Demo Videos

Android iOS

Technical Dependencies

Common Structure

├── composeApp
│   ├── androidMain
│   ├── commonMain
│   │   ├── kotlin/com/initium/assigment
│   │   │   ├── model                                        <––– Common models
|   |   |   ├── data                                         <––– Data layer
|   |   |   |   ├── di                                       <––– Koin Depedenency Injection for data layer
|   |   |   |   ├── local                                    <––– Local repository
|   |   |   |   ├── remote                                   <––– Remote repository
|   |   |   |   ├── repository                               <––– Repository for data layer => domain layer will use this
│   │   │   ├── di                                           <––– Koin Depedenency Injection for whole app
│   │   │   ├── domain
│   │   │   │   ├── base                                     <––– Base classes for domain layer
│   │   │   │   ├── di                                       <––– Koin Depedenency Injection for domain layer
│   │   │   │   └── services                                 <––– Services for domain layer => ui layer will use this
│   │   │   ├── ui
│   │   │   │   ├── app                                      <––– App Screens and ViewModels 
│   │   │   │   ├── core                                     <––– Navigation and screen models, state, event, etc
│   │   │   │   ├── theme                                    <––– Theme for the app
│   │   │   │   ├── uikit                                    <––– UIKit components for the app
│   │   │   │   └── di                                       <––– Koin Depedenency Injection for ui layer
│   │   ├── composeResources                                 <––– Resources to store local images and strings
│   │   └── sqldelight/com/initium/assigment                 <––– Local database entities
│   └── iosMain
└── ...

About

A Sample KMP

Resources

License

Stars

Watchers

Forks

Packages

No packages published