Skip to content

kdomskia/template-fullstack

Repository files navigation

Kdomskia Fullstack Template

This is a Kotlin Multiplatform project targeting Android, iOS, Web (DOM, JS), Desktop (JVM), and Server (Spring Boot).
It is powered by Kdomskia to unify UI across platforms.

Project Structure

  • /composeApp contains the UI and shared code for your applications.
    It includes several source sets:

  • /iosApp contains the iOS application entry point. Even when sharing UI with Compose Multiplatform,
    you need this module for iOS integration. SwiftUI code can also be added here if required.

  • /server contains the Spring Boot server application.

  • /shared contains code that is shared across all modules (backend and frontend).
    The most important subfolder is commonMain. Platform-specific folders can also be used if needed.

Setup

Before running the project, make sure to configure the BASE_URL in:

composeApp/src/commonMain/kotlin/com/template/HttpClient.kt

Set it to the local IP address of the server you intend to run. For example:

private val BASE_URL = "http://192.168.0.1:8080"

Build and Run Server

To build and run the development version of the server (Spring Boot), use the run configuration from the IDE toolbar
or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :server:bootRun
  • on Windows
    .\gradlew.bat :server:bootRun

Build and Run Android Application

To build and run the development version of the Android app, use the run configuration from the IDE toolbar
or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:assembleDebug
  • on Windows
    .\gradlew.bat :composeApp:assembleDebug

Build and Run Desktop (JVM) Application

To build and run the development version of the desktop app, use the run configuration from the IDE toolbar
or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:run
  • on Windows
    .\gradlew.bat :composeApp:run

Build and Run Web Application

To build and run the development version of the web app (JS, DOM), use the run configuration from the IDE toolbar
or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:jsBrowserDevelopmentRun
  • on Windows
    .\gradlew.bat :composeApp:jsBrowserDevelopmentRun

Build and Run iOS Application

To build and run the development version of the iOS app, open the /iosApp directory in Xcode
and run it from there. You can also use the run configuration from the IDE toolbar.

Renaming the Project

Before starting development, rename parts of the project so they match your app’s name and identity:

  • settings.gradle.kts → update rootProject.name
  • composeApp/build.gradle.kts → update appId
  • composeApp/src/androidMain/res/values/strings.xml → update app_name
  • composeApp/src/desktopMain/kotlin/com/template/Main.kt → update main.Window.title
  • composeApp/src/jsMain/resources/index.html → update <head><title>
  • iosApp/Configuration/Config.xcconfig → update PRODUCT_*
  • Update the package name of classes under com.template to your own package namespace.

Hot Reload

You can check your layout changes without building the whole project with Compose Hot Reload.

To use it, open the Main class inside the desktopMain source set and click on Run composeApp with Compose Hot Reload in your IDE (IntelliJ IDEA or Android Studio).

Simply save the file you are working on, and the running application will be updated automatically.

For more details, see the official JetBrains documentation: Hot Reload in Compose Multiplatform


Learn more at:

About

Kdomskia template targeting Android, iOS, Web (DOM, JS), Desktop (JVM) and Server (Spring Boot).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published