How jupyterlite/demo works
Project Type & Purpose
• This is a static site demo of JupyterLite—a 100% client-side Jupyter distribution that runs entirely in the browser (no Python server).
• It showcases three kernels (Pyodide/Python, JavaScript, p5) and example notebooks & data under content/.
• It is built and deployed automatically to GitHub Pages via a GitHub Actions workflow.
File Structure Highlights
Top-level:
• .github/workflows/deploy.yml → CI/CD pipeline that builds and pushes the static site to the gh-pages branch.
• repl/jupyter-lite.json → JupyterLite configuration (which kernels/extensions to include).
• content/ → All example notebooks (.ipynb) and data files served by the site.
• requirements.txt → Lists Python-side dependencies baked into the Pyodide environment.
• .nojekyll → Ensures GitHub Pages serve raw files without Jekyll processing.
Key Architectural Patterns
• Static-site architecture: source repo → CI build → GitHub Pages (CDN) → browser.
• Client-side compute: WebAssembly (Pyodide) loads in browser, runs Python.
• Modular kernels: each kernel (Python, JS, p5) is an independent WASM/JS bundle loaded on demand.
Main Components & Interactions
a. Developer/GitHub Repo
– Hosts source: content, config, notebook assets, workflow.
– Push triggers GitHub Actions.
b. CI/CD (GitHub Actions)
– deploy.yml job:
· Installs build dependencies
· Invokes JupyterLite build (bundles HTML/JS/CSS + kernels + content)
· Publishes to gh-pages branch
c. Hosting (GitHub Pages / CDN)
– Serves static files over HTTPS.
– .nojekyll ensures direct file access.
d. Client (Browser)
– Downloads HTML/CSS/JS assets.
– JupyterLite front-end initializes.
– Loads kernels:
· Pyodide Kernel: Python via WebAssembly + requirements.txt libs
· JavaScript Kernel: pure JS REPL
· p5 Kernel: p5.js graphics demos
– Loads notebook UI, mounts content/ as file system.
– User interacts with notebooks; code sends messages to kernels via in-browser messaging.