This app maintains a grocery list. There are versions for the web, Android, and Apple devices. The grocery lists on each device are kept in sync to a common network database, when connected to the net. However, an offline copy is also kept on the device/browser. This copy can be edited while offline, and the next time you connect to the net, it will be re-synchronized with the network database. This program is a demonstration of solution for syncing multiple databases, solving the following problems:
Couch DB (on Cloudant), acts as a central repository for your shared data. A pouch DB instance on each web-page, allows local storage of data on each browser/computer/device, if you aren't connected to the Couch DB database on the network. The next time you are connected to the Couch DB database on the network, the software will automatically sync the databases, so they are consistent.
So, for instance, suppose you had an instance of this application open on Chrome, another on Firefox, and another version on a mobile device, as well as a central repository on Couch DB (Cloudant). If all of the versions were connected to the network to the Couch DB database, each instance of the program would have an exact copy of the Couch DB database stored in the local Pouch DB database in local storage. If you were to add a record on the Chrome instance of the app, it would update the local storage Pouch DB database. This would trigger an automatic sync with the Couch DB database on the network, and this would then trigger automatic updates on the instances running on Firefox, as well as the mobile device. Since, this program is using Angular JS; which already supports two way data binding, this is an example of six way data binding.
If the network is not available to your mobile device, the local pouch DB database allows you to modify a local copy of the database. Then, when your device is reconnected to the network (couch DB database), it will automatically sync the databases, and these changes will be distributed to all of the other instances that are online.
This app is available three ways: