Hi Max, I didn’t use PouchDB in the demo. Do you need local offline storage for browsers?
It’s a bit much to go into the full architecture here, but basically the node server supplies REST endpoints that correspond to the various data/query requests. So, for example, there’s an endpoint to get the geolocation of a group of patients. I use bluebird promises for async operation to keep everything non-blocking.
The mobile side is quite straight-forward. Changes made by the web client automatically feed out to the mobile side based on channels.
Maybe the less obvious parts, to give some idea of usage scenarios, are the full-text search and the geolocation query parts. One nice piece is the use of the built-in cURL capabilities. It allows you to use a cURL-style api to retrieve data from an external source and treat it just like data from the database (meaning you can do joins and other complex N1QL actions with it directly).