ConveyorJS
View on Github: https://github.com/dboskovic/conveyorjs
ConveyorJS is a normalized data API that can be used with any application in order to maintain state across multiple APIs.
Example Scenario
- You have a web-based event calendar.
- You create an event and invite someone to it, posting to an HTTP api.
- You sync that event onto the invitees webapp with a socket.io payload.
- Invitee accepts event, and adds a location, posting to the API.
- You receive a socket.io payload with the accepted invite and location.
- Your app must now do the following:
- See if you've made any local - unsaved changes.
- If you have, make sure that new changes received do not conflict. If there are conflicts, the user must be given an easy way to resolve them (maybe you added a different location?)
- Merge in changed data that is being pushed from the server (already saved) with local changes (not yet saved).
- Synchronize changes with the UI (some frameworks will do this automatically - like Angular).
- Allow you to save your local changes to the model without over-riding changes on the server.
- See if you've made any local - unsaved changes.
- In addition to this, you may go offline, and want to fall back to local-storage without hurting the users' experience. When you come back online you may want to sync that LocalStorage data with the server.