In the world of web servers, a stack describes the critical software used on the server. The most well-known stack is LAMP – Linux (operating system), Apache (web server), MySQL (database), and PHP (programming language). For example, WordPress and other content-management systems typically rely on a LAMP stack.
Today I’m releasing v0.1 of om_skeleton. It begins where uiStub left off, but now includes user authentication – that is, logging in and logging off.
In other words, om_skeleton is R code for Shiny-server-based web sites that allows multiple pages (the code for each of these pages is in a separate file) and multiple users. The users can:
As I mentioned in the final post of my read-me-first Shiny tutorial, the need for a ui variable makes Shiny look like it requires a separate app for every distinct web page. But if you reduce the ui to a stub that has only what you want to be the same on every page of your web site, you can move the rest of each page into the server function.
Even the simplest Shiny program has two parts, a ui variable and a server function. When you’re just getting started, it appears these parts are of equal importance. But eventually you realize that it’s all about the server function. The ui is such a nothing that in this tutorial we’ll nearly get rid of it.
Staying organized is a bitch. Using a separate RStudio project for each distinct task you’re working on is a core organizational principle that works on its own for statistical projects related to classwork or publications. Things get harder, however, when your RStudio project also has a GitHub repository and is a Shiny app hosted on a server like shinyapps.io.
Inexpensive shared servers, like the one Open-Meta.org is using, include MySQL database software that you might be able to access from other servers or computers. But when you try to look up how to do this, you are likely to get instructions that are out-of-date and that appear more complicated than the process actually is.
Now that we’ve examined Shiny buzzers and butlers, let’s look at how we might debug a Shiny app that won’t run right. Again, we’ll start with the code Shiny currently autoloads when you create a new Shiny Web App in RStudio:
To get started with Shiny:
Shiny is the package for adding a web interface to the R statistical language. The Shiny team provides a tutorial, articles, examples, a reference guide, a question and answer forum, conference videos from 2016 and 2017, and a GitHub repository.
I have placed the current project code, which is a functioning single-user (on your own computer) version, in both repositories. It’s called RCT. The version of RCT in my personal account includes the data files for the vitamin D project; the version in the Open-Meta account does not and is ready to be used on a new project.