Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 02-planning-ahead.Rmd #306

Open
wants to merge 619 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
619 commits
Select commit Hold shift + click to select a range
4ed6ac8
cervan bio
ColinFay Apr 30, 2020
0ccb942
img and datasets
ColinFay Apr 30, 2020
04ec340
Merge pull request #155 from aronolof/master
ColinFay Apr 30, 2020
d461d9c
fixed broken link in the README
ColinFay Apr 30, 2020
f6b2882
close #149
ColinFay Apr 30, 2020
6a58d09
rm crayon options and swtiched to GA options
ColinFay Apr 30, 2020
ad47e14
Merge pull request #156 from ThinkR-open/wip
ColinFay Apr 30, 2020
458b6f4
testing spelling job
ColinFay Apr 30, 2020
814231e
series of updates after re-reading
ColinFay May 1, 2020
26d1e16
Merge branch 'master' into wip
ColinFay May 1, 2020
245245f
Merge pull request #163 from ThinkR-open/wip
ColinFay May 1, 2020
b8332a6
Delete EVpFT51WoAQalHl.jpeg
ColinFay May 1, 2020
5c2cd68
last re-reading, sent for technical review
ColinFay May 1, 2020
9afb313
Merge branch 'master' into wip
ColinFay May 1, 2020
16cca6a
Merge pull request #164 from ThinkR-open/wip
ColinFay May 1, 2020
d48eef0
chunck renaming + trying action on wip only
ColinFay May 1, 2020
64ed271
Merge branch 'wip' of https://github.com/ThinkR-open/building-shiny-a…
ColinFay May 1, 2020
a91297a
new workflows
ColinFay May 1, 2020
e684675
Merge pull request #165 from ThinkR-open/wip
ColinFay May 1, 2020
851990c
trying to cache package
ColinFay May 1, 2020
0a0292e
Merge pull request #167 from ThinkR-open/wip
ColinFay May 1, 2020
99aed5d
indentation
ColinFay May 1, 2020
dd697ae
small corrections in chapter 1
etiennebacher May 2, 2020
d12bef2
added quote
ColinFay May 4, 2020
1bf05f5
test deploy wip
ColinFay May 4, 2020
4f382e3
_book/wip in GA yaml
ColinFay May 4, 2020
4a2682c
test wip artifact
ColinFay May 4, 2020
5f9bdcb
render book in "_book/wip"
ColinFay May 4, 2020
4e59b74
correction in artifact name
ColinFay May 4, 2020
1ddbbca
Merge pull request #170 from ThinkR-open/wip
ColinFay May 4, 2020
fe97c43
restore yaml
ColinFay May 4, 2020
0701121
Correct arguments of shinyApp() function
FrieseWoudloper May 5, 2020
1cf3e7b
Merge pull request #173 from FrieseWoudloper/master
ColinFay May 5, 2020
5fca1e6
Merge pull request #169 from etiennebacher/patch-2
ColinFay May 7, 2020
06915d9
Added some example of extracting lighthouse results
ColinFay May 7, 2020
edccbec
Small paragraph about how to chose a DB backend
ColinFay May 7, 2020
7db32b1
added content about deployment
ColinFay May 7, 2020
a5ade1e
manual bib
ColinFay May 7, 2020
4e7138c
Rename chunks
ColinFay May 7, 2020
b0374e7
typo on bib name
ColinFay May 8, 2020
d046c8b
More content on workflow
ColinFay May 8, 2020
d46c364
small typos and rephrasing
ColinFay May 8, 2020
ec2b92c
content about minification
ColinFay May 8, 2020
42c7752
Consistency on RStudio, GitHub and GitLab names.
jcrodriguez1989 May 10, 2020
f1b5baa
Chapter 01 suggestions.
jcrodriguez1989 May 10, 2020
78b4723
Chapter 02 suggestions.
jcrodriguez1989 May 10, 2020
01ff115
Chapter 03 suggestions, plus pkg quote for {golem}.
jcrodriguez1989 May 10, 2020
1d9d4a6
Chapter 04 suggestions.
jcrodriguez1989 May 10, 2020
41832e0
Chapter 05 suggestions.
jcrodriguez1989 May 10, 2020
c3dfaa4
POC ~> PoC.
jcrodriguez1989 May 10, 2020
663b0f0
change to chromote installation
ColinFay May 11, 2020
3511186
minifyr is no longer called
ColinFay May 11, 2020
07777b1
Doing API calls from JavaScript
ColinFay May 11, 2020
e64846b
chunk renaming
ColinFay May 11, 2020
e575e23
Merge pull request #176 from jcrodriguez1989/names_consistency
ColinFay May 12, 2020
c9ba314
Merge branch 'master' into chapter_1_suggestions
ColinFay May 12, 2020
daa8373
Merge pull request #177 from jcrodriguez1989/chapter_1_suggestions
ColinFay May 12, 2020
5e4e638
Added some example of extracting lighthouse results
ColinFay May 7, 2020
fccda28
Small paragraph about how to chose a DB backend
ColinFay May 7, 2020
565f2b7
added content about deployment
ColinFay May 7, 2020
3ed7dd8
manual bib
ColinFay May 7, 2020
599a04d
Rename chunks
ColinFay May 7, 2020
9b956f2
typo on bib name
ColinFay May 8, 2020
d4c562c
More content on workflow
ColinFay May 8, 2020
4104b2f
small typos and rephrasing
ColinFay May 8, 2020
fdfff1d
content about minification
ColinFay May 8, 2020
2a3fd6a
change to chromote installation
ColinFay May 11, 2020
052b831
minifyr is no longer called
ColinFay May 11, 2020
7f3e9a5
Doing API calls from JavaScript
ColinFay May 11, 2020
d96e44c
chunk renaming
ColinFay May 11, 2020
3780018
wip
ColinFay May 12, 2020
7e5c820
Merge branch 'wip' of https://github.com/ThinkR-open/building-shiny-a…
ColinFay May 12, 2020
360379e
chromote removed
ColinFay May 12, 2020
7051272
Merge pull request #179 from ThinkR-open/wip
ColinFay May 12, 2020
c311751
Chapter 06 suggestions.
jcrodriguez1989 May 13, 2020
3eaf842
Chapter 07 suggestions.
jcrodriguez1989 May 13, 2020
2f091e8
Chapter 08 suggestions.
jcrodriguez1989 May 13, 2020
15abdf6
typo.
jcrodriguez1989 May 13, 2020
fbfa876
Chapter 07 suggestions.
jcrodriguez1989 May 13, 2020
757c1f4
Chapter 08 suggestions.
jcrodriguez1989 May 13, 2020
b922feb
Chapter 09 suggestions.
jcrodriguez1989 May 13, 2020
aa1aa7f
Chapter 10 suggestions.
jcrodriguez1989 May 13, 2020
2d3a410
Chapter 11 suggestions.
jcrodriguez1989 May 13, 2020
1c340be
some corrections for part 4
etiennebacher May 18, 2020
3411e19
Merge pull request #181 from jcrodriguez1989/part_2_suggestions
ColinFay May 19, 2020
130e773
Merge pull request #182 from jcrodriguez1989/part_3_suggestions
ColinFay May 19, 2020
8ecf864
Merge pull request #186 from etiennebacher/patch-3
ColinFay May 19, 2020
889468b
Merge branch 'master' into part_4_suggestions
jcrodriguez1989 May 23, 2020
10ce96a
Suggests for Chapter 12
jcrodriguez1989 May 23, 2020
82a047d
Suggests for Chapter 13
jcrodriguez1989 May 23, 2020
203bdb0
Suggests for Chapter 14
jcrodriguez1989 May 23, 2020
809d827
Some more suggests
jcrodriguez1989 May 23, 2020
029a61b
Some more suggests
jcrodriguez1989 May 23, 2020
50a296d
Suggests for Chapter 15
jcrodriguez1989 May 23, 2020
f229eb1
Suggests for Chapter 16
jcrodriguez1989 May 23, 2020
8612d7d
Suggests for Chapter 17
jcrodriguez1989 May 23, 2020
c094c5e
Suggests for Chapter 18
jcrodriguez1989 May 23, 2020
db19136
Some more suggests
jcrodriguez1989 May 23, 2020
1c3d99b
Some more suggests
jcrodriguez1989 May 23, 2020
322945e
Correct grammar mistakes and fluency
naomistrandberg May 25, 2020
c2d9de8
fix typo
sowla Jun 6, 2020
c44cf35
fix typo
sowla Jun 6, 2020
b7d5774
add missing link
sowla Jun 7, 2020
31c3f16
Merge pull request #196 from sowla/patch-2
ColinFay Jun 10, 2020
51d952b
Merge pull request #195 from sowla/patch-1
ColinFay Jun 10, 2020
0648ba7
install from github
ColinFay Jun 10, 2020
195e0c8
fix typos chapter 6
BenjaminLouis Jun 23, 2020
51a20ab
fix typo chapter 7
BenjaminLouis Jun 23, 2020
0ec0258
fix typo chapter 11
BenjaminLouis Jun 23, 2020
e3aea87
fix typo chapter 12
BenjaminLouis Jun 23, 2020
2576b92
fix typo chapter 13
BenjaminLouis Jun 23, 2020
3ac71dd
fix typo chapter 14
BenjaminLouis Jun 23, 2020
a92fdd7
fix wrong h5 title
BenjaminLouis Jun 23, 2020
178226c
add forgotten "
BenjaminLouis Jun 23, 2020
6d68858
Fixed some typos in Cchapter 1
davidpb90 Jun 24, 2020
30c3b3d
Fix minor code typo
Jul 4, 2020
677e502
Merge pull request #188 from jcrodriguez1989/part_4_suggestions
ColinFay Jul 6, 2020
16fb810
Merge pull request #189 from jcrodriguez1989/part_5_suggestions
ColinFay Jul 6, 2020
83b39da
Merge pull request #190 from jcrodriguez1989/part_6_suggestions
ColinFay Jul 6, 2020
5bba3d6
Merge pull request #191 from jcrodriguez1989/part_7_suggestions
ColinFay Jul 6, 2020
6c30242
Merge pull request #193 from naomistrandberg/patch-2
ColinFay Jul 6, 2020
1112369
Merge branch 'master' into spotted-typos
ColinFay Jul 6, 2020
339cbeb
Merge pull request #201 from BenjaminLouis/spotted-typos
ColinFay Jul 6, 2020
85f70ca
Merge pull request #202 from davidpb90/chapter-1
ColinFay Jul 6, 2020
384bc83
Merge pull request #205 from jamespooley/patch-1
ColinFay Jul 6, 2020
4079df5
rstudio/websocket
ColinFay Jul 6, 2020
a764e37
Minor proofreading
julianstanley Jul 7, 2020
d9964a6
Merge pull request #208 from julianstanley/julian-patch-proof18
ColinFay Jul 7, 2020
28dcad1
Book update after feedback
ColinFay Oct 1, 2020
f8168e6
rename chunks
ColinFay Oct 1, 2020
896eeae
safe file deletion
ColinFay Oct 2, 2020
27584be
use RSPM public repo
ColinFay Oct 2, 2020
276e18d
added app examples
ColinFay Oct 2, 2020
88d6b0d
upload cache
ColinFay Oct 2, 2020
7676cd1
better naming
ColinFay Oct 2, 2020
09ba1e1
eval = true
ColinFay Oct 2, 2020
2989156
eval = TRUE
ColinFay Oct 2, 2020
af376d7
link update
ColinFay Oct 5, 2020
9045a00
ref and reformating
ColinFay Oct 5, 2020
8eca114
pdf book
ColinFay Oct 5, 2020
11f846c
width option
ColinFay Oct 6, 2020
ce20d6b
correct name for tibble
ColinFay Oct 6, 2020
318018e
Added {tufte}
ColinFay Oct 6, 2020
55262ab
Delete preamble.tex
ColinFay Nov 17, 2020
68b4a4c
added steps to appendix
ColinFay Nov 18, 2020
1673269
Merge branch 'master' of https://github.com/ThinkR-open/building-shin…
ColinFay Nov 18, 2020
727e054
Correct ref
ColinFay Nov 18, 2020
ecf2aa4
all links are open in a new tab
ColinFay Nov 18, 2020
1188f47
typos and rephrasing
ColinFay Nov 18, 2020
e650267
strict version of packages
ColinFay Nov 18, 2020
dfcbecc
colors
ColinFay Nov 18, 2020
77285fd
with renv
ColinFay Nov 19, 2020
53107b8
renv add
ColinFay Nov 19, 2020
1cf382a
prep.R
ColinFay Nov 19, 2020
7e995a4
Update chunks
ColinFay Nov 20, 2020
dec5cf9
reformating because why not
ColinFay Nov 20, 2020
c007cf8
blankgolem
ColinFay Nov 23, 2020
5e84704
quote reformating
ColinFay Nov 23, 2020
45d9d83
container
ColinFay Nov 23, 2020
fd82a50
try
ColinFay Nov 23, 2020
ecde519
colored pdf
ColinFay Nov 24, 2020
6f5da50
last reformating
ColinFay Nov 24, 2020
ff128fb
dev bench
ColinFay Nov 24, 2020
c87e621
update of bench
ColinFay Nov 24, 2020
6570b27
`{shiny}`
ColinFay Nov 26, 2020
846965d
`{shiny}`
ColinFay Nov 26, 2020
71fb1fd
{shiny}
ColinFay Nov 26, 2020
ccc3e8b
ref correction
ColinFay Nov 26, 2020
4d61d4a
ize
ColinFay Nov 26, 2020
5f57d4d
updated
ColinFay Nov 26, 2020
e94c28e
updates
ColinFay Nov 26, 2020
1c9662f
abstracts
ColinFay Nov 27, 2020
8d640e7
test redirect
ColinFay Jan 29, 2021
03bf176
adding redirect
ColinFay Feb 4, 2021
39520ec
tried with renaming to _site
ColinFay Feb 4, 2021
dd71d86
tried with the new Cecilapp/GitHub-Pages-deploy@v3
ColinFay Feb 4, 2021
a621f61
correct redirect
ColinFay Feb 4, 2021
4bef810
true redirect
ColinFay Feb 4, 2021
5bf5ddb
redirects
ColinFay Feb 5, 2021
5058495
new redirects
ColinFay Feb 24, 2021
91b6b6a
trying with - uses: nanasess/setup-chromedriver@master
ColinFay Mar 10, 2021
cc103dd
new redirect test
ColinFay Mar 10, 2021
c37546b
Fix #278 regarding stratégie du petit r example
josePliego Mar 24, 2021
85b331a
Merge pull request #281 from josbop/petit_r
ColinFay Apr 2, 2021
46c4d0d
Index.Rmd pr
ColinFay Apr 21, 2021
6d88910
PR 00
ColinFay Apr 21, 2021
aec84f6
PR chapt 1
ColinFay Apr 21, 2021
c21bd85
PR chap 02
ColinFay Apr 22, 2021
ec57ea5
PR chapt 03
ColinFay Apr 22, 2021
966b589
PR chapt 04
ColinFay Apr 22, 2021
69e1835
PR chapt 05
ColinFay Apr 22, 2021
6ad10f2
Image golemconfigactive
ColinFay Apr 22, 2021
bcadb66
PR chpt 06
ColinFay Apr 23, 2021
5e38a13
PR chapt 07
ColinFay Apr 23, 2021
23f4cdf
PR chapt 8
ColinFay Apr 26, 2021
74fdefd
PR chapt 09
ColinFay Apr 26, 2021
8522f81
PR chap 10
ColinFay Apr 26, 2021
6057ca8
PR Chapt 11
ColinFay Apr 27, 2021
d095166
PR chapt 12
ColinFay Apr 27, 2021
1c73cec
PR chapt 13
ColinFay Apr 27, 2021
507255c
PR chapt 14
ColinFay Apr 27, 2021
44f2c54
Pr chapt 15
ColinFay Apr 28, 2021
9eb71bf
PR chapt 16
ColinFay Apr 29, 2021
fccb1f3
PR chapt 17
ColinFay Apr 29, 2021
dec3bdf
PR chapt 18
ColinFay Apr 29, 2021
fd8919e
PR appendix
ColinFay Apr 29, 2021
1d83d65
“an handler” should be changed to “a handler” throughout the book.
ColinFay May 3, 2021
8945ff5
“an header” should be changed to “a header” throughout the book.
ColinFay May 3, 2021
de39555
Both “web page(s)” and “webpage(s)” are used in the book.
ColinFay May 3, 2021
ff5a7d8
Replace “can not” with “cannot” throughout the book.
ColinFay May 3, 2021
fb4aa18
The proper rendering of this abbreviation is “i.e.
ColinFay May 3, 2021
27697f8
The usage of “code base” is inconsistent.
ColinFay May 3, 2021
4d715ab
Capitalize “chapter” when followed by a number
ColinFay May 3, 2021
03f83e2
“Git” is the proper name of a piece of software and should thus be ca…
ColinFay May 3, 2021
7210471
Add a period at the end of all figure captions where missing.
ColinFay May 3, 2021
7662bd3
Restructure footnotes
ColinFay May 10, 2021
cf205e9
em dash
ColinFay May 11, 2021
c0a0886
Footnote numbers should appear after punctuation and without extra sp…
ColinFay May 11, 2021
f716e29
Footnote numbers should appear after punctuation and without extra sp…
ColinFay May 11, 2021
af312e2
expand acronyms
ColinFay May 11, 2021
f03fd1c
all figures are to be called out in text
ColinFay May 11, 2021
697cf3d
Added a biblio
ColinFay May 11, 2021
449b4a0
Merge pull request #288 from ThinkR-open/rc_pe
ColinFay May 25, 2021
133f68d
new pages
ColinFay Jun 4, 2021
206cf0d
no tictoc
ColinFay Jun 4, 2021
a6084e1
Merge branch 'master' into rc_pe
ColinFay Jun 4, 2021
9f8ddaa
Merge pull request #292 from ThinkR-open/rc_pe
ColinFay Jun 4, 2021
6cfc0a8
r-version: '3.6.1'
ColinFay Jun 4, 2021
4673ef7
Added license, close #13
ColinFay Jul 15, 2021
fd96a53
Merge pull request #295 from ThinkR-open/issue-13
ColinFay Jul 15, 2021
b0acc9e
Capitalization
ColinFay Jul 15, 2021
825170e
lighthouse & dash
ColinFay Jul 15, 2021
25b2126
capitalization
ColinFay Jul 15, 2021
d629bf1
Some rephrasing
ColinFay Jul 15, 2021
6921139
removed capital
ColinFay Jul 15, 2021
c0a0091
rephrasing
ColinFay Jul 15, 2021
e8d2a4d
renv.lock changes and I don't know why
ColinFay Jul 15, 2021
11c6cf8
Correct font for Git
ColinFay Jul 15, 2021
cf728ba
typo
ColinFay Jul 15, 2021
81fba13
Typos, capitalisation and hyphens
ColinFay Jul 15, 2021
c46b2f4
Correct thanks
ColinFay Jul 15, 2021
5fef628
cache and data update
ColinFay Jul 16, 2021
3965cc9
bib
ColinFay Jul 16, 2021
11ade91
code chunk checks
ColinFay Jul 16, 2021
6410e89
added bank
ColinFay Jul 16, 2021
c9c20f6
Delete comments
ColinFay Jul 19, 2021
7c1ee03
Delete shinyminifed.css
ColinFay Jul 19, 2021
0c49230
Delete shinyloadtest_report.html
ColinFay Jul 19, 2021
ac5eda7
Delete pdfbuilder.R
ColinFay Jul 19, 2021
1bb1d66
Update 02-planning-ahead.Rmd
Taborski Sep 16, 2021
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
Prev Previous commit
Next Next commit
added content about deployment
  • Loading branch information
ColinFay committed May 12, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 565f2b7662f5cb2e1123438613a9a36235f18ee5
49 changes: 44 additions & 5 deletions 14-deploy-with-golem.Rmd
Original file line number Diff line number Diff line change
@@ -13,10 +13,12 @@ We will see in this part how you can do that using `{golem}` [@R-golem].

## Before deployment Check-list

Here is a quick checklist of things to think about once your application is read, and before sending it to production
Here is a quick checklist of things to think about once your application is ready, and before sending it to production

+ [ ] `devtools::check()`, run from the command line, returns 0 errors, 0 warnings, 0 notes

+ [ ] The current version number is valid, _i.e_ if the current app is an update, the version number has been bumped

+ [ ] Everything is fully documented

+ [ ] Test coverage is good
@@ -41,17 +43,21 @@ Here is a quick checklist of things to think about once your application is read

### Install on your machine

A Shiny application built with golem is __by definition__ created as an R package.
A Shiny application built with `{golem}` [@R-golem] is __by definition__ an R package.
This Shiny App as a Package is also helpful when it comes to deploying your application: packages are designed to be shareable pieces of R code.

So before sending it to a remote server or sharing it to the world, the first step is testing if the package can be installed on your own computer.
To do that, when you are in the project corresponding to the golem you built, you can call `remotes::install_local()` to install the application on your computer.
Of course, if you are somewhere else on your machine, you can call `remotes::install_local("path/to/app")`.
If you are using the RStudio IDE, you can also click on the `Build` tab, then click on the `Install and Restart` button.

This should restart your R session, and call `library(yourpackagename)`.
Then, try the `run_app()` function to check that the app can be launched.

### Share as built package

#### Local build

Building an app as a package also means that this app can be bundled into an archive, and then shared, either as is or using a package repository like the CRAN.

To do that, you first need an bundled version of your app, which can be created using the `build()` function from `{pkgbuild}` [@R-pkgbuild] in the same working directory as your application.
@@ -62,11 +68,38 @@ You can also share the file as is with others.
If you do so, they will have to install the app with `remotes::install_local("path/to/tar.gz")`, that will take care of doing a full installation of the app, including installing the required dependencies.
Then, they can do `library(yourpackagename)` and `run_app()` on their machine.

#### Send to a package repository

The upside of building the application `{golem}`, _i.e_ as a package, is that you can share your application on a remote package manager, the more widely used for example on the CRAN like `{dccvalidator}` [@R-dccvalidator], or on BioConductor like `{spatialLIBD}` [@R-spatialLIBD].
But any other package manager will work: for example if the company uses RStudio Package Manager, your application can be installed here as any other package.
If your application is open-source, the package structure also allows to install from GitHub, by using the `remotes::install_github()` function
^[This is also true for any other Version Control system].
For example, this is what you can do with `{hexmake}`, or `{tidytuesday}`: as they are open-source packages, they can be installed from GitHub.
Then, once your application is installed as a package on the users' machines, they can do `library(yourpackagename)` and `run_app()`.

The advantage of this solution being that R users are familiar with package installation, so it makes using your application easier for them.
Also, and we will see it in the next section, but making your application available as a standard R package makes it easier to deploy it: for example if your RStudio Connect is coupled with your RStudio Package Manager, the deployment file just have to contain one line launching the application.

Note that releasing to CRAN or BioConductor requires extra effort: you have to comply to a series of rules.
But good news: as you have been following the best practices from this book, you should not have to put that much extra efforts!

Know more about releasing on CRAN:

+ [Checklist for CRAN submissions](https://cran.r-project.org/web/packages/submission_checklist.html)
+ [CRAN Repository Policy](https://cran.r-project.org/web/packages/policies.html)
+ [R packages - Chapter 18 Releasing a package](https://r-pkgs.org/release.html)
+ [Getting your R package on CRAN](https://kbroman.org/pkg_primer/pages/cran.html)
+ [prepare-for-cran - A Collaborative list of things to know before submitting to CRAN](https://github.com/ThinkR-open/prepare-for-cran)

## Deploying Apps with `{golem}`

The other way to make your application available to others is by sending it to a remote server that can serve Shiny applications.
When using `{golem}`, you can open the `dev/03_deploy.R` and find the functions for server deployment.
In other words, instead of having to install the application on their machines, they can crack open a web browser and navigate to the URL where the application is deployed.
Deploying to a server is the solution of choice when you want to make your application available to a wide public: on a server, visitors do not have to have R installed on their computer, they do not have to install a package or launch it, they can just browse the application like any other web application.
This solution is also a common choice in companies that have strict security requirements: the IT team might not be willing to let everyone install software on their machine, and sharing an application on a server allows them more control over who can access the application.
For example, deploying on a server allows to use proxy, and to filter by IP: then, only a subset of people can have access to the application.

When using `{golem}`, you can open the `dev/03_deploy.R` and find the functions for server deployment.
At the time of writing this book, there are two main ways to deploy a shiny app on a server:

+ RStudio's solutions
@@ -93,11 +126,14 @@ Each of these platforms has its own function to create an `app.R` file that is t
What these `app.R` files do is calling a `pkgload::load_all()` function, that will mimic the launch of your package, and then call the `run_app()` function from your packaged app.
Note that if you need to configure the way your app is launched on these platforms (for example if you need to pass arguments to the `run_app()` function), you will have to edit this file.

Note that when using these functions, you will be able to use the "One click deploy" for these platforms: on the top right of these `app.R`, use the Blue Button to deploy to server.

Another way to deploy your `{golem}` based app to Shiny server and to Connect is to link these two software to a local repository (for example an RStudio Package Manager), and then to only use `mypackage::run_app()` to the `app.R`.

### Docker

Docker is an open source software used to build and deploy applications in containers. Docker has become an core solution in the DevOps world and a lot of server solution are based on it.
Docker is an open source software used to build and deploy applications in containers.
Docker has become an core solution in the DevOps world and a lot of server solution are based on it.
See the "Strengthen" chapter for a more complete introduction to Docker.

You will find the function for creating a `Dockerfile` for your `{golem}` app inside the `03_deploy.R` file, which contains a series of 3 functions:
@@ -109,7 +145,10 @@ You will find the function for creating a `Dockerfile` for your `{golem}` app in
The first function creates a "generic" `Dockerfile`, in the sense that it is not specific to any platform, and would work out of the box for your local machine.
The second one is meant for [ShinyProxy](https://www.shinyproxy.io/), an open source solution for deploying containarized Shiny application, and the third for [Heroku](https://www.heroku.com/), an online service that can serve containerized applications (not specific to Shiny).

Other platforms can run Docker containers, notably AWS and Google Cloud Engine.
At the time of writing these lines, `{golem}` does not provide support for these environment, but that is on the ToDo list!

Note that the `Dockerfile` creation in `{golem}` tries to replicate your local environment as precisely as possible, notably by matching your R version, and the version of the packages you have installed on your machine.
System requirements are also added when they are found on <sysreqs.r-hub.io>).
System requirements are also added when they are found on [sysreqs.r-hub.io](https://sysreqs.r-hub.io/)).
Otherwise you might have to add them manually.

3 changes: 2 additions & 1 deletion before-build.R
Original file line number Diff line number Diff line change
@@ -18,7 +18,8 @@ paks <- c(
'gargoyle', 'dplyr', 'dbplyr', 'vroom',
'data.table', 'jsonlite', 'readxl',
'R.cache', 'glouton', 'bubble', 'roxygen2',
'covr', 'rcmdcheck', 'covrpage'
'covr', 'rcmdcheck', 'covrpage',
'dccvalidator'
)

cran_paks <- tools::CRAN_package_db()
2 changes: 1 addition & 1 deletion index.Rmd
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ title: "Engineering Production-Grade Shiny Apps"
author: "Colin Fay, Sébastien Rochette, Vincent Guyader, Cervan Girard"
date: "`r Sys.Date()`"
documentclass: krantz
bibliography: [book.bib, packages.bib]
bibliography: [book.bib, packages.bib, manualpackage.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes