Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend store #8

Open
mjg17 opened this issue Mar 22, 2016 · 2 comments
Open

Backend store #8

mjg17 opened this issue Mar 22, 2016 · 2 comments

Comments

@mjg17
Copy link
Contributor

mjg17 commented Mar 22, 2016

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.

@me--2014
Copy link
Contributor

I'd be interested in learning to use something with a MongoDB-like API so sounds good to me!

@mjg17
Copy link
Contributor Author

mjg17 commented May 31, 2016

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants