concord-demo

Standalone static demo — runs entirely in the browser with no server

Role in the system The demo is the real concord-server frontend running on a static host (GitHub Pages) with a mock backend in the browser. Visitors can browse a synthetic BIDS dataset, "download" a subject from the cloud, and open recordings in the full viewer. There is no server and no patient data.

How It Works

concord-demo/build.py copies concord-server/.../static/ verbatim into the site, copies the unmodified server index.html, and injects a few demo-only scripts just before the app's modules. There is no demo-specific index.html or app.js, so the demo cannot drift from the server UI: any change to the server frontend appears in the demo on the next deploy.

The injected scripts replace the backend. demo_api.js patches window.fetch() for /api/* and answers from synthetic data; demo_dataset.js also replaces EventSource for /api/bids/download to simulate the cloud download.

The Visitor Walkthrough

  1. The browser opens at /demo/datasets and lists the Concord Demo Dataset (6 synthetic subjects).
  2. Subject Detail, sessions and recordings behave as on the server. DEMO01 starts as local; the others are cloud.
  3. Clicking a cloud recording opens the download dialog. The simulated download streams progress lines, then the subject flips to local (remembered in localStorage).
  4. Opening a local recording generates its signals (Wendling model, ~1–2 s) and opens the full viewer: time series, PSD, spectrogram, metrics, 3D brain, montages, notch filter, layouts.
  5. Settings → Server explains there is no server to configure.
  6. On a phone or tablet (a viewport under 900 px wide, or a touch-only device) the demo shows a full-screen notice asking the visitor to open it in a desktop browser, with a copy-link button.
  7. The footer says who built the demo and links to Montage Neuroscience; "About this demo" explains what the visitor is looking at, maps each thing to try onto the consulting service it demonstrates, and says which services are not shown.

File Structure

concord-demo/
  build.py            Builds the site (also: --serve PORT to preview locally)
  demo_api.js         Mock concord-server API (fetch patch) for the currently open recording
  demo_dataset.js     Virtual BIDS dataset, download state, simulated download (EventSource)
  demo_signals.js     Synthetic SEEG generator (electrode layouts, Wendling regimes, pink noise)
  demo_ui.js          Footer and "About this demo" dialog (the only UI additions)
  synth.js, dsp.js    Wendling model port; Welch PSD, spectrogram, band power
  CNAME               GitHub Pages custom domain
  measure_amplitudes.js  Node script for tuning channel amplitudes

Synthetic Data

Build and Preview

# From the project root (stdlib only, no install needed):
python concord-demo/build.py --serve 8001   # then open http://127.0.0.1:8001/

Deployment

.github/workflows/deploy-demo.yml runs on pushes to main that touch the server frontend, concord-demo/ or docs/. It builds the site and force-pushes it to the public ewiverson/concord-demo repository (the main repo is private) using a write-enabled SSH deploy key stored as the DEMO_DEPLOY_KEY secret. GitHub Pages serves that repo at the custom domain in CNAME (concord.montageneuroscience.com). This documentation site ships under /docs of the same build.