Building Big Shiny Apps

A Workflow

What's a Shiny App?

Shiny is a framework for building web applications that can communicate with R. No knowledge of HTML, CSS or JavaScript is required.

On the plus side:

Easy to use

Fast for prototype

On the down side:

Can get tricky for big apps

What's a BIG Shiny Apps?

Shiny is perfect if you need to create Data Science prototypes rapidly.

It can also be used in production, but it then becomes more complex.

Millions of lines of code

Several coders

Potentially numerous users

Scaling matters

Users who are not “coders”

Building Big Shiny Apps

The Challenges

What are the challenges?

Finding a Good User interface

(and stick with it)

Simplicity is the key.

'Simplicity is the most difficult thing to secure in this world.'

Working simultaneously on the same app

Adopt an app structure and choose tools that will allow multiple peoples to work safely (and efficiently) on the same application.

Making it Production Ready

Create an app that is robustly tested, maintainable, and deployable into production.

Building a Good User Interface

A big Shiny app might be used by people who are not “tech literate”, and need a simple, easy to use and easy to understand application.

How to do that?

Simplicity is the key

Do what’s necessary, no more, no less

Developping as a Team

Building a big shiny app means that several coders will work on that app. Choose tools and structure that will fit collaborative work.

Use version control.

Split your app into pieces so that everybody can work on his own piece (Shiny modules).

Scale Big Shiny Apps

Most of the time, building a big Shiny App means that it will be scaled to numerous users, that it will be used for a (relatively) long time, and that you might implement new things on it in the future.

JavaScript can make the app lighter (don’t make R do things it doesn’t need to do).

{future} and {promises} are your friends.

Using modules allow to implement new things more easily in the future.

Maintain

Once your app is in production, you need to make it maintainable.

Making a software maintainable is:

Using modules make the application easier to maintain: “bite size” pieces of code are easier to understand on monolithic, 1000s of lines long files (even more if you need to pass this application to someone else in the future.

Create regression tests so that the application doesn’t suddenly break.

Ensure R & package stability over time (notably: the version numbers).

Building Big Shiny Apps

Step by step

Design

Don't rush into coding the app.

Start simple: maybe just with a pen and a piece of paper. Draw the app here, and define the content.

Rmd are your friends.

Will help you think about the content

Prototye

Go “UI first” - define the outline of the app, whithout focusing on the backend.

Will freeze the app content and fonctionalities.

Can help you see potential pitfalls before it’s too late.

Once this UI prototype is agreed upon, everybody know where the app is going.

Docker / Shinyproxy / Shiny server / connect

ThinkR is French company focused on everything R-related.
We are specialized in anything that can be linked to R: software engineering, infrastructure, shiny applications and deployment, training...
We also have a strong commitment to the Open Source community..