Skip to content
/ beebop Public

Frontend code for beebop

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

bacpop/beebop

Repository files navigation

Beebop

Docker images are built on CI using ./proxy/docker/build, ./app/server/docker/build. If you want to generate them from changed local sources you can run those same scripts locally to build images.

To target a branch of beebop_py, set API_IMAGE in scripts/common. If there is a dev image available, that can be targeting by adding -dev to the image name.

Local development

Clone the repository to your computer with

git clone [email protected]:bacpop/beebop.git

Make sure you have Node Package Manager and Docker installed:

npm --version
docker --version

If you run the application for the first time (or for the first time after running in docker), you need to replace the secrets in the config file in app/server/src/resources first. Login to the vault:

export VAULT_ADDR=https://vault.dide.ic.ac.uk:8200
vault login -method=github

Then run:

./scripts/decrypt_config

To start all required components, run:

./scripts/run_test

To run dependencies and server only, run:

./scripts/run_test server-only

Note: These scripts call run_dependencies which downloads ref databases only. To download full databases, remove --refs from the ./scripts/download_databases --refs command in run_dependencies

The website can be viewed at http://localhost:5173/ . You can stop the application with ./scripts/stop_test.

The run_test script uses pm2 to manage running the client and server applications.

To see logs, use pm2 logs (append beebop_server or beebop_client to show logs for one application only). To reload an application after making code changes, use pm2 reload beebop_server or pm2 reload beebop_client. To see fuller monitoring dashboard, use pm2 monit.

You can also run everything outside pm2, by separately running:

  • ./scripts/run_dev_dependencies
  • ./scripts/run_server
  • ./scripts/run_client

Note: If you wish to override the storage volume with a custom bind mount pass in -mount {MOUNT_NAME} into run_test script

Config

Config for the front-end lives in ./app/client/src/settings and by default webpack (via the vue-cli) will use the config defined in ./app/client/src/settings/development; this gets overriden by setting an env var called BUILD_TARGET - see ./proxy/Dockerfile.

Config for the back-end lives in ./app/server/src/resources. When deploying using a docker image this file has to be copied into the running container before the app will start - see ./app/server/docker/entrypoint.sh.

Deploying with docker

Docker images are built on CI using ./proxy/docker/build, ./app/server/docker/build. If you want to generate them from changed local sources you can run those same scripts locally to build images.

Generate the correct server config file with

    ./scripts/decrypt_config docker

Then run the dockerised app with

    ./scripts/run_docker

By default this will configure the nginx proxy for host localhost. To deploy with a different hostname, pass it as an argument, e.g.

    ./scripts/run_docker beebop.dide.ic.ac.uk

Bring down the app with

    ./scripts/stop_docker

Self-signed certificate

For testing it is useful to use a self-signed certificate. These are not in any way secure. There is a self-signed certificate in the repo for use in testing situations. It was generated by running (on metal):

./bin/self-signed-certificate ssl GB London "Imperial College" reside beebop.dide.ic.ac.uk

Auth will not work at this point unless there are configured oauth apps that match the deployed urls. In general the approach to getting secrets into the config could use some iteration and we should probably have a way to skip auth based on a config flag.

Example fasta files

can be found in the Knowledge Base article

Testing

Frontend tests

You can run unit tests for the vue app with

npm run test:unit

inside app/client/.

Backend tests

The backend can be tested in watch mode with

npm run test:dev

from app/server.

End-to-end tests

To run end-to-end test, the app must be started with ./scripts/run_test from the root of the repo.

You'll need to have the playwright dependencies installed. You can install them with

npx playwright install-deps

In a new terminal, these tests can be launched with

npx playwright test

from app/client-v2/. To close all components once ready, run ./scripts/stop_test from root.

Adding new species

  1. Add new database to mrcdata.
  2. Add new species to args.json in beebop_py

About

Frontend code for beebop

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published