Deployment and online execution

Goal

The website should be easy to host, easy to read, and as executable as possible without making the public site brittle. The recommended architecture separates static presentation from interactive compute backends.

Why not run everything directly in the browser?

Stan

Compiling and running realistic Stan models in-browser is not a good target for a public static course website. Compilation cost, security constraints, and browser resource limits make this impractical for serious use.

JAX

JAX depends on XLA-backed transformations and is not a natural fit for Pyodide or browser-only notebooks. Small toy examples may be possible with pure Python replacements, but that would undermine the pedagogical goal of teaching actual JAX.

R

Simple R code can be displayed in Quarto and copied easily, but public multi-user execution requires a hosted backend. Posit Cloud is the most straightforward option for teaching.

Execution targets compared

Option Best for Strengths Limitations Recommendation
GitHub Pages + Quarto Course website Stable, versioned, citation-friendly, low maintenance Static only Use as primary host
Posit Cloud R and Stan labs Excellent for teaching, minimal local setup Not ideal for heavy long-running models Use for course labs
Binder Python/JAX notebooks Zero-install access from repository Cold starts, ephemeral sessions, limited resources Good for lightweight JAX demos
GitHub Codespaces Full stack Closest to a real dev environment Quota and startup cost Best fallback for full reproducibility
JupyterLite / Pyodide Tiny Python demos Runs in browser Poor fit for real JAX, no Stan Use only for trivial non-JAX demos

Files needed for a reproducible repository

This repository already includes the core files for a practical deployment:

_quarto.yml
.github/workflows/publish.yml
bibliography/references.bib
requirements.txt
environment.yml
install.R
labs/

If full Codespaces support is desired later, add:

.devcontainer/devcontainer.json
.devcontainer/postCreate.sh

GitHub pages workflow

The included GitHub Actions workflow in .github/workflows/publish.yml renders the site and deploys _site/ to GitHub Pages on pushes to main.

Steps

  1. Push the repository to GitHub.
  2. Enable GitHub Pages in the repository settings.
  3. Use the GitHub Actions workflow for deployment.
  4. Set the repository URL in _quarto.yml when the final repo name is known.

Best practical hosting pattern

For a serious university course, the best operational compromise is:

  1. Static Quarto site on GitHub Pages for lectures, formulas, references, and navigation.
  2. Posit Cloud workspace containing the R and Stan labs.
  3. Binder or Codespaces badge for JAX/Python labs.
  4. A single source repository so prose, code, references, and environment files evolve together.

This keeps the reading experience fast and stable while still offering authentic execution environments.

Reproducibility checklist

Every lab should have:

  • a single source file or notebook;
  • explicit package requirements;
  • deterministic seeds where appropriate;
  • comments explaining how to run it;
  • expected outputs or diagnostic targets.

Limitations to state clearly to learners

  • Browser-based execution is limited for heavy Bayesian computation.
  • Stan compilation can be slow on teaching platforms.
  • Binder sessions are ephemeral and not suitable for long-running models.
  • JAX examples on CPU are sufficient for pedagogy, but not for large-scale production inference.
Back to top