Client-side React + WebR application for simulating serosurvey data using serosim.
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, a WebR repo containing the serosim
package must be running on port 9090; this can
be started using scripts/run-dev-dependencies.R
.
The page will reload if you make edits.
You will also see any lint errors in the console.
Runs tests using jest.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
Run eslint on the code in src
.
This project was bootstrapped with Create React App.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
The app is deployed using a Dockerised nginx
server.
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 Dockerised app locally run
./scripts/run
.
The SeroSim app is deployed on DigitalOcean via the App Platform. You will need to be added to the seroanalytics
team to make any changes to the settings. The app has a single service
which is deployed using a Docker image.
The DigitalOcean app topology should look like this:
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
- rule: DEPLOYMENT_LIVE
domains:
- domain: serosim.seroanalytics.org
type: PRIMARY
zone: seroanalytics.org
features:
- buildpack-stack=ubuntu-22
ingress:
rules:
- component:
name: serosim
match:
path:
prefix: /
name: serosim
region: lon
services:
- http_port: 80
image:
registry: seroanalytics
registry_type: DOCKER_HUB
repository: serosim-web
tag: 1f5c13c
instance_count: 1
instance_size_slug: apps-s-1vcpu-0.5gb
name: serosim
run_command: /usr/local/bin/serosim-proxy serosim.seroanalytics.org
A new image tag is created, pushed to DockerHub, and deployed to DigitalOcean on all commits to main, via the deploy.yaml Github Action.
The domain name seroanalytics.org
is registered with NameCheap, but DNS is managed via DigitalOcean under the Networking section.