Deploying Your Survey

Preparing to deploy

Before deploying your survey, make sure you have done the following:

  1. You have rendered your Quarto shiny d ocumentand tested it locally by clicking the “Run Document” button in RStudio or in your terminal running the command:
quarto serve survey_file_name.qmd
  1. You have set up a Supabase project and have already added the database parameters in the sd_database() function in the setup code chunk (see the Store Data page for details).
  2. You have set the password for your survey using surveydown::sd_set_password("my_password"), using the password you set in the Supabase project.
  3. You have created an account on shinyapps, which will be used for survey online deployment.

With these steps completed, you are ready to deploy your survey online.

Deploying to shinyapps.io

Deploying your survey is pretty much the same as deploying any other Shiny app.

We recommend using shinyapps.io to host your survey as it is designed to work with Shiny Apps, but you can also use other hosting services such as RStudio Connect or huggingface.

Note

You may have deployed other Quarto documents on Quarto Pub before. Note that Quarto Pub is only for static websites, while your survey is an interactive website. Therefore, you SHOULD NOT use Quarto Pub for your survey deployment.

To start using shinyapps.io, you’ll need to create an account and follow the basic instructions to set up your sub-domain and authorize your IDE. See more information here.

Once you have your account and your sub-domain ready, it’s time to deploy your survey website.

Make sure you have the rsconnect package installed (you should have done this while authorizing your IDE):

install.packages('rsconnect')

Then, the simplest way to deploy your survey is to run this:

rsconnect::deployDoc("your_survey.qmd")

The URL of this page will be your domain followed by /your_survey, which means the name of your .qmd file will be in the URL. The tab name of the HTML page is also your_survey. If you want to define a different tab name for your survey page, run:

rsconnect::deployDoc(
  doc = "your_survey.qmd",
  appName = "Survey Name"
)
Important

Just as a reminder, don’t forget to render your surveydown survey locally and make sure it works properly before you deploy online. Otherwise, this deployment will fail.

That’s it!Now you should have your survey site deployed on shinyapps.io, with its data stored on Supabase. Congratulations!

Note

In rsconnect, there are two functions that can be used to deploy a shiny app: deployApp() and deployDoc(). They serve different purposes:

  • deployApp() is used to deploy a Shiny App. It doesn’t work for .qmd documents, but it does work for Shiny Apps and .rmd documents, and it accepts multiple files.
  • deployDoc() is used to deploy a Quarto Shiny document. It works for a single file and tries to “automatically discover dependencies”, according to the official instructions).
Back to top