Using this template: click Use this template on GitHub (or
npx degit samuelbharti/RShiny_template my-app), then runRscript dev/use_template.R --project_name="My App" --author="Your Name"to set your project name, author, and version. This block, the citation files, and the template machinery are removed automatically.
Add a short description of your application.
Maintained by Your Name.
Current app version: v2.3
- R (>= 4.3)
- RStudio (optional)
- Packages used by the app (managed with
renvrecommended)
install.packages(c(
"shiny",
"bslib",
"brand.yml"
))Optionally install thematic so plots
follow the app theme — global.R picks it up automatically when present.
The template ships without a lockfile. Bootstrap one for your project:
Rscript dev/init-renv.RThis initializes renv, installs the packages above, and writes renv.lock.
After that, use renv::restore() to restore the project library.
shiny::runApp()Or open the project in RStudio and click Run App.
docker build -t my-shiny-app .
docker run --rm -p 3838:3838 my-shiny-appThen open http://localhost:3838.
The Dockerfile restores the project library from renv.lock when present. Create one with Rscript dev/init-renv.R before building so the image installs your app's packages; without a lockfile the image relies on the packages bundled with the base image.
.
├── _brand.yml # Brand colors, fonts, logo (theming)
├── global.R # Libraries and global objects
├── ui.R # App UI definition
├── server.R # App server logic
├── template.yml # Template manifest (removed on init)
├── Dockerfile # Container build for deployment
├── R/ # Utility functions
├── modules/ # Reusable Shiny modules
├── userInterface/ # Page-level UI components
├── data/ # App data files
├── dev/ # Local development scripts
├── tests/ # testthat + shinytest2 tests
├── www/ # Static assets (css/js/img)
└── docs/ # Project documentationRecommended deployment paths:
- Posit Publisher or Posit Connect for direct app publishing
- Docker image deployment when you want a containerized release
CI/CD-driven publishing is not included here by default unless you explicitly add and maintain it for a given app.
Branding lives in _brand.yml — colors, fonts, and logo in one
place. It is applied automatically by bslib via bs_theme(brand = TRUE) in
ui.R. Edit _brand.yml to restyle the whole app; no other changes are
needed. To also theme plots and tables, install
thematic — global.R picks it up
automatically when present. See docs/theming.md.
See CONTRIBUTING.md for contribution guidelines.
Template developed by samuelbharti.
If you use this template or a derived project, please cite it. Machine-readable citation metadata is available in CITATION.cff, and a human-readable example is provided in CITATION.md.