Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith 2f289f1cb6 Add PWA + Web Push delivery for weather alerts (#95)
Make the app installable and deliver existing alert notifications as OS
push, alongside the in-app bell.

Backend:
- PushSubscription model (per-device endpoint + keys, owned by a user) and
  register/unregister/test endpoints under /api/v2/push, cookie-auth scoped
  to the user like the subscription routes.
- push.py: VAPID key management (env -> data/vapid.json -> generated) and a
  pywebpush send helper that reports gone endpoints for pruning. No DB coupling.
- notify.py: after creating an in-app Notification, dispatch Web Push to the
  user's devices (guarded — a push failure never affects the in-app write;
  endpoints reported gone are pruned).
- Serve the .webmanifest with the correct media type.

Frontend:
- manifest.webmanifest + 192/maskable icons; <link rel="manifest"> on all pages.
- sw.js: push + notificationclick handlers (push-only; no fetch caching, so it
  doesn't fight the existing IndexedDB cache). Registered globally in nav.js in
  secure contexts.
- push-client.js + a "Notifications on this device" toggle and test-send on the
  /alerts page, subscribing through the existing cookie-aware apiFetch.

Push and service workers require a secure context, so this is active over HTTPS
(or http://localhost) and cleanly no-ops on a plain-HTTP LAN origin.
2026-07-15 23:21:06 +00:00
tests Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
api_accounts.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
app.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
audit.py Initial commit: app + 2026-07-10 17:29:47 -07:00
climate.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00
db.py Fix mobile alerts dropdown overflow; add account API tests (#93) 2026-07-15 22:00:47 +00:00
grading.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00
grid.py Warm neighbor cells server-side (/cell?neighbors=1) (#51) 2026-07-11 20:47:31 +00:00
migrate.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00
models.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
notify.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
places.py Move the suggestion policy into places.py (#45) 2026-07-11 20:00:24 +00:00
push.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
schemas.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
store.py Compare/calendar mobile polish: overflow fix, sheet load button, 6-yr default, country in names (#80) 2026-07-12 06:32:10 +00:00
users.py Account system with weather-notification subscriptions (#89) 2026-07-15 18:46:46 +00:00
views.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00