forked from ThinkR-open/engineering-shiny-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter-abstracts.Rmd
206 lines (106 loc) · 13.2 KB
/
chapter-abstracts.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
---
title: "Chapter abstract"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 1, Chapter 1 About Successful {shiny} Apps
The first chapter of the book will give the reader a short introduction to the `{shiny}` package. It will then lay the foundations for the rest of the book by defining key concepts necessary for a clear understanding of the upcoming chapters.
Here, we will address the following questions: how can we define complexity when it comes to software engineering?
How can we define a successful software project?
How can we measure both these aspects when it comes to R and `{shiny}`?
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 2, Planning Ahead
This second chapter of the book will cover a crucial concept when it comes to leading a successful software engineering project: planning.
In this chapter, the reader will be presented project management and planning in the context of a `{shiny}` project: why it's important to plan ahead, how to leverage the KISS principle, and how to practically organize a team of `{shiny}` developers, both from the tooling and management point of views.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 3, Structuring your Project
Chapter 3 will cover the technical aspects of structuring your `{shiny}` projects for production.
In this chapter, we will cover the importance of building a `{shiny}` application as a package and all the benefits that will come with this infrastructure choice: metadata, documentation, native testing, and the ability to leverage all the toolkit available to the R developers. Then, we will move to another key concept that will power any large-scale `{shiny}` application: modules. Finally, we will introduce why convention matters when it comes to working as a team, and how to put this into practice when building applications using the `{golem}` framework.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 4, Introduction to {golem}
Chapter will introduce `{golem}`, a framework for building production-grade `{shiny}` applications.
In this chapter, we will give an introduction to the general philosophy behind `{golem}`, and will describe in details the structure of a `{golem}` project: what makes it similar to a standard R package (`DESCRIPTION`, `NAMESPACE`, `man/`, ...), and what makes it unique. Notably, we will spend some time reviewing the functions contained in the default `{golem}` project, the very same functions that will be the starting point of your future `{shiny}` applications.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay, Sebastien Rochette
## Chapter Number & Title -- Chapter 5, The workflow
This fifth chapter succinctly presents the steps of the workflow later developed in the book: Design, Prototype, Build, Strengthen, and Deploy.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 6, UX Matters
Chapter 6 covers the basics of what make a web application user-friendly.
First, we cover the importance of simplicity when it comes to designing an interface, keeping in mind the "Don't make me think" mantra. When reading the web, users tend to scan, instead of cautiously make logical decisions about how to behave. In other word, they do not really read but tend to scan the content, making it crucial for the page to be as simple as possible, so that the visitors easily find their way through the interface.
Then, we cover the importance of lowering complexity of a software by restraining from implementing way too many features: when building an application with `{shiny}`, it's crucial to think about the necessity of the features we're implementing, so that we don't end with too much reactivity, and/or an application that is way to slow to be used.
Finally, we cover one of the most important topic when it comes to making a successful application: accessibility. In other words, how do we make an application usable by the widest audience possible? How do we work on making our application usable by people with visual, mobility, or cognitive disabilities. This chapter will introduce the notion of semantic HTML in the context of `{shiny}`, structure, and, something important in a context where we build applications with data visualization: choice of colors.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 7,
This seventh chapter covers the need for getting yourself prepared upfront when it comes to engineering a `{shiny}`.
Here, we will cover the importance of starting with planning, thinking, and evaluating existing solution before rushing into coding. We will also introduce concept maps, and give a series of tools to evaluate the project before even writing a single line of code. In other words, we'll see how to get started with user interview, how to create personas, and why it's important to evaluate pre-existing codebase before starting the project.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 8, Setting up for success with {golem}
Chapter 8 covers what to do now that you are ready to code your application.
In other words, now that the coding part is officially ready to start, how do we set everything up using `{golem}`? This chapter will cover how to create a new project using `{golem}`, and how to set the files so that your team can work in a structured project.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay, Sebastien Rochette
## Chapter Number & Title -- Chapter 9, Building an “ipsum-app”
Chapter 9 describes step 2 of the workflow: Prototyping.
The first part of this chapter covers the why of prototyping, and the importance of focusing on making the application work before working on anything else. Then, we will detail what prototyping means in the context of `{shiny}`: notably, we will present `{shinipsum}`, a package designed to create random elements to fill a `{shiny}` user interface.
Then, the last part will present the "Rmd First" methodology, that describes the importance of building the application back-end inside RMarkdown documents, so that you can concentrate on the business logic of your application, instead of working on an entanglement of back-end functions and application logic.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 10, Building the app with {golem}
This chapter 10 covers the third part of the workflow: building the application itself.
Inside this chapter will be described how to add external dependencies to your application, how to build sub-modules and utilitarian functions, and how to document, test, and measure the code coverage of your application.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 11, Build yourself a safety net
The fourth part of the workflow is described in chapter 11 and 12.
In this chapter 11, we come back in more details on the importance of testing your application, and on the toolkit `{shiny}` developers can leverage to test their applications: `{testthat}` for the business logic, `puppeteer`, `{shinytest}` and `{crrry}` for the front-end, and `{shinyloadtest}` and `{dockerstats}` for the application load, i.e. the computer resources necessary to make your application work.
In this chapter, we will also present two tools that are crucial to reproducibility: `{renv}`, a package to manage local dependencies at a project level, and `Docker`, one of the most popular software today to write and deploy software.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay, Vincent Guyader
## Chapter Number & Title – Chapter 12, Version Control
Chapter 12 covers another essential part of working on solid grounds when building a production-grade software: version control.
Version control is a methodology, based on a software, that allows to track change of a software through time, and to work simultaneously on various versions of the same codebase without interference. In this chapter, we will be focusing on `git`, one of the most popular version control system, and present a methodology called 'git flow'.
This chapter will also cover how you can use version control server like GitLab or GitHub to build Continuous Integration and Continous Deployment (CI/CD) processes, allowing to automate actions whenever new content is integrated to the main codebase.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 13, Deploy your application
Chapter 13 covers the last part of the workflow: deployment.
This chapter starts with a checklist of things to do before sending an application to production. Then, we move to the three main ways to share a `{shiny}` application: as a package, via a package manager or by sharing a `tar.gz`, using one of RStudio deployment platforms, or finally how you can leverage Docker to deploy your application to production.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 14, The Need for Optimization
Chapter 14 starts with the reflection around the necessity to optimize, and around managing the optimization process when building your application.
When building a `{shiny}` application that will be send to production, schedule matters, and focusing on optimizing too soon, or too much, might endanger the whole success of the project. On the other hand, choices made when optimizing the application might have a big impact on the longevity of the project.
If you decide to go along the optimization road, you better start by benchmarking what and where you need to optimize, so that you're sure you're not working on optimizing parts of the application that do not need to be optimized. The second part of the chapter presents tools you can use to perform this code profiling.
## Book Title -- Engineering Production-Grade Shiny Apps
## Chapter Author -- Colin Fay
## Chapter Number & Title -- Chapter 15, Common Application Caveats
Some code bottlenecks (parts of the codebase that slow the application) might not be caught by simple profiling tools: sometime a slow application can be explained by caveats in the way the application is designed.
This chapter will present three main sources of design patterns that might be slowing your application: uncontrolled reactivity, where too much happens (also known as "reactivity hell"), making R perform too much computation, and data source management.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 16, Optimizing {shiny} Code
There are several methods you can choose to optimize your application so that it works faster, and handles memory in a more efficient way. This chapter presents three of them.
First, focusing on the R code itself. Then, caching elements. Caching is the process of storing computation results from a function so that it can be reused, instead of recomputing the function every time. In this chapter, we will see how you can implement caching with R code, and how to use the `{shiny}`-specific functions to do that. Finally, we will present a way to build asynchronousity inside a `{shiny}` application using `{promises}` and `{future}`.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 17, Using JavaScript
One of the best way to enhance your application, in the long run, is to get comfortable with JavaScript, a scripting language that runs in your web browser.
With JavaScript, you'll be able to enhance the user experience by leveraging in-browser events, and lower the computation performed by R as you can perform them inside the browser, leaving more space to the server for computation. And in the long run, when you're comfortable with JavaScript, a whole world of `{shiny}` extensions opens.
But in the meantime, you might be looking for a place to start. Search no more, this chapter is the perfect place to get started with JavaScript for `{shiny}`.
## Book Title – Engineering Production-Grade Shiny Apps
## Chapter Author – Colin Fay
## Chapter Number & Title – Chapter 18, A Gentle Introduction to CSS
In this last chapter of the book, we will introduce the last of the HTML/JavaScript/CSS web technology trio.
CSS, for Cascading StyleSheets, is what powers the design of the web page. When making `{shiny}` applications that will be sent to production, chances are that you'll want to enhance its design. Then, CSS is where you should start.
This chapter gives a short introduction to this language, so that you're more comfortable tackling design tasks on your next application.