Progressive Web App (PWA) for streaming binaural audio relaxation recordings, used by patients in the Empowered Relief® pain management program at Stanford.
Deployed at: https://calmtool.med.stanford.edu
Requires Docker.
docker compose build
docker compose upNavigate to http://localhost:3000. Note: service workers are disabled in dev mode.
To install new npm dependencies, also run npm install inside the container:
docker exec -it <container_id> sh
npm install <package>Service workers only activate in production builds. To test locally:
npm run build
npx serve -s buildOpen the printed URL in an incognito window to avoid stale service worker state.
- Drop the audio file (
.m4aor.mp3) intosrc/assets/audio/ - Import it in
src/views/Home/home.jsand add it to thefiles={[...]}array (order = dropdown order) - Add an entry to
AUDIO_LABELSinsrc/components/MediaController/mediacontroller.js— key is a unique substring of the filename, value is the display label - If the file is over 30 MB, increase
maximumFileSizeToCacheInBytesinworkbox.config.js npm run build— Workbox picks up the new file automatically
Commit the source files only. The build/ folder is gitignored — GitHub Actions builds and deploys on every push to main.
Pushes to main automatically trigger the GitHub Actions workflow (.github/workflows/progress-pwa.yaml) which builds and deploys to Google App Engine.
To deploy manually:
npm run build
gcloud app deploy app.yaml --quiet