The OpenTrials API service + database schema definition.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
config
migrations
seeds
test
tools
.dockerignore
.env.example
.eslintignore
.eslintrc
.gitignore
.istanbul.yml
.travis.yml
Dockerfile
README.md
app.json
docker-compose.override.yml
docker-compose.yml
knexfile.js
nodemon.json
npm-shrinkwrap.json
package.json
server.js

README.md

api

Gitter Travis Build Status Coveralls Dependency Status Issues Docs

The OpenTrials API service.

Developer notes

Requirements

  • Node 6.9
  • PostgreSQL 9.4
  • ElasticSearch 2.3.5

Installing

  1. Copy the .env.example file to .env and alter its contents as needed. At minimum, you should set the DATABASE_URL and ELASTICSEARCH_URL. The TEST_DATABASE_URL is needed to run the tests. You could leave the ELASTICSEARCH_AWS_* as is if you're not using ElasticSearch on AWS;
  2. Run npm install;
  3. Run npm run migrate;
  4. (Optional) If you want, you can add some seed data using npm run seed;
  5. Run npm run reindex;

After the install and migrations ran successfully, you can run npm run dev to run the project. If you haven't changed the default PORT, it should be available at http://localhost:5000

Reindexing

Currently, there's no way to automatically reindex the data. Every time you change the database, you'd need to run npm run reindex to keep ElasticSearch in sync.

Testing

You can run the test suite and linting with npm test.

Interacting with the API

You can find and interact here with the available endpoints.