Offline by default + Sync server

Hello,
I am just getting started with Uibuilder, here is a question though.

As far as I know, Uibuider acts as a server establishing websocket connections to concurrent clients, serving them resources by responding to triggers through Noder Red logic or triggers sent by the client’s browser via forms.

All right until you have bad 5g coverage or bad wifi signal.. in which case websoket brokes and you can not enjoy a fluid browsing experience.

I wonder if is possible to use Uibuilder and Node Red to build a Sync server.
Every client does make use of its browser’s persistent storage (same as Bitwarden storage) and whenever changes are made it syncs them to the Node Red Sync server, wich broadcasts the updates to all other clients.

The result of this combo will be instant loading times for your data website not matter if offline or with unstable connectivity.

I know is an edge usecase and probably not what Uibuilder is intended to resolve, any insights are much appreciated.

I'd already started thinking about this but the capabilities in UIBUILDER for that are fairly basic right now.

UIBUILDER does have functions for using localStorage in the browser so perfectly possible to cache data in the browser. But currently it means that you would need most of your logic in the front-end I suspect.

Lots of ideas in my head about extending this but nothing concrete right now.

So you would need to do some of your own front-end code for now.


Thinking longer term, the client library should be able to cache things locally and deal with a disconnected network. This probably needs some webworker capability as well as local storage. Of course, localStorage is limited by browser settings which is outside of our control so page and data cache sizes would, of necessity, also be limited.

1 Like

Indeed it requires both, to better grasp what I am thinking of, I would like to combine this project offline approach https://tiddly.packett.cool/ with Node Red, by using this other project as a bridge TW5-Node-Red — Node-Red Connected 01/13/2024 09:01 wich does use Uibuilder in its core and is expected to be released by the end of the week for testing.

Will see, sounds promising

Interesting. I used to be an avid user of TiddlyWiki. But in the end, I found it too complex to continue with and it was overtaken by other tools. I even had a project management tool in TW that I used on several projects.

However, the TW nodes provide their own server I believe so I'm not sure what UIBUILDER would bring to the table? One of the issues with TW is the internal complexity of the tiddler storage mechanisms.

For TiddlyPWA, they unfortunately use Deno to provide a custom web server whereas UIBUILDER uses ExpressJS and Node.js as does Node-RED itself. It might be possible to reverse engineer the server to work with UIBUILDER/Node-RED but sadly, I just don't have any time to do that right now.

In terms of UIBUILDER offline use, in theory you can roll your own solution if you understand how to build a progressive web app - namely how to put together a web manifest file that declares the required resources and a small webworker to proxy the http and socket.io connections. It is on my backlog of work to do this - partly because it would mean that you could create cross-platform mobile apps this way. Ultimately, I also want to enable people to be able to build tools similar to Notion or Obsidian using UIBUILDER. Unfortunately, it all takes time and I don't have the money to be able to retire early to work on it full time. :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.