Chapter 5 The workflow

The recommended workflow for building successful Shiny Apps happens in five parts: Design, Prototype, Build, Secure and Deploy.

5.1 Part 1: Design

The Design part is the time when you think about how you will conceive the application, before actually writing any line of code. It’s not Shiny nor R specific: it’s something software engineers have been doing for any software or web application: discuss with the clients, the end-users, and the developers that will work on the project. In this first part, you’ll discover some tools that will help you define how the application will be build, that is to say somewhere between users’ dreams, what’s technically possible, and the time you’ve got for building it.

5.2 Part 2: Prototype

The Prototype step is the one during which you’ll be building the front-end and the back-end, but separately. As you may know, a Shiny application is an interface used to communicate information to the end-users. The general appearance, position of the inputs and outputs as well as graphical interactions need to be chosen with care. On the other hand, the back-end should be built carefully: people will potentially make decision based on what they learn from your app. That’s why you should take extra care building the UI, but also building the back-end.

In this part, we will be talking about two processes:

  • A ‘UI-first’ approach, with tools to build the skeleton of the application before engineering its core.

  • A ‘Rmd-first’ approach, which focuses on the actual computation of the outputs. The idea here is to prototype the outputs outside of the application reactivity. This ‘Rmd first’ method is designed to help you focus on the core of the application outside of any reactive context, and also to develop functions and write the documentation with visual outputs and example data.

Here, we are building the two sides of the app separately: the core back-end can be outputted to HTML documents that can be sent and validated by the clients, and the front-end can be tested without actual implementation of the back-end.

5.3 Part 3: Build

The Build step is the one where you’ll be working on combining the business (or back-end) logic with the front-end. In this step 3, you’ll be working on the core engine of the application. If you’re planning on building a robust Shiny application, you’ll have to start using the correct development tools. In this part, you’ll see how you can upgrade your development workflow using {golem}, a package which has been created to help you design a robust and maintainable Shiny application.

5.4 Part 4: Secure

Securing your app is ensuring your application will last forever. This might seem like a hard task, but some good practices will help you all along life-cycle of the app. In this part, we will go through unit tests, reproducible development environment, version control and continuous integration in the context of Shiny applications.

5.5 Part 5: Deploy

To Deploy is to send your application to production. Being exhaustive here is an impossible task as there are numerous ways to make your application accessible to its targeted users. But we’ll try to provide some! In this part, we will quickly present a series of methods to deploy your application on various environments, and show how you can use {golem} to make this task easier.


ThinkR Website