Sign inSign up

fraxplus/calculator

By fraxplus

•Updated 3 months ago

The FRAX® tool has been developed to evaluate fracture risk.

Image
Data science
0

2.2K

fraxplus/calculator repository overview

⁠FRAXplus® calculator

This is the docker image of the FRAXplus® application available at https://fraxplus.org⁠.
In order to run it, you'll need a valid licence.

⁠Prerequisites

⁠Running the image

Once Docker Desktop is running on your computer, open a command line and type this:

docker run -d -p 8085:8085 -v fraxplus:/app/data --name fraxplus fraxplus/calculator

That's it, the FRAX plus® calculator is now running locally on your computer.

The application is now reachable at http://localhost:8085⁠

⁠Licence activation

⁠Activate my product online

In order to activate the Docker version, you will need an active subscription.

  • After completing the installation guide⁠, navigate to the web interface (by default: http://localhost:8085).
  • A screen will invite you to Activate your product, click the Activate online button.
  • You will be redirected to fraxplus.org⁠ and invited to log in, if you are not already.
  • If a valid licence is found for your account, you are redirected back to your instance (by default: http://localhost:8085) where you can see that your product has been activated
⁠Activate my product offline

If you are denied to browse to fraxplus.org⁠ while activating your product, you can activate it manually with another device.

  • After completing the installation guide⁠, navigate to the web interface (by default: http://localhost:8085).
  • A screen will invite you to Activate your product, copy the Request code.
  • On another device with internet access, browse to fraxplus.org/my-account/manual-licence-activation⁠ to get your personal licence activation code.
  • Get back to your running container (by default: http://localhost:8085), enter your licence activation code and click the Activate manually button.
⁠Activate licence through CLI
  • Get the running container's licence status, and licence request code:
docker exec fraxplus node calculator.js --licence-status
docker exec fraxplus node calculator.js --licence-activate <activation code>
  • Stop and remove the container
docker stop fraxplus
docker rm fraxplus
  • Restart the container as described above, with the parameter you did have.
⁠Update my licence

If you need to see the status of your licence or apply a new one to your running container:

  • navigate to the web interface's /licence page (by default: http://localhost:8085/licence).
  • Click the Update licence button.

Alternatively, you can run again the Activate licence through CLI⁠ procedure.

⁠Going further

We strongly advise you to enforce TLS with an external proxy and your own certificates before going to production.

⁠Environment variables

NameDescription
FRAX_CALCULATOR_ALLOW_FRONTENDDefault: true. Set false to disable the web application's front-end. The application will only be reachable through the REST API.
FRAX_CALCULATOR_CLIENT_API_KEYIf provided, you can allow external clients to consume your instance's REST API.

⁠Enable the REST API

This application can be used by both

  • the embedded web application available at http://localhost:8085
  • the REST API described at http://localhost:8085/api-docs

To gain access to the API, clients must provide an API key that you should define when running the container.

Set FRAX_CALCULATOR_CLIENT_API_KEY to the key your clients should provide:

docker run \
  --detach \
  --publish 8085:8085 \
  --volume fraxplus:/app/data \
  --name fraxplus \
  --env FRAX_CALCULATOR_CLIENT_API_KEY=unicornsAreReal \
  fraxplus/calculator

Please replace the API_KEY with a new one

Clients will have to provide the key as an HTTP header x-api-key:

curl -X 'GET' \
  'http://localhost:8085/api/v1/licence' \
  -H 'accept: application/json' \
  -H 'x-api-key: dev'

⁠Update the docker image

  • Pull the latest docker image
docker pull fraxplus/calculator
  • Stop and remove the container
docker stop fraxplus
docker rm fraxplus
  • Start the container as described above, with the parameter you did have.

Tag summary

Content type

Image

Digest

sha256:a838198dc…

Size

82.1 MB

Last updated

3 months ago

docker pull fraxplus/calculator