I am developing a medical solution that needs to be available both on and offline to the doctor. It is built in node.js and calls REST APIs built in PHP (Laravel) located on a central server. The user will be able to download an Electron app and access the full solution on their own computer, database and all. The solution will use full multitenancy (separate database per clinic) and encryption. The database used both on and offline is SQLite.
What is the best to achieve two-way replication between the SQLite master database located online and the 0 to many SQLite slave databases located on the users' desktops? If any user's connection goes down, they need to be able to keep on working without interruption and perform all types of DB operations seamlessly. When the connection is back, the databases need to be synched with minimal conflict.
I checked if Litereplica could be used, but the documentation states that the slave database is read-only. The users need to be able to save new patient treatments etc. even when the connection is down. Is there any way around this?
Any help is appreciated.