Learn R Programming

{golem}

You’re reading the doc about version: 0.5.1. Note that {golem} follows the semantic versioning scheme.

Production-grade {shiny} applications, from creation to deployment.

{golem} is an opinionated framework that sets the standard for building production-grade {shiny} applications. It provides a structured environment that enforces best practices, fosters maintainability, and ensures your applications are reliable, and ready for deployment in real-world environments.

With {golem}, developers can focus on creating high-quality, robust {shiny} apps with confidence, knowing that the framework guides them through every step of the development process.

Installation

  • You can install the stable version from CRAN with:
install.packages("golem")
  • You can install the development version from GitHub with:
# install.packages("remotes")
remotes::install_github("Thinkr-open/golem") # Stable development version
# remotes::install_github("Thinkr-open/golem@dev") # Bleeding edge development version

Get Started

Create a new app with the project template from RStudio:

Or use the golem::create_golem() function:

golem::create_golem("myapp")

See your app in action by running golem::run_dev() function.

Then, follow the scripts at:

  • dev/01_start.R to configure your project at launch
  • dev/02_dev.R for day to day development
  • dev/03_deploy.R to build the deployment enabler for your app

Resources

The {golem} package is part of the {golemverse}, a series of tools for building production {shiny} apps.

A list of various {golem} related resources (tutorials, video, blog post,…) can be found here, along with blogposts, and links to other packages of the golemverse.


Dev part

This README has been compiled on the

Sys.time()
#> [1] "2024-08-27 09:39:59 UTC"

Here are the test & coverage results:

devtools::check(quiet = TRUE)
#> ℹ Loading golem
#> ── R CMD check results ──────────────────────────────────────── golem 0.5.1 ────
#> Duration: 44.8s
#> 
#> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔

Sys.setenv("NOT_CRAN" = TRUE);covr::package_coverage()
#> golem Coverage: 84.85%
#> R/boostrap_base.R: 0.00%
#> R/bootstrap_attachment.R: 0.00%
#> R/bootstrap_pkgload.R: 0.00%
#> R/bootstrap_roxygen2.R: 0.00%
#> R/bootstrap_rstudio_api.R: 0.00%
#> R/bootstrap_testthat.R: 0.00%
#> R/bootstrap_dockerfiler.R: 23.33%
#> R/bootstrap_usethis.R: 28.57%
#> R/test_helpers.R: 47.37%
#> R/bootstrap_desc.R: 55.56%
#> R/addins.R: 66.67%
#> R/modules_fn.R: 75.74%
#> R/after_creation_msg.R: 76.39%
#> R/create_golem.R: 77.12%
#> R/add_rstudio_files.R: 77.88%
#> R/install_dev_deps.R: 78.26%
#> R/add_r_files.R: 78.70%
#> R/config.R: 79.23%
#> R/use_files.R: 80.63%
#> R/reload.R: 84.69%
#> R/disable_autoload.R: 85.00%
#> R/add_dockerfiles.R: 87.10%
#> R/sanity_check.R: 87.18%
#> R/make_dev.R: 90.00%
#> R/use_favicon.R: 90.32%
#> R/add_dockerfiles_renv.R: 91.95%
#> R/add_files.R: 93.14%
#> R/golem-yaml-get.R: 93.18%
#> R/js.R: 93.75%
#> R/run_dev.R: 95.65%
#> R/desc.R: 96.77%
#> R/use_recommended.R: 97.37%
#> R/use_utils.R: 97.40%
#> R/utils.R: 99.19%
#> R/add_resource_path.R: 100.00%
#> R/boostrap_cli.R: 100.00%
#> R/boostrap_crayon.R: 100.00%
#> R/boostrap_fs.R: 100.00%
#> R/browser_button.R: 100.00%
#> R/bundle_resources.R: 100.00%
#> R/cats.R: 100.00%
#> R/enable_roxygenize.R: 100.00%
#> R/get_sysreqs.R: 100.00%
#> R/globals.R: 100.00%
#> R/golem_welcome_page.R: 100.00%
#> R/golem-yaml-set.R: 100.00%
#> R/golem-yaml-utils.R: 100.00%
#> R/is_golem.R: 100.00%
#> R/is_running.R: 100.00%
#> R/maintenance_page.R: 100.00%
#> R/pkg_tools.R: 100.00%
#> R/set_golem_options.R: 100.00%
#> R/templates.R: 100.00%
#> R/use_readme.R: 100.00%
#> R/with_opt.R: 100.00%

CoC

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Note for the contributors

Please style the files according to grkstyle::grk_style_transformer()

# If you work in RStudio
options(styler.addins_style_transformer = "grkstyle::grk_style_transformer()")

# If you work in VSCode
options(languageserver.formatting_style = function(options) {
  grkstyle::grk_style_transformer()
})

Copy Link

Version

Install

install.packages('golem')

Monthly Downloads

6,882

Version

0.5.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Colin FAY

Last Published

August 27th, 2024

Functions in golem (0.5.1)

get_current_config

Return path to the {golem} config-file
use_favicon

Add a favicon to your shinyapp
activate_js

Interact with JavaScript built-in Functions
add_dockerfile

Create a Dockerfile for your App
maintenance_page

maintenance_page
document_and_reload

Document and reload your package
get_sysreqs

Get system requirements (Deprecated)
cat_dev

Functions already made dev dependent
golem

A package for building Shiny App
add_fct

Add fct_ and utils_ files
is_running

Is the running app a golem app?
is_golem

Is the directory a golem-based app?
module_template

Golem Module Template Function
install_dev_deps

Install {golem} dev dependencies
golem_welcome_page

Welcome Page
app_prod

Is the app in dev mode or prod mode?
get_golem_wd

{golem} options
pkg_name

Package tools
use_module_test

Add a test file for a module
expect_shinytag

Test helpers
use_external_js_file

Use Files
use_readme_rmd

Generate a README.Rmd
make_dev

Make a function dependent to dev mode
js_handler_template

Golem's default custom templates
use_utils_ui

Use the utils files
sanity_check

Sanity check for R files in the project
use_recommended_deps

Add recommended elements
run_dev

Run the dev/run_dev.R file
with_golem_options

Add Golem options to a Shiny App
add_positconnect_file

Add an app.R at the root of your package to deploy on RStudio Connect
project_hook

Project Hook
detach_all_attached

Detach all attached package
add_module

Create a module
browser_button

Insert an hidden browser button
addins

{golem} addins
add_resource_path

Add resource path
create_golem

Create a package for a Shiny App using {golem}
amend_golem_config

Amend golem config file
disable_autoload

Disabling Shiny Autoload of R Scripts
add_js_file

Create Files
bundle_resources

Automatically serve golem external resources
get_golem_options

Get all or one golem options
fill_desc

Fill your DESCRIPTION file