r-shinylive
The {shinylive} R package converts your Shiny for R applications into standalone web applications that run entirely in the browser using WebAssembly, eliminating the need for a server. It exports your local Shiny app to a directory of static files that can be hosted on any static web server, downloads and manages the necessary Shinylive web assets, and handles package dependencies automatically.
This approach solves deployment complexity by removing server infrastructure requirements, making Shiny apps portable and easy to share. The package automatically detects R package dependencies and includes them as precompiled WebAssembly binaries via the webR project. It integrates with common workflows including GitHub Pages deployment and Quarto documents, and supports managing multiple applications on the same site by sharing web assets across apps.
Contributors#
Resources featuring r-shinylive#
Workflow Demo Live Q&A - December 18th!
This is the Live Q&A session for our Workflow Demo on December 18th to show how to build a Shiny app that reads from and writes to a database - using DuckDB.
The demo will be here: https://youtu.be/6AGroJb4zPM
Sara covers how to:
- Set up a connection to DuckDB from a Shiny app
- Query the database using R or Python
- Use editable tables to enable users to write back to the database
- Securely deploy your app to Posit Connect
Resources mentioned in this Q&A: Connect Authentication documentation: https://docs.posit.co/connect/user/oauth-integrations/ Git backed deployment in Posit Connect: https://posit.co/blog/git-backed-deployment-in-posit-connect/ shinylive: https://posit-dev.github.io/r-shinylive/ Mastering Shiny Best Practices: https://mastering-shiny.org/best-practices.html#best-practices
Blogs: https://blog.stephenturner.us/p/duckdb-vs-dplyr-vs-base-r https://outsiderdata.netlify.app/posts/2024-04-10-the-truth-about-tidy-wrappers/benchmark_wrappers.html Using Posit tools with data in DuckDB, Databricks, and Snowflake: https://posit.co/blog/databases-with-posit/ Creating a Shiny app that interacts with a database: https://posit.co/blog/shiny-with-databases/ Appsilon has a lot of resources on the topic: https://www.appsilon.com/post/r-shiny-duckd
Please note, while the monthly Posit Team Workflow Series is usually the last Wednesday of the month - this will be a week earlier. Cheers to a festive holiday season and a fantastic year ahead for you and yours!
To add future Monthly Workflow Demo events to your calendar → https://www.addevent.com/event/Eg16505674
You can view all the previous workflow demos here → https://www.youtube.com/playlist?list=PL9HYL-VRX0oRsUB5AgNMQuKuHPpNDLBVt
Connecting Shiny Apps to Databases with Posit Team
Many of us learned to work with data on our laptop, but at work data is increasingly stored in databases. Join us on Wednesday, Dec 18th at 11am ET with Sara Altman, who will lead us through building a Shiny app that reads from and writes to a database - using DuckDB 🦆
Sara will cover how to:
- Set up a connection to DuckDB from a Shiny app
- Query the database using R or Python
- Use editable tables to enable users to write back to the database
- Securely deploy your app to Posit Connect
Q&A Recording: https://youtube.com/live/C8j3d46AacM?feature=share
Resources mentioned in this Q&A: Connect Authentication documentation: https://docs.posit.co/connect/user/oauth-integrations/ Git backed deployment in Posit Connect: https://posit.co/blog/git-backed-deployment-in-posit-connect/ shinylive: https://posit-dev.github.io/r-shinylive/ Mastering Shiny Best Practices: https://mastering-shiny.org/best-practices.html#best-practices
Blogs: https://blog.stephenturner.us/p/duckdb-vs-dplyr-vs-base-r https://outsiderdata.netlify.app/posts/2024-04-10-the-truth-about-tidy-wrappers/benchmark_wrappers.html Using Posit tools with data in DuckDB, Databricks, and Snowflake: https://posit.co/blog/databases-with-posit/ Creating a Shiny app that interacts with a database: https://posit.co/blog/shiny-with-databases/ Appsilon has a lot of resources on the topic: https://www.appsilon.com/post/r-shiny-duckd
Please note, while the monthly Posit Team Workflow Series is usually the last Wednesday of the month - this will be a week earlier. Cheers to a festive holiday season and a fantastic year ahead for you and yours!
To add future Monthly Workflow Demo events to your calendar → https://www.addevent.com/event/Eg16505674
You can view all the previous workflow demos here → https://www.youtube.com/playlist?list=PL9HYL-VRX0oRsUB5AgNMQuKuHPpNDLBVt
{shinylive}: Serverless Shiny Apps | Barret Schloerke | Posit
In the rapidly evolving landscape of web technologies, the integration of R (and Python) with modern web frameworks has become increasingly important for data scientists and developers. This presentation introduces {shinylive}, a new R package that exports Shiny applications to be run within statically hosted websites. We will explore the capabilities of {shinylive} through its use of the innovative R package {webR}, which allows for the execution of R code in the browser (via WebAssembly and service workers) without the need for a centralized server.
The presentation will cover the technical foundation of {shinylive}, including its architecture and the integration process with Quarto documents. We will also discuss the practical aspects and drawbacks of exporting Shiny apps with {shinylive}, highlighting the ease of exporting apps to a folder for local use or hosting them on GitHub pages.
{shinylive} bridges the gap between Shiny and static websites, making it a valuable resource for interactive data analysis and presentation.
Link to app: https://schloerke.com/presentation-2024-04-18-appsilon-shinylive/ Link to script: https://github.com/posit-dev/r-shinylive/blob/main/examples/deploy-app.yaml Link to use_github_action(): https://github.com/posit-dev/r-shinylive#github-pages Shinylive website: https://posit-dev.github.io/r-shinylive/ {webr} docs: https://docs.r-wasm.org/webr/latest/
