DSD-DBS / capella-collab-manager

A web app for collaboration on Capella (MBSE) projects
https://dsd-dbs.github.io/capella-collab-manager/
Apache License 2.0
21 stars 4 forks source link

Add support for offline mode #1024

Open MoritzWeber0 opened 12 months ago

MoritzWeber0 commented 12 months ago

It should be possible to request a session, which can be used offline. This is helpful for situations where no reliable internet connection is available, for example in the train.

MoritzWeber0 commented 10 months ago

One initial implementation idea:

Wuestengecko commented 10 months ago

Just my two cents (feel free to ignore this first part - I'm quite inexperienced with web dev and can't judge the effort myself): If the user has to pip install and launch a server locally anyways, why bother making the frontend a PWA? Couldn't the local server just serve regular web pages which (mostly) look like the online collab manager? I imagine it could lead to some duplication of frontend code (which would be bad), but I also imagine the whole rerouting business when the upstream connection becomes (un-)available could also cause more than just one headache.

Another question: How would a user who has reconnected get data from the offline session back to the online collab manager? (I suppose it would use the offline version if launched from there, and try online if visited manually?)

MoritzWeber0 commented 10 months ago

Just my two cents (feel free to ignore this first part - I'm quite inexperienced with web dev and can't judge the effort myself): If the user has to pip install and launch a server locally anyways, why bother making the frontend a PWA? Couldn't the local server just serve regular web pages which (mostly) look like the online collab manager? I imagine it could lead to some duplication of frontend code (which would be bad), but I also imagine the whole rerouting business when the upstream connection becomes (un-)available could also cause more than just one headache.

It's not just about the frontend code duplication - it's also about keeping the two frontends aligned. When there is a change in the frontend UI/UX, we would need to change both frontends (in addition to the two backend (local / server). There is a lot of stuff that we can make work offline, e.g., file browser and session termination. It would also be amazing to get the session viewer to work locally, but I don't think that we will ever run Guacamole locally.

I'd not care much about rerouting at all - this can be solved via simple switch (offline points to the localhost backend, online to the real server).

Setting up a PWA isn't much effort and the backend URL is a variable already, so this should be easy.

On the other hand, with an independent client we are more flexible in term of API changes (server side) and there is no need to install a PWA before (even though it should be simple task). Also, it might be a more stable solution.

Another question: How would a user who has reconnected get data from the offline session back to the online collab manager? (I suppose it would use the offline version if launched from there, and try online if visited manually?)

The workspace will not be synced with the server. There is a offline workspace and a online workspace. The user has to keep them in sync (most likely via Git).