This repository contains different ways of structuring the same shiny app.
The repository is organized into several directories, each demonstrating a different approach to structuring the same Shiny application:
- 01_simple_app/: A simple Shiny app to showcase all the key parts of the app.
- 02_single_file/: A shiny app with three KM plots which is created by just using a single
app.R
file. - 03_multiple_files/: The same app is created by sourcing multiple R files.
- 04_with_style/: Extending the same app with some custom styles instead of inlines CSS.
- 05_with_box/: Replacing the
source
calls with thebox
imports. - 06_with_box_and_modules/: Using shiny modules instead of having all the shiny logic in one place.
- 07_with_tests/: Adding some unit tests using the
testthat
package. - 08_golem/: Implementation of the same app using the
golem
framework. - 09_rhino/: Implementation of the same app using the
rhino
framework.
Please install these packages to run these apps locally:
install.packages(c("rhino", "golem", "tern", "nestcolor", "dplyr", "random.cdisc.data"), repos = "https://packagemanager.posit.co/cran/latest")
After cloning the repository you can run these R commands to run the app contained in a particular directory:
shiny::runApp("01_simple_app")
shiny::runApp("02_single_file")
shiny::runApp("03_multiple_files")
shiny::runApp("04_with_style")
shiny::runApp("05_with_box")
shiny::runApp("06_with_box_and_modules")
shiny::runApp("07_with_tests")
setwd("08_golem"); golem::run_den()
shiny::runApp("09_rhino")