Compose Spring boot
is a template project for building a GUI client with kotlin compose and spring boot to solve these problem:
- Electron can not fit your technology stack, you want to use jvm platform
- You want to build java backend together with the web pages into a single GUI client, which can use between multiplatform desktop OS
- Your web page required Chromium core which java swing does not support
- The goal is desktop, no mobile support
- Use Jetbrains runtime 17(named
jbrsdk_jcef-17.*.tar.gz
) to build this project because it has full support for jcef - Because of kotlin compose build native installer with
jpackage
, andjcef
is not a standard java module, there is a gradle task to copy jetbrains runtime to native distribution, then it can not create Msi on windows, but macOS works well with Dmg - The main jar use the spring boot format, all classpath in
BOOT-INF/lib
instead of fat jar or copy all dependencies into app folder forjpackage
- You can fully use kotlin compose to write GUI if you do not use web page. If not, kotlin compose just be like a jvm-electron container
- Can not reduce the native installer disk size(500MB+). In theory it contains JDK 17 and Chrome, bigger than Electron
- A basic kotlin spring boot project with gradle
- Entry gradle task
releaseZip
for multiplatform build with Jetbrains runtime - A loading indicator during spring boot startup
- Exit with a confirmation dialog
- Custom MainToolBar with compose-jetbrains-theme
- Swagger page as default web page after start
- Support tabbed browser, or single page browser
- Support default shortcut key for browser
copy
: ctrl/command + cpaste
: ctrl/command + vselectAll
: ctrl/command + aundo
: ctrl/command + zredo
: ctrl/command + y