- Docker.
- Python 3.
- Pip.
- Virtualenv.
- Run src/visualiser/git-server/certs/gen-ca-cert.sh.
- Run src/visualiser/git-server/certs/gen-domain-cert.sh.
- Copy src/visualiser/git-server/certs/pf.pem to a new folder src/visualiser/spring/certs.
- Copy src/visualiser/git-server/certs/pf.pem to a new folder src/web/certs.
- Copy src/visualiser/git-server/certs/pf.* to src/web/proxy/certs.
- Run src/web/proxy/certs/gen-domain-cert.sh.
src/web .env (development)
-
Create a
.env
file in src/web. -
Generate a local development RSA private key (for JWT signing), generated by
openssl genrsa -out key.pem 2048
, and reference its location (e.g.src/web/certs/key.pem
, if the key is generated and stored within src/web/certs):
RSA_PRIVATE_KEY_FULL_PATH=
-
Create a
.env
file in project root. -
To this file, add the following, which should be chosen at random:
DEFAULT_PASSWORD=
MYSQL_ROOT_PASSWORD=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DATABASE=
- In addition, add the location of a root certificate within src/web (e.g. 'src/web/certs/pf.pem'), allowing 'web' to communicate with other services:
NODE_EXTRA_CA_CERTS=
- Add a deployment RSA private key name, e.g.
key.pem
(openssl genrsa -out key.pem 2048
):
RSA_PRIVATE_KEY=
- Add a path on the target deployment host to the deployment RSA private key (without the key name), e.g.
/home/ubunut/.certs/
:
HOST_RSA_PRIVATE_KEY_PATH=
- Create
analytics.pug
in src/web/views (may be blank, or contain analytics script) - Add images to src/web/public/images (live set available here)
- Add a
.htpasswd
file to src/web/proxy/certs - Create src/web/uploads
This is an express (lightweight server) project. The majority of the logic is contained within src/web/app.js, and in the src/web/routes and src/web/util folders.
- Local running is only available via Docker. From src/visualiser:
docker-compose -f docker-compose.dev.yml build
docker-compose -f docker-compose.dev.yml up -d
- Inside src/generator, initialise a virtual environment, and activate:
virtualenv -p python3 env
. env/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Run generator:
python main.py
- Inside src/web, create a node virtual environment (within a python virtual environment), and activate it:
virtualenv env
. env/bin/activate
pip install nodeenv
nodeenv nenv
. nenv/bin/activate
- Install dependencies:
cat requirements.txt | xargs npm install -g
- Create database:
npm run migrate
- Run server, referencing generated certificate:
NODE_EXTRA_CA_CERTS=certs/pf.pem npm start
- Deployment is via Docker. If using remote machine, ensure it is activated:
eval $(docker-machine env [machine-name])
- From the root directory, build these containers:
docker-compose build
- Run these containers:
docker-compose up -d
- Repeat inside src/visualiser.
- Inside src/web, run all tests:
npm test
- Run specific test(s), e.g.:
NODE_ENV=test npx mocha -g "basic" --exit
- Inside src/generator, run all tests:
python -m unittest
- From the root directory run:
docker-compose -f docker-compose.test.yml build;
docker-compose -f docker-compose.test.yml up;
Tests can also be used to import phenotypes from different data sources.
The server runs by default on port 3003. Visit localhost:3003/[route] to test changes to GET endpoints and use software such as Postman to test changes to POST (and other) endpoints.
This project is licensed under the MIT License - see the LICENSE.md file for details.