clevercanary / hca-atlas-tracker

Apache License 2.0
0 stars 0 forks source link

hca-atlas-tracker

Local development

Setup

Use Node.js version 20.10.0.

Run npm install.

Set up Postgres database (see "Using Postgres" section below).

Using the development server

Run npm run dev. The app can be accessed at http://localhost:3000.

Building the app

Run npm run build:local to build the app to be run locally. The built app can be run using npm start, and accessed at http://localhost:3000.

The development version of the app can similarly be built using npm run build:dev, and the production version using npm run build:prod.

Using the Docker image

Run docker build --build-arg ENVIRONMENT=local -t tracker-node -f Dockerfile.node . to build the image for the locally-runnable app.

The container can be run using docker run -p 3000:3000 tracker-node.

To build the development or production app instead, replace local with dev or prod in the build command, e.g. for production: docker build --build-arg ENVIRONMENT=prod -t tracker-node -f Dockerfile.node ..

Using Postgres

Setup

Running queries in the terminal

Running tests

In order to run tests, a test database must be created:

Once this has been done, tests may be run with npm run test.