Skip to content

Latest commit

 

History

History
135 lines (117 loc) · 4.94 KB

INSTALL.md

File metadata and controls

135 lines (117 loc) · 4.94 KB

Dependencies

If running locally (without dedicated GISAID feed):

Installation

Setup Back-End

  • Navigate to the directory in your filesystem under which you want to install the covizu directory

  • Clone the repository:

git clone https://github.com/PoonLab/covizu
  • Install with:
sudo python3 setup.py install  # omit `sudo` if you don't have superuser privileges
  • [Optional] Install PostgreSQL - Database for Extracted Features

    • Download and install PostgreSQL based on your operating system or pull the latest docker image
    • The following environment variables must be defined:
      • POSTGRES_USER - User name set up during installation of PostgreSQL
      • POSTGRES_PASSWORD - Password for the given user name
    • Optional environment variables:
      • POSTGRES_DB - The desired database name to use for the analysis. The default database name is gisaid_db
      • POSTGRES_HOST - The host name where PostgreSQL is running on. The default host is localhost
      • POSTGRES_PORT - The port used by PostgreSQL. The default port number is 5432
  • [Optional] Using Docker

    • In the root directory, run the following command to build and start PostgreSQL. This will create a default network called covizu_default
      docker compose up -d postgres
      
    • In a .env file, include the following:
      • POSTGRES_HOST=postgres
      • POSTGRES_USER=
      • POSTGRES_PASSWORD=
    • Build the docker image from the Dockerfile.backend Dockerfile using the following command:
      docker build --platform=linux/amd64 -t covizu-backend -f Dockerfile.backend .
      
    • Create a container named backend from the covizu-backend image using the following command:
      docker run --name backend --volume ${PWD}:/root/covizu --network covizu_default --env-file .env -itd covizu-backend
      

Setup Front-End

If you're running the server (front-end) for the first time, obtain the following data files from our main server at https://filogeneti.ca/covizu/data/:

  • timetree.nwk
  • dbstats.json
  • clusters.json and save your local copies under covizu/data/.

Next, make 3 separate environment files for the NodeJS server.

.env.test

HTTP_PORT='8001'
NODE_ENV='TEST'
DATA_FOLDER='data_test'

.env.dev

HTTP_PORT='8001'
NODE_ENV='DEV'
DATA_FOLDER='data'
ADMIN_USERNAME='admin'
ADMIN_PASSWORD='password'
COVIZU_USERNAME='covizu'
COVIZU_PASSWORD='password'
DB_URL='localhost:27017'

.env.prod (if running a production server with SSL enabled)

HTTP_PORT='8001'
HTTPS_PORT='8002'
NODE_ENV='PROD'
DATA_FOLDER='data'
PRVTKEY='/path/to/private-key-file.pem'
CRT='/path/to/certificate-file.crt'
ADMIN_USERNAME='admin'
ADMIN_PASSWORD='password'
COVIZU_USERNAME='covizu'
COVIZU_PASSWORD='password'
DB_URL='localhost:27017'

Install and configure the MongoDB database by following these instructions

Finally, run the following commands:

 cd covizu
 npm install
 npm run start-db1

Once you launch the local webserver with npm start, allow up to a minute for the server to initialize and then navigate your browser to localhost:8001.

Run Front-End Unit Tests

To run the end-to-end tests with Cypress start the test server

npm test

and in a new terminal terminal window run

npx cypress run --config-file "config/cypress.config.js"