BioDT
Prototype Digital Twins to help protect and restore biodiversity.
https://github.com/biodt/biodt-shiny
Category: Biosphere
Sub Category: Ecological and Environmental Modeling
Last synced: about 18 hours ago
JSON representation
Repository metadata
This repository contains a shiny application which is intended as the simplest way of interacting with BioDT by end-users.
- Host: GitHub
- URL: https://github.com/biodt/biodt-shiny
- Owner: BioDT
- License: other
- Created: 2023-03-08T12:23:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-17T18:53:53.000Z (11 days ago)
- Last Synced: 2025-06-19T10:06:56.094Z (9 days ago)
- Language: R
- Size: 277 MB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 19
- Releases: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
BioDT Web Application
Overview
This repository contains the codes for the Shiny web application hosted at app.biodt.eu. The Shiny app is intended as the simplest way of interacting with BioDT by end-users. The app uses Shiny framework on top of R language and is built using power of development framework Rhino.
Getting Started (development set up)
0. Prerequisites
On your local computer there have to be downloaded and installed these binaries and frameworks (ie. R packages):
- Git
- R language
- Shiny framework (see instructions below)
- Rhino development framework (see instructions below)
- You might also want to have Node.js installed due to utilization of the state of the art JavaScript and Sass development tools provided by Rhino
1. Get the code
Clone the repository:
git clone [email protected]:BioDT/biodt-shiny.git
Open the project directory in your preferred IDE, for example (RStudio or (VS Code)[https://code.visualstudio.com/download]).
2. Install required packages
Start by installing renv package.
install.packages("renv")
Then install all the dependencies by calling renv::restore()
command. All the dependencies are stored in the renv.lock
file.
renv::restore()
3. Setup local development, or production, environment
We utilize a common way for setting up your enviroment. There are two common options depending whether you want to run the app locally for development purposes (dev
), or in production environment (prod
), ie. for example dockerized app hosted at app.biodt.eu.
In the working directory you need to create your own .Renviron
file which is git ignored. You can easily do it by issuing the following command in your Bash (Zsh, etc) terminal
cp .Renviron.example .Renviron
Config env variable
In the file please config what enviroment you want the app run at. For development:
(...)
R_CONFIG_ACTIVE="dev"
(...)
For production delete the line R_CONFIG_ACTIVE="dev"
and uncomment this line which results in:
(...)
R_CONFIG_ACTIVE="prod"
(...)
Other environment variables, which aren't secrets (ie. git ignored) and are publicily avaible, can be seen and/or edit in the file config.yml
. At the time (May 2024) the file contains dummy variables, serving as an example only.
Config .Rprofile
We prefer to use PPM packages where possible and therefore it is advised to use following lines in the .Rprofile
file in the home directory of the project.
source("renv/activate.R")
options(repos = c(PPM = "https://packagemanager.posit.co/cran/latest"))
In case of Windows and MacOS environment You might want to add one more line after these two:
options(pkgType = "binary")
Note! You might probably want to restart (re-open) your R terminal at this moment and restart your R session.
4. Get local data
Download any required local data, first you need to create a folder to hold this data. This folder is ignored by git so you need to create it first. You can do this manually or run in R
dir.create("app/data")
Then download the data from the
sharepoint (authenticated access required)
Each pDT's shiny module has it's own folder for local data within this which you can see specififed in this file: https://github.com/BioDT/biodt-shiny/blob/main/dev/run_dev.R therefore you need to create a folder within the local_data
folder. The folder names are:
- Crop wild relatives:
app/data/cwr
- BEEHAVE:
app/data/honeybee
- Cultural ecosystem services:
app/data/ces
5. Launch the app
Now you should be ready to launch the app, which you can do using this command in your R terminal.
shiny::runApp()
Development
Please feel free to create a branch and pull requests for making significant changes to the Shiny app.
Modules
The app is modularized and each pDT have files in its own subfolder. UI files are located mainly in the app/view
subfolder, R function mainly in the app/logic
subfolder. UI files for each pDT is located:
- BEEHAVE:
app/view/honeybee
- Cultural Ecosystem Services:
TBD
- Crop wild relatives:
TBD
- GRASSLAND:
app/view/grassland
- Invasive alien species:
TBD
- RTBM (Real-time Bird Monitoring):
app/view/rtbm
Technicals
π Authentication and access to running models on LUMI/KAROLINA is enabled using R package {r4lexis} https://github.com/It4innovations/r4lexis the package is only available on GitHub.
π¨ We use {bslib} in order to use Bootstrap 5 elements (https://rstudio.github.io/bslib/). The theme is a custom BioDT theme. The css, favicons, backgrounds etc. are located in inst/app/www
.
β
Tests are developed using the {testthat} package. Tests are written as .R
files in tests/testthat/
.
π Maps are rendered using {leaflet}: https://rstudio.github.io/leaflet/.
Loading screens with {waiter}
If you have computations that take a long time then use the implemented waiter functionality. This will not make the app load faster but make it feel faster as it induces patience in your users and make the app feel slicker. To set this up in your module you can use waiter_text()
function to prepare text message with custom HTML format.
msg <-
waiter_text(message = tags$h3("Computing Beehave simulation...",
style = "color: #414f2f;"
))
Then create a waiter object
w <- Waiter$new(
html = msg[[1]],
color = "rgba(256,256,256,0.9)"
)
You can then use the following lines within your shiny code:
w$show()
to show a loading screenw$update()
to update message in the middle of computationw$hide()
to hide a loading screen
See https://waiter.john-coene.com/ for more info
Tutorials with {cicerone}
We use cicerone to create guided tours of your shiny module to help users understand how to use the app. See https://cicerone.john-coene.com/ for more info
Owner metadata
- Name: BioDT
- Login: BioDT
- Email:
- Kind: organization
- Description: Horizon EU Biodiversity Digital Twin
- Website: https://biodt.eu
- Location:
- Twitter: BiodiversityDT
- Company:
- Icon url: https://avatars.githubusercontent.com/u/106523593?v=4
- Repositories: 1
- Last ynced at: 2023-05-11T09:29:08.647Z
- Profile URL: https://github.com/BioDT
GitHub Events
Total
- Create event: 40
- Release event: 2
- Issues event: 48
- Watch event: 4
- Delete event: 10
- Member event: 3
- Issue comment event: 49
- Push event: 322
- Pull request review event: 3
- Pull request event: 78
- Fork event: 2
Last Year
- Create event: 40
- Release event: 2
- Issues event: 48
- Watch event: 4
- Delete event: 10
- Member event: 3
- Issue comment event: 49
- Push event: 322
- Pull request review event: 3
- Pull request event: 78
- Fork event: 2
Committers metadata
Last synced: 3 days ago
Total Commits: 855
Total Committers: 10
Avg Commits per committer: 85.5
Development Distribution Score (DDS): 0.636
Commits in past year: 565
Committers in past year: 10
Avg Commits per committer in past year: 56.5
Development Distribution Score (DDS) in past year: 0.646
Name | Commits | |
---|---|---|
Tomas Martinovic | t****c@v****z | 311 |
OndΕej Salamon | o****n@v****z | 278 |
Zhenggang Gao | z****a@k****e | 81 |
Kata Sara-aho | k****o@c****i | 81 |
Simon Rolph | s****l@c****k | 37 |
Souza Allan | a****u@l****i | 21 |
Tuomas Rossi | t****i@c****i | 17 |
Radek Halfar | h****8@v****z | 14 |
DylanCarbone | d****r@c****k | 11 |
julio.paneque | j****e@l****u | 4 |
Committer domains:
- vsb.cz: 3
- ceh.ac.uk: 2
- csc.fi: 2
- lifewatch.eu: 1
- lx2-870-27966.ad.helsinki.fi: 1
- kth.se: 1
Issue and Pull Request metadata
Last synced: 3 days ago
Total issues: 79
Total pull requests: 99
Average time to close issues: about 2 months
Average time to close pull requests: 3 days
Total issue authors: 5
Total pull request authors: 6
Average comments per issue: 1.06
Average comments per pull request: 0.22
Merged pull request: 97
Bot issues: 0
Bot pull requests: 0
Past year issues: 77
Past year pull requests: 99
Past year average time to close issues: about 2 months
Past year average time to close pull requests: 3 days
Past year issue authors: 5
Past year pull request authors: 6
Past year average comments per issue: 1.06
Past year average comments per pull request: 0.22
Past year merged pull request: 97
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- Nithador (39)
- csckata (18)
- simonrolph (10)
- osalamon (7)
- DylanCarbone (5)
Top Pull Request Authors
- osalamon (40)
- artyinfact (39)
- DylanCarbone (11)
- trossi (4)
- JulioLP (4)
- Nithador (1)
Top Issue Labels
- Cultural Ecosystem Services (31)
- enhancement (18)
- design (17)
- Grassland (10)
- Honeybee (9)
- bug (8)
- accessibility (7)
- documentation (1)
- priority1 (1)
- tests (1)
- priority0 (1)
- priority3 (1)
- feature (1)
- Wild Boar Diseases (1)
Top Pull Request Labels
- Grassland (3)
- feature (3)
Dependencies
- actions/checkout v4 composite
- actions/setup-node v3 composite
- cypress-io/github-action v6 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-renv v2 composite
- rocker/r-ver 4.3.3 build
Score: 5.598421958998375