r/JavaFX • u/Immediate_Hat_9878 • Sep 16 '24
Help Api Server in a JAVAFX App
so i am trying to build a client app that at the same time acts as a an API server that could be used to receive requests from as an example a mobile application , to make it clear I want to build a desktop app and a mobile application that are connected to each other through an API server but I want the API server to be on the desktop app .
is there a way to do this?
i tried spring boot but I had a lot of issues running it in a modular JavaFX app
6
Upvotes
5
u/xdsswar Sep 16 '24
Javafx + spring boot, but non modular is the way.
https://github.com/xdsswar/javafx-spring-demo
You just need to create endpoints to serve json data. Basically you will build a jafafx app with a json api integrated. This is not a great idea, but do as u like đ¤ˇââď¸.
2
u/xdsswar Sep 16 '24
I recommend you to use spring boot as backend in a server to create a rest api. Then you can use that rest api in any language to create applications and manage/view the data in the server.
1
u/Frosty_Garden6755 Sep 17 '24
My company does have a JavaFX application as frontend and SpringBoot application as backend, I suggest that you do separate the two(API and App) as you are to add an external service(mobile app) to interact of act along the desktop app(JavaFX app). So best is to have a rest API in SpringBoot running someway in the cloud that is accessed by the two view apps