Spring boot as backend with JavaFX as frontend

Viewed 59

I have developed an application using Spring Boot and JavaFX for desktops but the problem is spring boot takes more than 10s to start the application and set everything up which results in poor UX.
So I decided to go native using GraalVM but some part of my application uses JavaFX WebView which isn't supported on Windows yet.
So then I tried alternates for the purpose I am using WebView in the first place but the problem with that is somehow the solution uses java.awt package which results in not being able to run the native image which uses JavaFX and AWT together as it throws no awt lib in java.library.path.

New Solution

Then now I decided to separate the spring boot into a separate module and expose endpoints to it and then use them in the JavaFX part of the application.
So the idea here is that I will try to build a `native-image` of the spring-boot module which will result in a faster boot-up time. And the JavaFX Part in itself is pretty quick to boot up so that would not require a native-image.
And then package the JavaFX part with `jlink` and `jpackage`, and somehow manage to build an installer to combine both *spring-boot native-image* and *JavaFX application*.
So when the user opens the application, first the JavaFX part will start and then that part will start the native-image which will essentially act as a server.

My Questions

  1. Is it possible to achieve this solution?
  2. If yes, what are the drawbacks?
  3. Is there any better approach to solving this problem?
  4. What would be the drawbacks of that approach?
  5. And finally is it recommended to go with my solution?
0 Answers
Related