Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ inst/doc
*.sqlite
/pkgdown/
/test_data/
*.rds
*.rds
rsconnect/
31 changes: 30 additions & 1 deletion app.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,40 @@ options( "golem.app.prod" = TRUE)
# update manifest file
# if absolute path is needed for renv profile
# Sys.setenv(RENV_PROFILE = "full")
# Sys.setenv(RENV_PROFILE = "minimal")
# Install {clinsight}
# remotes::install_github(
# "openpharma/clinsight",
# ref = "dev",
# force = TRUE
# )
# packageVersion("clinsight")
# renv::snapshot()
# renv::paths$lockfile() # test
# assignInNamespace(
# "renvLockFile",
# \(...) renv::paths$lockfile(),
# "rsconnect"
# )
# rsconnect::writeManifest() # run if needed
clinsight::run_app() # add parameters here (if any)
# clinsight::run_app() # add parameters here (if any)

# Run the application
load_and_run_app <- function(){
app_data_folder <- "./app/"
if(!dir.exists(app_data_folder)) dir.create(app_data_folder)
old_golem_config <- Sys.getenv("GOLEM_CONFIG_ACTIVE")
Sys.setenv("GOLEM_CONFIG_ACTIVE" = "dev")

clinsight::run_app(
data_folder = app_data_folder,
onStart = \(){
onStop(\(){
# unlink(temp_folder, recursive = TRUE);
Sys.setenv("GOLEM_CONFIG_ACTIVE" = old_golem_config)
}
)}
)
}

load_and_run_app()
1 change: 1 addition & 0 deletions clinsight.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 587215bb-819c-4942-a6c8-4b99d218e8ea

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
4 changes: 4 additions & 0 deletions dev/02_dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ clinsightful_data |>
## install.package('attachment') # if needed.
#attachment::att_amend_desc()

## Add packages ----
# usethis::use_package("")
remotes::instal

## Add modules ----
## Create a module infrastructure in R/
golem::add_module(name = "name_of_module1", with_test = TRUE) # Name of the module
Expand Down
12 changes: 9 additions & 3 deletions dev/03_deploy.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@
## sent to CRAN, or to a package manager
#pkgbuild::build()

# ignore certain packages in the 'minimal' renv environment:
renv::settings$ignored.packages(c("pak", "pkgdown", "stringr", "kableExtra", "usethis", "cowplot"))
renv::activate(profile = "full")
# renv::activate(profile = "full")
# Use this to create a production-ready Docker image, with minimal number of dependencies:
renv::activate(profile = "minimal")

# ignore certain packages in the 'minimal' renv environment:
renv::settings$ignored.packages(
c("clinsight","pak", "pkgdown", "kableExtra", "usethis", "cowplot"))
utils::install.packages("pkgload")
renv::snapshot()
# renv::install("pkgload")

## RStudio ----
## If you want to deploy on RStudio related platforms
golem::add_rstudioconnect_file()
Expand Down
Binary file added inst/app/www/logo_in_app_no_margin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/app/www/logo_in_app_w_margin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6,073 changes: 6,073 additions & 0 deletions renv.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions renv/profiles/deploy_minimal/renv/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"pkgdown",
"kableExtra",
"usethis",
"cowplot",
"shinymanager"
"cowplot"
],
"package.dependency.fields": [
"Imports",
Expand Down
Loading