This is an API server for Availability. It generates some standard data at boot but otherwise allows for normal signups, logins and data mutations persisting to a sqlite database using Sequelize.
We plan to switch to using a proper networked RDBMS soon.
The server was originally built using the wonderful Chatty tutorial.
It uses:
- Express web framework
- graphql-server-express which integrates a GraphQL server into Express
- Sequelize to expose an ORM over the DB
Clone the repo, cd into the directory and run the following to install the dependencies:
yarnIMPORTANT: Edit src/config.js to set a secret if you're
even remotely interested in running this in production.
yarn run startThe server is deployed sporadically to Heroku (by @sdunster) by running:
yarn run deploy-herokuYou can play with the API here. The data is wiped whenever the Heroku web dyno is shut down or re-deployed.
If you'd like to deploy yourself you can build a bundle into dist/ by
executing:
yarn run buildYou can then execute the production-ready server bundle using:
yarn run serveOr just execute main.js:
node dist/main.jsOnce you have a server running you can access GraphQL at
/graphql or you can
play with the API explorer at /graphiql.
Contributions of all kinds are welcomed but please explain what you did to verify your change didn't cause a regression in your pull request. Writing a new test case for your new feature is probably the best way to do this since Travis will perform the tests for all pull requests.
Please ensure commits that land on master are self-contained changes and easily revertable. This can be achieved through non-fast-forward pushes to PR branches for PRs that contain multiple commits or by using GitHub's squash and merge feature when you merge the PR.
CI/Travis must pass before a PR can be merged. We look for test coverage in all commits but do not require that codecov passes.