Skip to content

codex-yasxh/first-KMP-Project

Repository files navigation

Kotlin Multiplatform Project

This is a Kotlin Multiplatform project targeting:

  • Android
  • iOS
  • Web
  • Desktop (JVM)
  • Server

📂 Project Structure

/composeApp

Path: ./composeApp/src

This module contains code shared across Compose Multiplatform applications.

Subfolders:

  • commonMain (./composeApp/src/commonMain/kotlin)
    Code shared across all Compose targets.

  • Platform-specific folders
    Used when code is required only for a specific platform:

    • iosMain → iOS-specific code (e.g., Apple CoreCrypto)
    • jvmMain → Desktop (JVM) specific code
    • Other folders follow the same naming convention

/iosApp

Path: ./iosApp/iosApp

Contains the iOS application entry point.

Even when using Compose Multiplatform UI, this module is required. This is also where SwiftUI code should be added.


/server

Path: ./server/src/main/kotlin

Contains the Ktor server application.


/shared

Path: ./shared/src

Contains code shared across all targets in the project.

  • commonMain (./shared/src/commonMain/kotlin)
    The most important folder for shared business logic.

Platform-specific folders can also be used here if required.


▶️ Build & Run Instructions

Android Application

Build the debug version:

macOS / Linux

./gradlew :composeApp:assembleDebug
Windows

.\gradlew.bat :composeApp:assembleDebug
Desktop (JVM) Application
Run the development version:

macOS / Linux

./gradlew :composeApp:run
Windows

.\gradlew.bat :composeApp:run
Server Application
Run the Ktor server:

macOS / Linux

./gradlew :server:run
Windows

.\gradlew.bat :server:run
Web Application
Wasm Target (faster, modern browsers)
macOS / Linux

./gradlew :composeApp:wasmJsBrowserDevelopmentRun
Windows

.\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun
JS Target (slower, legacy browser support)
macOS / Linux

./gradlew :composeApp:jsBrowserDevelopmentRun
Windows

.\gradlew.bat :composeApp:jsBrowserDevelopmentRun
iOS Application
Run using one of the following methods:

Use the run configuration in the IDE

Open the /iosApp directory in Xcode and run from there

📚 Learn More
Kotlin Multiplatform

Compose Multiplatform

Kotlin/Wasm

💬 Feedback & Support
Compose/Web & Kotlin/Wasm Slack:
#compose-web → https://slack-chats.kotlinlang.org/c/compose-web

Report issues on YouTrack:
https://youtrack.jetbrains.com/newIssue?project=CMP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors