
Simplifies app development by providing default networking, storage, dependency injection, plugin system, material icons and monospaced font, logging and SQL storage, plus Chinese-text rendering fixes.
boot 旨在通过默认的网络、存储、依赖注入、插件实现,简化kmp跨平台应用开发.
boot-app-kmp 参考 Spring Boot Starter 理念设计,核心等价关系:
| Spring Boot | boot-app-kmp | 说明 |
|---|---|---|
spring-boot-starter-xxx |
boot-xxx 模块 |
模块化封装 |
@Configuration + AutoConfiguration
|
BootModule + Koin |
依赖注入配置 |
spring.factories / META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
|
META-INF/services/ + SweetSPI
|
自动发现机制 |
自动发现通过 SweetSPI (KMP ServiceLoader) 实现:
BootModule 实现类META-INF/services/com.yuanjingtech.boot.app.kmp.BootModule 文件PluginManager 通过 ServiceLoader.load(BootModule) 在运行时加载所有模块pluginModule 统一将所有模块注册到 Koin参考 Spring Boot 官方 Starter 设计,映射到 KMP 模块:
| 排序 | Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|---|
| 1 | spring-boot-starter-web |
network/ (Ktor) |
RESTful API 构建 |
| 2 | spring-boot-starter-data-jpa | sqldelight/ |
SQL 数据库访问 |
| 3 | spring-boot-starter-logging |
logging/ (kotlin-logging) |
日志框架 |
| 4 | spring-boot-starter-validation |
ui/ (Material3 TextField) |
参数校验 UI |
| 5 | spring-boot-starter-aop | plugin/ |
切面/插件化支持 |
| Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|
| UI 组件 | ui/ |
LiquidGlass / Material3 |
| 子应用 | subapp/ |
模块化解耦 |
| WebView |
webview/ + webview-parkwoocheol/
|
Web 内容集成 |
| 依赖注入 |
shared/ (Koin) |
DI 容器 |
| ORM |
shared/ (Room3) |
响应式数据库 |
| 优先级 | Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|---|
| P0 | spring-boot-starter-security | auth/ |
认证/授权 (JWT/Session) |
| P0 | spring-boot-starter-actuator | actuator/ |
健康检查/监控 |
| P1 | spring-boot-starter-data-redis | cache/ |
KV 缓存 (DataStore) |
| P1 | spring-boot-starter-cache | store/ |
数据源抽象层 |
| P2 | 多租户 | tenant/ |
SaaS 多租户隔离 |
| P2 | spring-boot-starter-mail | mail/ |
邮件发送 |
| P2 | spring-boot-starter-websocket | websocket/ |
WebSocket 通信 |
| P3 | spring-boot-starter-batch | batch/ |
批处理任务 |
| P3 | coil 独立模块 | image/ |
图像加载 |
聚焦 80/20 法则: P0/P1 模块覆盖 80% 企业场景,优先实现。
封装常用组件 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui 组件定义 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui/liquidgalass LiquidGlass组件实现 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui/material3 Material3组件实现
gradle/libs.version.toml
[ versions ]
boot = "0.0.2-alpha.15"
[ libraries ]
boot-shared = { module = "com.yuanjingtech.boot.app.kmp:shared", version.ref = "boot" }
[ bundles ]
feature = [
"boot-shared",
]feature/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
api(libs.bundles.feature)
}
}
}App.kt
@Composable
@Preview
fun App() {
BootApp(config = KoinConfiguration {
printLogger()
}) {
Content()
}
}This is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop (JVM), Server.
/composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:
/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.
/server is for the Ktor server application.
/shared is for the code that will be shared between all targets in the project. The most important subfolder is commonMain. If preferred, you can add code to the platform-specific folders here too.
To build and run the development version of the Android app, use the run configuration from the run widget in your IDE’s toolbar or build it directly from the terminal:
./gradlew :composeApp:assembleDebug.\gradlew.bat :composeApp:assembleDebugTo build and run the development version of the desktop app, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:
./gradlew :composeApp:run.\gradlew.bat :composeApp:runTo build and run the development version of the server, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:
./gradlew :server:run.\gradlew.bat :server:runTo build and run the development version of the web app, use the run configuration from the run widget in your IDE's toolbar or run it directly from the terminal:
./gradlew :composeApp:wasmJsBrowserDevelopmentRun.\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun./gradlew :composeApp:jsBrowserDevelopmentRun.\gradlew.bat :composeApp:jsBrowserDevelopmentRunTo build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the /iosApp directory in Xcode and run it from there.
Learn more about Kotlin Multiplatform, Compose Multiplatform, Kotlin/Wasm…
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel #compose-web. If you face any issues, please report them on YouTrack.
boot 旨在通过默认的网络、存储、依赖注入、插件实现,简化kmp跨平台应用开发.
boot-app-kmp 参考 Spring Boot Starter 理念设计,核心等价关系:
| Spring Boot | boot-app-kmp | 说明 |
|---|---|---|
spring-boot-starter-xxx |
boot-xxx 模块 |
模块化封装 |
@Configuration + AutoConfiguration
|
BootModule + Koin |
依赖注入配置 |
spring.factories / META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
|
META-INF/services/ + SweetSPI
|
自动发现机制 |
自动发现通过 SweetSPI (KMP ServiceLoader) 实现:
BootModule 实现类META-INF/services/com.yuanjingtech.boot.app.kmp.BootModule 文件PluginManager 通过 ServiceLoader.load(BootModule) 在运行时加载所有模块pluginModule 统一将所有模块注册到 Koin参考 Spring Boot 官方 Starter 设计,映射到 KMP 模块:
| 排序 | Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|---|
| 1 | spring-boot-starter-web |
network/ (Ktor) |
RESTful API 构建 |
| 2 | spring-boot-starter-data-jpa | sqldelight/ |
SQL 数据库访问 |
| 3 | spring-boot-starter-logging |
logging/ (kotlin-logging) |
日志框架 |
| 4 | spring-boot-starter-validation |
ui/ (Material3 TextField) |
参数校验 UI |
| 5 | spring-boot-starter-aop | plugin/ |
切面/插件化支持 |
| Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|
| UI 组件 | ui/ |
LiquidGlass / Material3 |
| 子应用 | subapp/ |
模块化解耦 |
| WebView |
webview/ + webview-parkwoocheol/
|
Web 内容集成 |
| 依赖注入 |
shared/ (Koin) |
DI 容器 |
| ORM |
shared/ (Room3) |
响应式数据库 |
| 优先级 | Spring Boot Starter | boot-app-kmp 模块 | 说明 |
|---|---|---|---|
| P0 | spring-boot-starter-security | auth/ |
认证/授权 (JWT/Session) |
| P0 | spring-boot-starter-actuator | actuator/ |
健康检查/监控 |
| P1 | spring-boot-starter-data-redis | cache/ |
KV 缓存 (DataStore) |
| P1 | spring-boot-starter-cache | store/ |
数据源抽象层 |
| P2 | 多租户 | tenant/ |
SaaS 多租户隔离 |
| P2 | spring-boot-starter-mail | mail/ |
邮件发送 |
| P2 | spring-boot-starter-websocket | websocket/ |
WebSocket 通信 |
| P3 | spring-boot-starter-batch | batch/ |
批处理任务 |
| P3 | coil 独立模块 | image/ |
图像加载 |
聚焦 80/20 法则: P0/P1 模块覆盖 80% 企业场景,优先实现。
封装常用组件 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui 组件定义 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui/liquidgalass LiquidGlass组件实现 ui/src/commonMain/kotlin/com/yuanjingtech/boot/app/kmp/ui/material3 Material3组件实现
gradle/libs.version.toml
[ versions ]
boot = "0.0.2-alpha.15"
[ libraries ]
boot-shared = { module = "com.yuanjingtech.boot.app.kmp:shared", version.ref = "boot" }
[ bundles ]
feature = [
"boot-shared",
]feature/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
api(libs.bundles.feature)
}
}
}App.kt
@Composable
@Preview
fun App() {
BootApp(config = KoinConfiguration {
printLogger()
}) {
Content()
}
}This is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop (JVM), Server.
/composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:
/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.
/server is for the Ktor server application.
/shared is for the code that will be shared between all targets in the project. The most important subfolder is commonMain. If preferred, you can add code to the platform-specific folders here too.
To build and run the development version of the Android app, use the run configuration from the run widget in your IDE’s toolbar or build it directly from the terminal:
./gradlew :composeApp:assembleDebug.\gradlew.bat :composeApp:assembleDebugTo build and run the development version of the desktop app, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:
./gradlew :composeApp:run.\gradlew.bat :composeApp:runTo build and run the development version of the server, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:
./gradlew :server:run.\gradlew.bat :server:runTo build and run the development version of the web app, use the run configuration from the run widget in your IDE's toolbar or run it directly from the terminal:
./gradlew :composeApp:wasmJsBrowserDevelopmentRun.\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun./gradlew :composeApp:jsBrowserDevelopmentRun.\gradlew.bat :composeApp:jsBrowserDevelopmentRunTo build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the /iosApp directory in Xcode and run it from there.
Learn more about Kotlin Multiplatform, Compose Multiplatform, Kotlin/Wasm…
We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel #compose-web. If you face any issues, please report them on YouTrack.