During the early pandemic there was a lack of COVID-19 related dashboards that unified German COVID-19 datasources. As such, this dashboard uses data from the German Interdisciplinary Association for Intensive Care and Emergency Medicine (DIVI) and the Robert Koch Institute (RKI).
This dashboard is available at shiny.bawki.de/covid
- JSON API with real time hospital data from
https://www.intensivregister.de/api/public/intensivregister
- Daily DIVI report as csv from
https://diviexchange.blob.core.windows.net/%24web/DIVI_Intensivregister_Auszug_pro_Landkreis.csv
- RKI report from
https://www.arcgis.com/sharing/rest/content/items/f10774f1c63e40168479a1feb6c7ca74/data
- Historical RKI data from the arcgis REST API
https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/rki_history_hubv/FeatureServer/0/query
- Download this repository
git clone git@github.com:bogie/divi-dashboard.git
- Generate a Mapbox Token from mapbox.com and save to
app/mapBoxToken
- Build the docker image, make sure to substitute
<image name>
with your desired name for the image, I personally usebawki/divi-dashboard
sudo docker build -t <image name> .
This dashboard uses a cron service to download new data at
- 04:00 GMT+1 from RKI sources
- 14:00 GMT+1 from DIVI sources
These times are chosen, because new data will be made available at ~ 03:00 and 11:30 GMT+1 respectively, sometimes uploads will be 1-2 hours delayed, therefore I use a generous buffer.
In order for data updates to work, you will need to setup a data folder on your device, which will be mounted/bound by the docker container.
- Create the data directories
mkdir -p /srv/shiny/dashboard/data/rawData
mkdir -p /srv/shiny/dashboard/data/json_data
mkdir -p /srv/shiny/dashboard/data/rkiData
- Copy or link the update scripts from the git folder
cd /srv/shiny/dashboard/
ln -s /path/to/app/updateRKI.R
ln -s /path/to/app/updateDIVIdata.R
- make sure the folders are owned by the user, which will run the R scripts and has read/write access to the data folder
- create cron jobs, run
crontab -e
as the aforementioned user
# Optional, to get notified each time any of the jobs are running
MAILTO=your@email.tld
0 14 * * * cd /srv/shiny/dashboard/data && Rscript updateDIVIdata.R
0 4 * * * cd /srv/shiny/dashboard/data && Rscript updateRKI.R
This docker image is used in conjunction with shinyproxy.io, make sure you have a working instance and use the following entry in your application.yml
.
specs:
- id: dashboard
display-name: divi dashboard
description: Dashboard of RKI and DIVI data
container-cmd: ["R","-e","shiny::runApp('/root/diviDashboard')"]
container-image: <image name>
container-volumes: ["/srv/shiny/dashboard/data:/root/diviDashboard/data"]
user: "<UID>:<GID>"
max-lifetime: -1
heartbeat-timeout: -1
Make sure you substitute <UID>
and <GID>
as the data user ids, and <image name>
with the build name you used earlier to build the docker image.