Debug Mode
BH · Bank Holiday (England & Wales)
Friends
Manage rota sharing and requests
Manage rota sharing and requests
My Duty is an unofficial, independently developed application. It is not affiliated with, endorsed by or supported by Stagecoach or DAS-Web.
Historical README (original behaviour)
An easier, installable view of the Stagecoach DAS-Web duty rota, with paid time, pay estimates, duty sheets and friend sharing. Unofficial: always check DAS-Web for your official duties. ## For drivers - **Today** box: duty number and on-off times (RD / LD / SP etc. shown as-is). Tap the duty number to open the duty sheet. - **Calendar**: tap a day for details; arrows change month; the refresh button reloads (also automatic after 30 minutes). - **Paid time**: from the depot duty sheets (Mon-Fri, Sat, Sun). A red `?` means the sheet's times differ from DAS-Web. - **Pay estimates**: enter hourly rates in settings (Mon-Fri, Sat, Sun, bank holiday, overtime). Add overtime hours per day. Weeks run Sunday to Saturday. - **Friends**: the people button shares your rota via a 12-character code, and adds friends' codes. Friends see only name, duty numbers, on/off times and day codes. - An in-app **Help & privacy** page is under the settings cog. ## Privacy - Login is stored on the phone only and sent over HTTPS to this app's own Worker, which logs in to DAS-Web and keeps nothing. - Sharing stores only name + duty numbers + on/off times + day codes (never pay or login) in a KV store. "Stop sharing" deletes it. Records expire after 60 days of no updates.
## Deploying (Cloudflare Pages, free) 1. Upload `myduty-upload.zip` to a Pages project (Workers & Pages -> Create -> Pages -> Upload assets). It contains `_worker.js` (the app + login helper), a placeholder `index.html`, and `sheets/` (duty sheet page images). 2. For sharing: create a KV namespace, then in the Pages project add a KV binding with variable name `SHARE` and redeploy. 3. Open the Pages address, log in, and "Install app" / "Add to Home Screen". 4. After an update, close and reopen the app twice to load the new version. ## Updating the duty sheets ``` python3 tools/extract_duties.py mon-fri.pdf sat.pdf sun.pdf # writes src/duties.json + sheets/*.webp tools/make_zip.sh # builds ../myduty-upload.zip ``` Needs `pdftotext`, `pdftoppm` (poppler) and Python Pillow. ## Project layout - `src/` app files: `index.html`, `app.js`, `parser.js` (reads the DAS-Web page), `worker.src.js` (login + sharing API), `sw.js`, `manifest.json`, `duties.json`, `version.txt` - `build.js` builds `worker.js` from `src/`; `tools/` sheet extraction and zip scripts - `test/` `node test/test.mjs` (parser + login flow against a mock DAS-Web), `node test/share.mjs` (sharing API), `node test/variants.mjs` (odd day cells)
Unofficial app – not affiliated with Stagecoach