Bundle Shiny Applications for serving with WebR.

Overview

WebR Bundle

A tool for bundling Shiny Apps with WebAssembly.

R Package

Installation

Install the package from GitHub:

# install.packages("pak")
pak::pak("andyquinterom/webr.bundle")

After installing the package, you need to install the webr-bundle CLI. You can do this by running the following function from R:

webr.bundle::install_from_source()

This will install Rust (if not already installed) and then build and install the webr-bundle CLI.

Usage

Bundle a Shiny App

In order to bundle a Shiny App, it must use renv to manage its dependencies. This is because webr.bundle will use the renv.lock file to discover the dependencies of the app and try to bundle them.

By default, webr.bundle will bundle the app in the current working directory and place the bundled app in the dist directory. You can specify a different app directory by specifying the appdir argument (first argument) and the output directory by specifying the outdir argument (second argument).

# Bundle the app in the current working directory
webr.bundle::build()
# Bundle the app in the my-shiny-app directory and place the bundled app in the my-bundled-app directory
webr.bundle::build("my-shiny-app", "my-bundled-app")

Run a bundled Shiny App

You can run the bundled shiny app with any HTTP server, however, webr.bundle provides a simple HTTP server that can be used to run the app. webr.bundle::serve uses the same API as webr.bundle::build and will build the app if it hasn't been built yet. However, you can also specify a port to bind the HTTP server on.

# Run the bundled app in the current working directory
# on port 8080
webr.bundle::serve()
# Run the shiny app (using WebR) in the my-shiny-app directory
# on port 3000
webr.bundle::serve("my-shiny-app", port = 3000)

CLI

Installation

Build from source

First, install Rust by running the following command in your terminal:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then, clone this repository and cd into it:

git clone https://github.com/andyquinterom/webr.bundle.git
cd webr.bundle

Finally, build the project:

cargo install --path inst/bin/cli

Now you should be able to run the webr-bundle command.

webr-bundle --help

Usage

Bundle a Shiny App

In order to bundle a Shiny App, it must use renv to manage its dependencies. This is because webr-bundle will use the renv.lock file to discover the dependencies of the app and try to bundle them.

To bundle a Shiny App, we need to cd into the app's directory and run the following command:

webr-bundle build

This will create a new dist directory with the bundled app. If you want to specify a different output directory or a different app directory, you can use (-o, --outdir) and (-a, --appdir) respectively.

# ./
# ├── ./my-shiny-app (Directory containing the Shiny App)
# │   ├── app.R
# │   └── renv.lock
# └── ./my-bundled-app (Output directory)
webr-bundle -o my-bundled-app -a my-shiny-app build

Run a bundled Shiny App

You can run the bundled shiny app with any HTTP server, however, webr-bundle provides a simple HTTP server that can be used to run the app.

webr-bundle serve

This command will build the app and serve it at http://localhost:8080. If you want to specify a different port, you can use (-p, --port).

webr-bundle serve -p 3000

You can still use (-o, --outdir) and (-a, --appdir) to specify the output directory and the app directory respectively.

webr-bundle -o my-bundled-app -a my-shiny-app serve
You might also like...
Mod for pxtone Collage that adds some shiny features
Mod for pxtone Collage that adds some shiny features

ptcMod Mod for pxtone Collage that adds some shiny features READ THIS FIRST The program is extremely invasive to ptCollage. This project makes extensi

A shiny new package manager written in rust explicitly for gemlock/linux and it's distributions

Gem A shiny new package manager written in rust explicitly for gemlock/linux and it's distributions. List of content How to setup Systems Ubuntu Arch

Bundle Cargo crates for use with macOS/iOS in Xcode

cargo-cocoapods - Build Rust code for Xcode integration Installing cargo install cargo-cocoapods You'll also need to install all the toolchains you i

A simple and convenient way to bundle owned data with a borrowing type.

A simple and convenient way to bundle owned data with a borrowing type. The Problem One of the main selling points of Rust is its borrow checker, whic

Build, bundle & ship your Rust WASM application to the web.

Trunk Build, bundle & ship your Rust WASM application to the web. ”Pack your things, we’re going on an adventure!” ~ Ferris Trunk is a WASM web applic

CosmWasm smart contract to bundle up cw assets (cw20, cw721, cw1155)

CosmWasm CW Bundler This repo is a CosmWasm smart contract that allows users and other contracts to bundle any combination of cw20, cw721, cw1155 toke

🦀 Example of serving deep learning models in Rust with batched prediction
🦀 Example of serving deep learning models in Rust with batched prediction

rust-dl-webserver This project provides an example of serving a deep learning model with batched prediction using Rust. In particular it runs a GPT2 m

A Demo server serving Bert through ONNX with GPU written in Rust with 3

Demo BERT ONNX server written in rust This demo showcase the use of onnxruntime-rs on BERT with a GPU on CUDA 11 served by actix-web and tokenized wit

Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav...
Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav...

Dufs (Old Name: Duf) Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav... Featur

yeenserve is a web app for serving random photos.

yeenserve yeenserve is a simple web app written in Rust that serves random images from a directory. It was written as the backing application for hyen

OpenAI compatible API for serving LLAMA-2 model
OpenAI compatible API for serving LLAMA-2 model

Cria - Local llama OpenAI-compatible API The objective is to serve a local llama-2 model by mimicking an OpenAI API service. The llama2 model runs on

A file server that supports static serving, uploading, searching, accessing control, webdav...
A file server that supports static serving, uploading, searching, accessing control, webdav...

Dufs Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav... Features Serve static

Efficent platform for inference and serving local LLMs including an OpenAI compatible API server.

candle-vllm Efficient platform for inference and serving local LLMs including an OpenAI compatible API server. Features OpenAI compatible API server p

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).

config-rs Layered configuration system for Rust applications (with strong support for 12-factor applications). Set defaults Set explicit values (to pr

Decentralized Autonomous Applications (DAAs).  Building the Future with Self-Managing Applications.
Decentralized Autonomous Applications (DAAs). Building the Future with Self-Managing Applications.

Decentralized Autonomous Applications (DAAs) Building the Future with Self-Managing Applications. 🤖 Straw Man Code Outline 🤖 Reddit Group 🤖 Twitter

A buildpack for Rust applications on Heroku, with full support for Rustup, cargo and build caching.

Heroku buildpack for Rust This is a Heroku buildpack for Rust with support for cargo and rustup. Features include: Caching of builds between deploymen

 create and test the style and formatting of text in your terminal applications
create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

An extensible open-source framework for creating private/permissioned blockchain applications

Exonum Status: Project info: Community: Exonum is an extensible open-source framework for creating blockchain applications. Exonum can be used to crea

High-performance runtime for data analytics applications

Weld Documentation Weld is a language and runtime for improving the performance of data-intensive applications. It optimizes across libraries and func

Owner
Andrés Felipe Quintero Moreano
Software Developer from Colombia. Rust, R, Web-Dev.
Andrés Felipe Quintero Moreano
Build, bundle & ship your Rust WASM application to the web.

Trunk Build, bundle & ship your Rust WASM application to the web. ”Pack your things, we’re going on an adventure!” ~ Ferris Trunk is a WASM web applic

Anthony Dodd 2.2k Jan 7, 2023
CosmWasm smart contract to bundle up cw assets (cw20, cw721, cw1155)

CosmWasm CW Bundler This repo is a CosmWasm smart contract that allows users and other contracts to bundle any combination of cw20, cw721, cw1155 toke

Peter Kim 5 Jun 26, 2022
yeenserve is a web app for serving random photos.

yeenserve yeenserve is a simple web app written in Rust that serves random images from a directory. It was written as the backing application for hyen

Mystic 3 Nov 30, 2022
🌱🦀🌱 Trillium is a composable toolkit for building web applications with async rust 🌱🦀🌱

?????? Trillium is a composable toolkit for building web applications with async rust ??????

Trillium 243 Jan 2, 2023
Noria: data-flow for high-performance web applications

Noria: data-flow for high-performance web applications Noria is a new streaming data-flow system designed to act as a fast storage backend for read-he

MIT PDOS 4.5k Dec 28, 2022
Layers, extractors and template engine wrappers for axum based Web MVC applications

axum-template Layers, extractors and template engine wrappers for axum based Web MVC applications Getting started Cargo.toml [dependencies] axum-templ

Altair Bueno 11 Dec 15, 2022
Bundle Shiny Applications for serving with WebR.

WebR Bundle A tool for bundling Shiny Apps with WebAssembly. R Package Installation Install the package from GitHub: # install.packages("pak") pak::pa

Appsilon 14 Oct 29, 2023
Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks.

Crates Registry Description Crates Registry is a tool for serving and publishing crates and serving rustup installation in offline networks. (like Ver

TalYRoni 5 Jul 6, 2023
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
a shiny test framework for rust

Ooh, shiny! Shiny makes you less distracted with copying over initialization code in test cases. It also has a fancy syntax similar to Ruby's RSpec or

Vladimir Pouzanov 95 Apr 8, 2022