Open mjg17 opened 8 years ago
I'd be interested in learning to use something with a MongoDB-like API so sounds good to me!
This is all taking shape, at: https://github.com/mjg17/organisations-database/tree/server-store-api
You can browse the store code at: https://github.com/mjg17/organisations-database/tree/server-store-api/backend/stores
and the corresponding tests at: https://github.com/mjg17/organisations-database/tree/server-store-api/test/backend/stores
organisations.js
is the direct, synchronous, non-promise LokiJS store for our backend.lokiPersist.js
is a wrapper for implementing an asynchronous LokiJS store via promises. It can be used to wrap any suitable LokiJS store module such as organisations.js.orgPersist.js
is the wrapped version of organisations.js and is ready to be used in Express for our backend REST server.So the next stage is to write the express code :-)
Paul originally suggested MongoDB for the data store on the backend server, and that seems to be a good plan for a real deployment. However it's a stumbling block if we each want to run a local dev server via node.js as we develop the app.
LokiJS seems to be a good alternative: http://lokijs.org/
It has a MongoDB-like API, and yet is completely self-contained. It can be installed via a single addition to packages,json, and can use a simple local file for persistence.
If that seems sensible, I'll work on implementing the back end API using LokiJS.