Skip to content

susom/progress_pwa

Repository files navigation

Empowered Relief — Calm Tool

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


Local development

Requires Docker.

docker compose build
docker compose up

Navigate 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>

Testing the service worker

Service workers only activate in production builds. To test locally:

npm run build
npx serve -s build

Open the printed URL in an incognito window to avoid stale service worker state.

Adding new audio tracks

  1. Drop the audio file (.m4a or .mp3) into src/assets/audio/
  2. Import it in src/views/Home/home.js and add it to the files={[...]} array (order = dropdown order)
  3. Add an entry to AUDIO_LABELS in src/components/MediaController/mediacontroller.js — key is a unique substring of the filename, value is the display label
  4. If the file is over 30 MB, increase maximumFileSizeToCacheInBytes in workbox.config.js
  5. 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.

Deployment

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors