Skip to content

Commit

Permalink
Add contents to folder
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Solymos <psolymos@gmail.com>
  • Loading branch information
psolymos committed Jul 6, 2024
1 parent a8d1a25 commit 8d51932
Show file tree
Hide file tree
Showing 117 changed files with 10,688 additions and 0 deletions.
1 change: 1 addition & 0 deletions book-source/.Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
1 change: 1 addition & 0 deletions book-source/.github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
16 changes: 16 additions & 0 deletions book-source/.github/ISSUE_TEMPLATE/a--typos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: a) Typos
about: Please report typos here
title: Typo in book
labels: ''
assignees: ''

---

Please let us know about the typo:

* Location/Chapter Number:
* Incorrect text:
* Correct text:

Or you can send a GitHub Pull Request with the fix.
10 changes: 10 additions & 0 deletions book-source/.github/ISSUE_TEMPLATE/b--all-other-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: b) All other issues
about: Please report all other issues here
title: ''
labels: ''
assignees: ''

---


50 changes: 50 additions & 0 deletions book-source/.github/workflows/deploy_bookdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

# Set up renv following instructions at https://www.emilhvitfeldt.com/post/bookdown-netlify-github-actions/
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: bookdown

jobs:
bookdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}
EMAIL: ${{ secrets.EMAIL }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

- name: Cache bookdown results
uses: actions/cache@v3
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-

- name: Build site
run: bookdown::render_book("index.Rmd", quiet = TRUE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: docs
38 changes: 38 additions & 0 deletions book-source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# R files
.Rproj.user
.Rhistory
.RData
.Ruserdata
.DS_Store
.Rbuildignore

# bookdown output files
*_bookdown_files
HostingShiny.Rmd
HostingShiny.pdf
HostingShiny.tex
HostingShiny.auc
HostingShiny.aux
HostingShiny.idx
HostingShiny.log
HostingShiny.out
HostingShiny.toc
HostingShiny.aux
HostingShiny.ind
HostingShiny.ilg
purl.Rout

# Other files
.httr-oauth
*rsconnect/

# Comment out (and thus do not ignore these files) only when version bumping
# the release branch
docs/*
# bib/packages.bib

# generated figures
figures/*

spelling.csv
urlcheck.txt
11 changes: 11 additions & 0 deletions book-source/00-01-foreword.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is an awesome book! I can recommend it.

```{r echo=FALSE, eval=TRUE, results="asis"}
if (is_latex_output()) {
cat("\\begin{flushright}
\\textit{John Doe, Affiliation}
\\end{flushright}")
} else {
cat("<br>*John Doe, Affiliation*</br>")
}
```
154 changes: 154 additions & 0 deletions book-source/00-02-preface.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Preface {-}

## Motivation {-}

Shiny is a reactive web application framework used by R\index{R} and
Python\index{Python} users to communicate their results to others. Whether
you are just starting out with Shiny, or you are a seasoned programmer, at
some point you'll need to share your app with your colleagues and users.
You might decide to send them scripts or deploy the app and share the URL
that takes people to your app. The documentation and books about the Shiny
ecosystem are phenomenal resources. However, these resources focus on the
development of the applications and decidedly cover very little about what to
do once the app is deployed.

It might surprise you, but there are at least /FIXME: CHECK THIS NUMBER/ 20 hosting options for Shiny.
Navigating these options and finding up-to-date advice on choosing one and
getting started is not easy or trivial. Information about Shiny hosting is
scattered around the Internet and is often incomplete. Recommendations are
usually narrowly focused and never really ask such important questions as:
Why do you want this app deployed? Who is this app for? What is your budget?
The goal of the book is to help you learn about the hosting options and what
it takes to host your apps securely.

Currently available books also focus on the R aspect of Shiny,
which is not surprising given that Shiny for Python is a relatively recent
addition to the Shiny ecosystem. Luckily, Shiny
for R and Python have very similar deployment and hosting patterns. Therefore,
we can cover both in the same book. We think this is important, because with the
increasing popularity of Shiny available for R and Python, learning more about
the hosting side of the application life-cycle will be a critical need for
programming enthusiasts and data science professionals alike.

## Who Is This Book For? {-}

If you are asking the following questions, this book is definitely for you:
What Shiny hosting solutions are out there? How do I decide which of these
options suits my needs, my budget, and my skill level the best? How can I get
started, and where can I get help if I get stuck? If you are not (yet) asking
these questions, but want to learn about servers, cloud instances, and
containers from the perspective of Shiny apps, this book is still for you.

You might be a researchers in academia, government, and at a nonprofit
organization who wants to self-host Shiny apps so that you can show your
results to your colleagues, your stakeholders, or to the public.
You might work at a small agency or a startups and want to securely host
apps for your clients and users. Or you might be a data scientists who wants
to effectively collaborate with people at the IT and engineering department
about Shiny app deployment and hosting.

## What Will You Learn? {-}

The book is structured into four main parts plus appendices. This is what the
four main parts will cover:

- Part I. Getting started -- This will give you the fundamentals for the rest
of the book, including some background, concepts, and setup instructions.
- Part II. Shiny Apps -- This part deals with everything that happens on your
**local** machine, including developing and organizing Shiny apps, and ways
of running the apps locally.
- Part III. Hosting Shiny Apps -- This part describes all the ways how Shiny
apps can be hosted on **remote** machines, like cloud servers. This part is
the longest, because there are quite a few hosting options.
- Part IV. What is next -- You'll find a summary of all the things you might
want to do next with your Shiny app, things that might either be too advanced
or are harder to describe in a physical book format.

The book does not end on the last page. You can find online supplements,
including the HTML version of the book and all the code that we present
in the book and more on the book's website <`r book_website_link`>.

## What Will You Not Learn? {-}

This book is focused on the many different ways of hosting Shiny apps. This
topic is at the intersection of R & Python programming, Shiny app development,
and DevOps. We assume you are already familiar with either R or Python.
If this is not the case, we suggest you start with accessible introductions
to R or Python before going further. You don't need to know both languages,
but knowing at least one is definitely needed.

We will use example Shiny apps to test and demonstrate the different hosting
options, but we are not going to teach you how to master Shiny,
how to engineer production-grade apps, and how to make outstanding user
interfaces with Shiny. You can find all those in these excellent books:

- [_Mastering Shiny_](https://mastering-shiny.org/) [@Wickham2021]
- [_Engineering Production-Grade Shiny Apps_](https://engineering-shiny.org/) [@Fay2021]
- [_Outstanding User Interfaces with Shiny_](https://unleash-shiny.rinterface.com/) [@Granjon2022]

There is also quite a bit that can be said about servers and cloud
infrastructure that we won't cover in this book.
[_DevOps for Data Science_](https://do4ds.com/) [@Gold2024]
gives an accessible overview of DevOps conventions, tools, and practices,
and provides pointers for further broadening your knowledge in these areas.

## Conventions {-}

Throughout the book, we will use title case and all caps for software and
frameworks, e.g. Shiny, R, Python SSH, HTML, CSS, etc.
We will use monospace code font for inline mentions of libraries and extension
packages (e.g. `shiny`, `pandas`), also for functions and methods
(e.g. `summary()`, `pandas.read_csv()`), and file names (`image.png`).
_Italicized_ text will be preserved for publication titles
(e.g. _Mastering Shiny_) and for cases when we imitate self talk.
FOr example: _I feel a little bit lost, what do I do now?_
We will use **bold** when highlighting or emphasizing words.
URLs when pointing to Internet resources, like websites, will be in
normal font (e.g. <https://mastering-shiny.org>), URLs when mentioning with
regards to examples will be in code font (e.g. `http://127.0.0.1`).
We will use angle brackets for variable values that you should replace
in your code, e.g. `https://<your-domain>`. Dot-dot-dot within brackets,
`[...]`, will indicate that we trimmed the output to save space by not
showing too verbose or repetitive text in the book.
We will use backslash (`\`) to break up long commands to help readability and
to fit on the printed page.

We use the _h10y_ as a shorthand for _Hosting Shiny_, and it means that between
the first letter _H_ and the last letter _Y_ there are 10 other letters.
You will see the domain [h10y.com](https://h10y.com) used to shorten links and to
prevent link rot after the print version of the book is out. We will also use
`h10y` in Docker image namespaces to make image tags shorter.

## About the Authors {-}

Péter Sólymos is a senior data scientist with 20 years of experience in
wildlife, environmental, and utilities sectors. He holds a PhD in biology,
he has authored 70 peer-reviewed publications and several statistical software
packages. He is passionate about using statistics and data science to bridge
the gap between data and decision making. His focus is on enabling this by
helping organizations adopting cloud-native practices into their operations.
FIXME: PETER to revise.
<https://peter.solymos.org>

Kalvin Eng is a PhD candidate in Computing Science at the University of Alberta with over 15 years of software development experience. His research involves understanding and improving the processes of software engineering. He is passionate about helping organizations develop efficient processes to build software more effectively.
FIXME: KALVIN to revise.
<https://kalvineng.com>

## Acknowledgements {-}

We are grateful for Kahlid Lemzouji for continuously finding new reasons to
up our game with Shiny hosting. Thanks to Kalob Taulien for helping with our
early endeavors with Shiny hosting.

Some of the content of this book was developed as part of workshops
held by the authors at the _Edmonton R User Group (YEGRUG)_. We are thankful
for the Statistical Society of Canada for inviting us to teach the course
_Delivering applied statistics from concept to production_.

FIXME: add here more names as needed
- The authors would like to thank a whole bunch more people.
- Who provided reviews and we know there names.


<!-- For use only in PDF, is skipped in HTML -->
\mainmatter
Loading

0 comments on commit 8d51932

Please sign in to comment.