Skip to contents

Starts one multilingual Shiny application backed by SQLite. Open base_url for participants and append /?mod=1 for the moderator. Configuration is resolved at invocation, never at package load time.

Usage

run_app(
  db_path = Sys.getenv("DB_PATH", "data/brainwriting.sqlite"),
  mod_pin = Sys.getenv("MOD_PIN", "635"),
  base_url = Sys.getenv("BASE_URL", "http://localhost:3838"),
  port = Sys.getenv("PORT", "3838"),
  host = "0.0.0.0",
  poll_ms = 2500
)

Arguments

db_path

Main SQLite file path. Defaults to DB_PATH, then "data/brainwriting.sqlite".

mod_pin

Moderator PIN. Defaults to MOD_PIN, then "635". Set a private PIN before deployment.

base_url

Public participant URL used in the QR code. Defaults to BASE_URL, then "http://localhost:3838".

port

Listening port. Defaults to PORT, then 3838.

host

Listening address, default "0.0.0.0".

poll_ms

Database polling interval in milliseconds, default 2500.

Value

Invisibly, the value returned by shiny::runApp() when the app stops.

Details

The main database holds the standard session behind base_url and the catalog of all further sessions. Each further session is a separate SQLite file in a sessions folder next to the main database, with its own address (?s=<code>) and QR code. Moderators create, open, restart, archive and delete sessions in the overview at ?mod=1&view=sessions.

Use exactly one R process per data folder. No replicas or horizontal scaling are supported. A round advances on the next connected client's poll; with no clients connected it advances when someone reconnects. Moderator logins are kept in server memory, so a restart asks for the PIN again.

Examples

if (interactive()) {
  run_app()
}