Skip to content

feat: web push notifications service (closes #16)#42

Open
Yunaido wants to merge 2 commits into
mainfrom
feat/push-notifications
Open

feat: web push notifications service (closes #16)#42
Yunaido wants to merge 2 commits into
mainfrom
feat/push-notifications

Conversation

@Yunaido

@Yunaido Yunaido commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Closes #16

Summary

Implements a notification service so users can receive real-time updates about tournament events on desktop browsers and mobile devices, even when the app isn't focused.

What's included

  • Web Push (VAPID + pywebpush) — server-side dispatch via accounts/notifications.py; VAPID keys generated by the generate_vapid_keys management command.
  • Service worker (static/js/sw.js) — handles push events and notification clicks (deep-links to the relevant page).
  • Client subscribe flow (static/js/push-notifications.js) — registers the SW, requests permission, and stores the subscription.
  • Models & migrationPushSubscription and NotificationPreferences (per-user opt-in per event type).
  • Preferences UI — new section on the Security page plus dedicated notification_preferences.html template.
  • Event triggers — match start, match result posted, new tournament created, admin announcements (wired into tournaments/views.py and tournaments/pairing.py).
  • E2E coveragee2e/tests/notifications.spec.ts covers the subscription flow and preference toggles; security.spec.ts updated for the new section.

Issue checklist

  • Browser notifications via the Notification API
  • Smartphone push via Web Push + Service Worker
  • Subscriptions stored per user
  • Backend triggers on tournament events
  • Per-user enable/disable + per-event-type preferences

Implements browser and smartphone push notifications via the Web Push
API and a service worker, addressing issue #16.

- PushSubscription and NotificationPreferences models with migration
- VAPID key generation management command and pywebpush integration
- Service worker (sw.js) and client subscribe/unsubscribe flow
- Notification preferences UI on the security page
- Server-side dispatch on key tournament events (match start, results,
  tournament created, admin announcements)
- E2E tests covering subscription flow and preferences
@Yunaido Yunaido enabled auto-merge (squash) May 14, 2026 12:11
@Yunaido Yunaido disabled auto-merge May 14, 2026 12:12
Co-authored-by: Yunaido <33319800+Yunaido@users.noreply.github.com>
@gitguardian

gitguardian Bot commented May 14, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
32153565 Triggered Vapid Key 4a86ac4 compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copilot AI commented May 14, 2026

Copy link
Copy Markdown
Contributor

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Notification Service for Browser & Smartphone

2 participants