Client-side React application for visualising serological data.
Install dependencies with npm install
. Then the following scripts are available.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
For the app to work, the
serovizr API must be running on port 8888; this can
be started using scripts/run-dev-dependencies.sh
.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs unit tests using jest.
Runs integration tests using jest. This requires the
serovizr API to be running; this can
be started using scripts/run-dev-dependencies.sh
.
Builds the app for production to the build
folder.
Auto-generates typescript types based on the serovizr
API JSON schema specifications. Generated types are saved into src/generated.d.ts
.
The app is deployed using a Dockerised nginx
server which also proxies the serovizr
API.
See the proxy/README.md for details.
- To build the Docker image run
.scripts/build
. - To push an image to DockerHub run
./scripts/push
- To start a copy of the app locally with a self-signed SSL certificate run
./scripts/run
.
Secrets (at the moment this is just the real SSL private key and certificate) are stored in HashiCorp Cloud Vault. To access the secrets in Vault, you need to create an account with HashiCorp Cloud and ask Alex to add you to the organization.
To deploy the app, ensure that you have the hcp
CLI installed on your machine.
Installation instructions here.
The app is deployed onto an EC2 instance called seroviz
. You will need to ask Alex for AWS console access,
and to add your IP to the inbound security rules for ssh access.
Then:
-
Retrieve
hcp
service principal credentials by running on your own machine (afterhcp auth login
):hcp vs secrets open production_id --app=seroviz hcp vs secrets open production_secret --app=seroviz
-
ssh onto the server
-
Navigate to the
seroviz
directory -
Run:
./scripts/clear-docker.sh ./scripts/deploy
The
deploy
script will prompt you for the client id and secret from step 1.You can also export these as environment variables which may be more convenient in case deployment fails for any reason and has to be re-run:
CLIENT_ID=<client_id> CLIENT_SECRET=<client_secret>
(unless otherwise specified, all steps are run on the remote machine)
- Install
git
:sudo yum -y install git
- Install Docker, following instructions here.
- Install the
hcp cli
for secret retrieval by following the instructions for Amazon Linux. - On your own machine, install the
hcp cli
if you haven't already, and retrieve the production service principal id and secret, stored atproduction_id
andproduction_secret
:hcp vs secrets open production_id --app=seroviz hcp vs secrets open production_secret --app=seroviz
- On the remote server, clone this GitHub repo using https:
git clone https://github.com/seroanalytics/seroviz.git
- Follow the instructions above to deploy the app
The domain name seroanalytics.org
is registered with NameCheap.
Contact Alex if you need to add or change a DNS record.