B4J Question simplest way to have optional UI for non-UI app ?

peacemaker

Expert
Licensed User
Longtime User
Hi, All

If a server app is being developed, that must work 24\7 on server, without window-interface, but it needs some settings (periodical manual operations, adjusting...), setup by a user - how simpler\faster to implement the settings user interface ?

Web-app should have documented access, and needs to develop HTML forms code, and make the handlers and classes for them ... maybe is there more simple way for interface ?
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Doesn't my solution fit?
If to think deeper...
Why any non-UI server app is created ? To work 24\7 and receiving some tasks and return some done result...
Remote interconnect here is anyway ... by network technologies.
For payload a database is required anyway also...
And the dynamic settings subsystem here is only one module. Other app commands require a similar API :)

Resume: @aeric 's WebAPI ready code is the best, here already all is prepared for any (rather complicated) server's app.
This is not only API template - it's the template of almost any non-UI server app.
But web-interface for a user\operator is ... also needed, i've forgotten about it :) - so WebAPI_client will help.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
Why any non-UI server app is created ? To work 24\7 and receiving some tasks and return some done result...
Remote interconnect here is anyway ... by network technologies.
Yes, a server solution is recommended to "serve" requests from multiple clients. It can handle high performance requests unlike UI app which is not design for such use case. UI app can "sleep" or put to background by the operating system.

For payload a database is required anyway also...
You can also do it without database or persistent storage if you don't want.
If you use a variable, then the memory/value of the "setting" will be cleared when the app is restarted.
So, a database usually is recommended. If it is just a simple app, KeyValueStore also can work.

WebAPI_client will help
If you want to allow different platforms to access the value of the "setting", not only limited to web browser, you can create the client as B4XPages client like how I did for Android, iOS, B4J Desktop app for Windows, Linux and MacOS.

At the end, it all depends on your requirements.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
What is the web-browser interface ? Help page ?
My sample also show a web browser client or web frontend (index.html) to interact with the REST API. The search button call the API to retrieve the data from database. The browser normally don't show index.html in the URL because it is by default.

The help page (help.html) is also another client app for executing the REST API calls.

The URL doesn't show the .html in browser address because the routing or request handler is handled by the B4J server.
 
Upvote 0
Top