Engineering Production-Grade Shiny Apps
- Length: 364 pages
- Edition: 1
- Language: English
- Publisher: Chapman and Hall/CRC
- Publication Date: 2021-09-27
- ISBN-10: 0367466023
- ISBN-13: 9780367466022
- Sales Rank: #1788375 (See Top 100 Books)
From the Reviews
“[This book] contains an excellent blend of both Shiny-specific topics … and practical advice from software development that fits in nicely with Shiny apps. You will find many nuggets of wisdom sprinkled throughout these chapters….”
Eric Nantz, Host of the R-Podcast and the Shiny Developer Series (from the Foreword)
“[This] book is a gradual and pleasant invitation to the production-ready shiny apps world. It …exposes a comprehensive and robust workflow powered by the {golem} package. [It] fills the not yet covered gap between shiny app development and deployment in such a thrilling way that it may be read in one sitting…. In the industry world, where processes robustness is a key toward productivity, this book will indubitably have a tremendous impact.”
David Granjon, Sr. Expert Data Science, Novartis
Presented in full color, Engineering Production-Grade Shiny Apps helps people build production-grade shiny applications, by providing advice, tools, and a methodology to work on web applications with R. This book starts with an overview of the challenges which arise from any big web application project: organizing work, thinking about the user interface, the challenges of teamwork and the production environment. Then, it moves to a step-by-step methodology that goes from the idea to the end application. Each part of this process will cover in detail a series of tools and methods to use while building production-ready shiny applications. Finally, the book will end with a series of approaches and advice about optimizations for production.
Features
- Focused on practical matters: This book does not cover Shiny concepts, but practical tools and methodologies to use for production.
- Based on experience: This book is a formalization of several years of experience building Shiny applications.
- Original content: This book presents new methodologies and tooling, not just a review of what already exists.
Engineering Production-Grade Shiny Apps covers medium to advanced content about Shiny, so it will help people that are already familiar with building apps with Shiny, and who want to go one step further.
Cover Half Title Series Page Title Page Copyright Page Dedication Contents List of Figures Introduction Foreword Application presentation I. Building Successful {shiny} Apps 1. About Successful {shiny} Apps 1.1. A (very) short introduction to {shiny} 1.2. What is a complex {shiny} application? 1.2.1. Reaching the cliff of complexity 1.2.2. Balancing complexities 1.2.3. Assessing code complexity 1.2.4. Production-grade software engineering 1.3. What is a successful {shiny} app? 1.3.1. It exists 1.3.2. It is accurate 1.3.3. It is usable 1.3.4. It is immortal 2. Planning Ahead 2.1. Working with a “long-term” mindset 2.1.1. Prepare for success 2.1.2. Develop with the KISS principle 2.2. Working as a team: Tools and structure 2.2.1. From the tools point of view 2.2.2. From the team point of view 3. Structuring Your Project 3.1. {shiny} app as a package 3.1.1. What is in a production-grade {shiny} app? 3.1.2. Resources 3.2. Using {shiny} modules 3.2.1. Why {shiny} modules? 3.2.2. When to use {shiny} modules 3.2.3. A practical walkthrough 3.2.4. Communication between modules 3.3. Structuring your app 3.3.1. Business logic and application logic 3.3.2. Small is beautiful (bis repetita) 3.3.3. Conventions matter 4. Introduction to {golem} 4.1. What is {golem}? 4.2. Understanding {golem} app structure 4.2.1. DESCRIPTION and NAMESPACE 4.2.2. R/ 4.2.3. golem-config 4.2.4. inst/app/www/ 4.2.5. dev/ 4.2.6. man/ 5. The Workflow 5.1. Step 1: Design 5.2. Step 2: Prototype 5.3. Step 3: Build 5.4. Step 4: Strengthen 5.5. Step 5: Deploy II. Step 1: Design 6. UX Matters 6.1. Simplicity is gold 6.1.1. How we read the web: Scanning content 6.1.2. Building a self-evident app (or at least self-explanatory) 6.2. The danger of feature-creep 6.2.1. What is feature-creep? 6.2.2. Too much reactivity 6.2.3. Too much interactivity 6.3. Web accessibility 6.3.1. About accessibility 6.3.2. Making your app accessible 6.3.3. Evaluating your app accessibility and further reading 7. Don’t Rush into Coding 7.1. Designing before coding 7.1.1. The urge to code 7.1.2. Knowing where to search 7.1.3. About concept map 7.2. Ask questions 7.2.1. About the end users 7.2.2. Building personas 7.2.3. Pre-existing code-base 7.2.4. Deployment III. Step 2: Prototype 8. Setting up for Success with {golem} 8.1. Create a {golem} 8.2. Setting things up with dev/01_start.R 8.2.1. Fill the DESCRIPTION and set options 8.2.2. Set common files 8.2.3. Use recommended elements 8.2.4. Add utility functions 8.2.5. Changing the favicon 8.3. Setting infrastructure for prototyping 8.3.1. Add modules in dev/02_dev.R 8.3.2. Add CSS and JS files 9. Building an “ipsum-app” 9.1. Prototyping is crucial 9.1.1. Prototype, then polish 9.1.2. The “UI first” approach 9.2. Prototyping {shiny} 9.2.1. Fast UI prototyping with {shinipsum} 9.2.2. Using {fakir} for fake data generation 9.3. Building with RMarkdown 9.3.1. Define the content of the application 9.3.2. Using the Rmd files as a laboratory notebook 9.3.3. Rmd, Vignettes, and documentation first IV. Step 3: Build 10. Building the App with {golem} 10.1. Add dependencies 10.1.1. Package dependencies 10.1.2. Importing packages and functions 10.2. Submodules and utility functions 10.3. Add tests 10.4. Documentation and code coverage 10.4.1. Vignette 10.4.2. Code coverage and continuous integration 10.5. Using {golem} dev functions V. Step 4: Strengthen 11. Build Yourself a Safety Net 11.1. Testing your app 11.1.1. Testing the business logic 11.1.2. shiny::testServer() 11.1.3. Testing the interactive logic 11.1.4. Testing the app load 11.2. A reproducible environment 11.2.1. {renv} 11.2.2. Docker 12. Version Control 12.1. Using version control with Git 12.1.1. Why version control? 12.1.2. Git basics: add - commit - push - pull 12.1.3. About branches 12.1.4. Issues 12.2. Git integration 12.2.1. With RStudio 12.2.2. As part of a larger world 12.2.3. About git-flow 12.2.4. Further readings on Git 12.3. Automated testing VI. Step 5: Deploy 13. Deploy Your Application 13.1. Before deployment checklist 13.2. Sharing your app as a package 13.2.1. Install on your machine 13.2.2. Share as a built package 13.3. Deploying apps with {golem} 13.3.1. RStudio environments 13.3.2. Docker VII. Optimizing 14. The Need for Optimization 14.1. Build first, then optimize 14.1.1. Identifying bottlenecks 14.1.2. Do you need faster functions? 14.1.3. Don’t sacrifice readability 14.2. Tools for profiling 14.2.1. Profiling R code 14.2.2. Profiling {shiny} 14.2.3. More resources about web-page performance 15. Common Application Caveats 15.1. Reactivity anti-patterns 15.1.1. Reactivity is awesome… until it is not 15.1.2. observe vs observeEvent 15.1.3. Building triggers and watchers 15.1.4. Using R6 as data storage 15.1.5. Logging reactivity with {whereami} 15.2. R does too much 15.2.1. Rendering the UI from the server side 15.2.2. Too much data in memory 15.3. Reading data 15.3.1. Including data in your application 15.3.2. Reading external datasets 15.3.3. Using external databases 15.3.4. Data-source checklist 16. Optimizing {shiny} Code 16.1. Optimizing R code 16.2. Caching elements 16.2.1. What is caching? 16.2.2. Native caching in R 16.2.3. Caching in {shiny} 16.3. Asynchronous in {shiny} 16.3.1. How to 17. Using JavaScript 17.1. Introduction 17.2. A quick introduction to JavaScript 17.2.1. About JavaScript 17.2.2. Including JavaScript code in your app 17.2.3. Understanding HTML, class, and id 17.2.4. Querying in Vanilla JavaScript 17.2.5. About DOM events 17.2.6. About jQuery and jQuery selectors 17.3. Client-side JavaScript 17.3.1. Common patterns 17.3.2. Where to put them: Back to JavaScript Events 17.4. JavaScript <-> {shiny} communication 17.4.1. From R to JavaScript 17.4.2. From JavaScript to R 17.5. About {shinyjs} JS functions 17.6. One last thing: API calls 17.7. Learn more about JavaScript 17.7.1. {shiny} and JavaScript 17.7.2. JavaScript basics 17.7.3. jQuery 17.7.4. Intermediate/advanced JavaScript 18. A Gentle Introduction to CSS 18.1. What is CSS? 18.1.1. About CSS 18.1.2. {shiny}’s default: fluidPage() 18.2. Getting started with CSS 18.2.1. About CSS syntax 18.2.2. CSS selectors 18.2.3. CSS properties 18.3. Integrate CSS files in your {shiny} app 18.3.1. Inline CSS 18.3.2. Writing in a tags$style() 18.3.3. Including external files 18.3.4. Using R packages 18.4. External resources VIII. Appendix Appendix A - Use Case: Building an App from Start to Finish Appendix B - Session Info Index
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.