Hello,
I am in the process of developing a desktop application based on Meteor. The app is meant to function both online when the server is reachable, and offline when not, in which case, I was meaning to use PouchDB as a local backdrop, then taking advantage of its sync capabilities, sync everything the moment the client is able to reach the server again. To give you some context for you to understand where I come from, here:
The app (client) is meant to function inside a local network, where one of the computers acts as the server (with a CouchDB server). Whenever one or multiple clients are connected they primarily use their own local PouchDB, which in turn is synced live to CouchDB. When offline, clients can still use the app until such moment they can contact the server again and sync their changes (sync conflicts here are irrelevant, let’s just assume there aren’t).
And so, this is my inquiry: How would I go about implementing that, while still retaining Meteor’s core feature – that is reactive data. Keeping in mind that clients should preferably use their own local storage (PouchDB) which is synced live to the server (CouchDB)
And in case the above is impossible, is there any other alternative for what I am attempting? That is offline usage and seamless sync of data to the server.
Also, somewhat of a side-note, given that I have no control over the network configuration (and thus IPs) my server’s IP may change daily. Cloudant’s docs specify that you need to start Meteor while passing an environment variable which is the server credentials: Isn’t there some way to pass those after the app has started, in this fashion:
Meteor.startup( () => {
//Find my IP using a personal script
//Set CouchDB's URL
....
//Sync PouchDB to it
}
Thank you for your time.
Good evening to all.