User interface backend.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Before starting, download and install shiny.
Receives messages from: message-passer (install) ...
Sends messages to: message-passer (install) ...
(Recommended) Create an SSH key and clone this repository.
git clone [email protected]:consult/ui.git
(Alternative) Clone this repository using HTTPs, suppling username and password:
git clone https://github.kcl.ac.uk/consult/ui.git
View.
This is an shiny project. The majority of the logic is contained within app.R.
Once a file is edited, stage, commit and push changes from the root folder as follows:
git add .
git commit -m "[details of changes]"
git push
To run locally, a shiny server (service) is required, with the content of dashboard
loaded at the appropriate route (e.g. /srv/shiny-server/dashboard
).
Repository updates can be copied to a location like this using copy-shiny.sh.
Environment variables, which are populated during production by ShinyProxy and Docker, should be specified in the shiny server user's R environemnt variable file (.Renviron
):
MESSAGE_PASSER_PROTOCOL=[protocol]
MESSAGE_PASSER_URL=[url]
SHINYPROXY_USERNAME=[patient ID known to the message-passer]
Alternatively, dashboard
can be run from within R using runApp("dashboard")
.
Alternatively, the shiny application can be run as a standalone docker image. Uncomment the appropriate lines in docker-compose.yml, and then run:
docker-compose up dashboard
--
In production, login is handled by ShinyProxy, which operates by controlling access to a dockerised version of a Shiny application, which in this case is the CONSULT dashboard.
To dockerise the CONSULT dashboard run
./build-docker-image.sh
being sure to specify the host information of the message-passer in this file if necessary.
To build and run ShinyProxy so that it can serve a login page, and then subsequently run the dockerised version of the dashboard for each user, run docker-compose:
docker-compose build
docker-compose up -d
- Shiny - R + webserver
- ShinyProxy - Shiny authentiction
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
Produced as part of the CONSULT project.
This project is licensed under the MIT License - see the LICENSE.md file for details.