This project is a simple app where you can search for information on various genomic variants.
- NodeJS v9.1.2
- NPM v5.6.0
- Mocha
npm install -g mocha
v5.0.5 - Postgres v9.5.12
npm install
There are a few environment variables that are required to run the app.
PORT
: the port the server will listen onTEST_PORT
: the port the server will listen on during testing, must be different from PORT in order to run tests while the server is running.NODE_ENV
: either development or testDB_FILE_PATH
: the path to the file where the data will be loaded from. See Database SetupDB_USER
: the user who has access to the created databaseDB_PASSWORD
: see aboveDB_NAME_DEVELOPMENT
: name of the development database on your machineDB_NAME_TEST
: see above
This repo makes use of the dotenv
package to help specify environment variables. To use dotenv, fill in your environment variables in sample.env
, and then rename the file to .env
.
To set up the development and testing databases, create new PostgreSQL databases and add names to the .env file, or use the default names clinvitae
and clinvitae-test
.
To run migrations on the database, run npm run db:migrate
To load the developmnet database, download and the file containing the variant data here. Once you've specified the path to the file, run the command npm run db:load
. This may take a few minutes.
To seed the test database, run knex seed:run
. Be sure that NODE_ENV
is set to test
.
To compile the app, run npm run build
, or npm run build-dev
if you wish to have webpack watch for changes.
To run the server, simply run npm start
.
To run tests, make sure NODE_ENV
is set to test
and run npm test
.