A system that sends out a daily tip sheet for fact checkers, developed at the Duke Reporters Lab.
This is a node project. The version of node is specified in package.json
and we recommend the use of nvm for managing your local node versions.
To set up your development environment...
> yarn install
This project uses postgres to store its data. You will need to either set up a local copy, or find a hosted solution. Be sure to remember the username and password you set up for this project.
You will need to set up two separate databases: one for testing and one for the actual application. Having a distinct test database is a code-enforced requirement.
This project uses redis as a data store for queues. You will need to set up a local copy, or find a hosted solution.
You will need to configure your environment variables. In production this can be done however your host recommends; in development we recommend using an .env
file. A template for the contents of .env
is provided in .env.template
.
> cp .env.template .env
> vi .env
The database credentials (e.g. DATABASE_URL_DEVELOPMENT
and DATABASE_URL_TEST
) should match the relevant instances of username
and databasename
that you set up when installing postgres.
> yarn migrate
> yarn start
> yarn test
Or, to start a watcher that runs tests as you change them:
> yarn test:watch
The primary control flow of this project is handled through jobs and queues. We use bull, which is built on top of redis.
Creating a new queue involves making a new directory in the server/queues
folder with the following files:
src/server/queues/constants.js
. This file must export a class that extends AbstractJobScheduler.The best thing to do is look at an existing implemented queue and work from there.
This project uses Travis CI for continuous integration. This takes the form of:
master
branch.For more information about our continuous deployment setup read our CD documentation.
If you're interested in contributing to this project: thank you! Contributions are made via pull request. Please be sure to review our contribution guidelines and code of conduct.