A static web app for running daily separation training ladders inspired by Julie Naismith-style sub-threshold protocols, with Firebase cloud sync.
- Builds a daily plan with a configurable number of sessions:
- Random warmups (much shorter than the long target)
- 1 long target session
- Runs a timer and logs outcomes for each step
- Recovers an in-progress or just-finished timer after offline periods, reloads, or mobile tab eviction
- Long-target outcomes use 3 choices: thumbs up, middle, thumbs down
- If the long target is thumbs up, the next day's long target increases by your configured percentage
- If the long target is middle, the next day's long target stays the same as the current long target
- If the long target is thumbs down, behavior is configurable:
- Reduce next target by a configured percentage
- Retry the same target tomorrow
- Syncs state with Firebase so your data is available on phone and desktop
- Create a Firebase project in the Firebase console.
- Enable Authentication -> Sign-in method -> Google.
- Create a Firestore database (Production or Test mode).
- In Firestore Rules, allow users to read/write only their own document path:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/{document=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}- Open firebase-config.js and fill in your web app config values.
- In Authentication -> Settings -> Authorized domains, add your deployed site domain.
- Serve the folder with any static server (or open through your hosting preview).
- Open the app in browser.
- Click
Sign in with Google. - Confirm the cloud badge shows
Cloud sync active.
- Run the full suite with
npm test. - Run only unit tests with
npm run test:unit. - Run the browser smoke test with
npm run test:e2e.
The browser smoke test serves the app locally and stubs Firebase/Chart CDN modules so it can run offline without touching your real backend.
Deploy as a static site to GitHub Pages, Cloudflare Pages, or Netlify.
This repo is set up to publish both environments to the gh-pages branch through GitHub Actions:
maindeploys production to the site rootstagingdeploys staging to/staging/
For a repo named sep, the URLs will be:
- Production:
https://<your-github-user>.github.io/sep/ - Staging:
https://<your-github-user>.github.io/sep/staging/
- In GitHub, open
Settings -> Pages. - Set the source to
Deploy from a branch. - Choose branch
gh-pagesand folder/ (root). - Commit real staging Firebase values into firebase-config.staging.js.
- In Firebase Authentication, add both your production Pages URL and your staging
/staging/URL to Authorized domains or redirect allowlists as needed.
- Push to
mainto update production. - Push to
stagingto update staging. - Test staging on phone by opening the
/staging/URL, starting a timer, backgrounding the browser, toggling offline mode, and reopening the page.
- Keep production and staging on separate Firebase projects.
- The staging deploy reuses the same app files, but swaps in
firebase-config.staging.jsasfirebase-config.jsat publish time. - Both environments live in the same Pages site, so a staging deploy will not overwrite production.
- Keep sessions below panic threshold.
- Firebase web config values are safe to expose in frontend apps.
- This app is a companion tracker, not veterinary or behavioral medical advice.
- You can run more than one ladder per day.
- After completing a ladder, the app shows a completion message and a
Start New Sessionbutton. - Use
Start New Sessionto generate a fresh set of warmups + 1 long target. - The new ladder uses your current
nextLongTarget(including any changes from previous long-session outcomes).