Skip to content

Add opt-in game notifications and PWA push support - #63

Open
avatarneil wants to merge 1 commit into
mainfrom
t3code/pwa-game-notifications
Open

avatarneil wants to merge 1 commit into
mainfrom
t3code/pwa-game-notifications

Conversation

@avatarneil

@avatarneil avatarneil commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Adds account-controlled football alerts that can arrive while bracket.build is closed, including when installed as a PWA. Users can follow individual games or teams for specific NFL/FBS seasons and independently select kickoff and major updates for each follow.

Behavior

  • Notifications default off. Settings provide an account-wide pause, explicit device enrollment, permission recovery, device revocation, and an undo for unfollows.
  • Kickoff alerts use a live-feed transition. Major updates cover scoring, lead changes, ties, and finals.
  • Optional recommendations flag postseason games, top-25 matchups, and meetings between teams with winning records shortly before kickoff. Heating-up alerts flag close fourth quarters and overtime once per game. Discovery has separate NFL/FBS selections.
  • Schedule links preselect the game in settings. A PWA manifest, app icons, and a push service worker support installation and links back to the correct game, season, league, and week. iPhone/iPad users receive Home Screen installation guidance.

Delivery and rollout

  • Additive Postgres migration stores preferences, follows, device subscriptions, scoreboard snapshots, events, and delivery claims. Authenticated APIs enforce ownership, input validation, subscription limits, and an allowlist of browser push providers.
  • A production-only, authenticated one-minute Vercel cron detects events and processes the queue. No enabled devices means no ESPN polling. Overlapping runs claim deliveries atomically; transient failures retry up to three times; expired endpoints are removed. Alerts expire after five minutes and old observations never replay scores or kickoffs.
  • VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, and VAPID_SUBJECT are configured in Vercel for production, preview, and development, with separate production/non-production key pairs. Production and preview private keys are stored as sensitive variables. The existing production CRON_SECRET is preserved. Production picks up these settings on the next deployment; the PR preview was redeployed with them. The canonical origin and VAPID contact URI are https://bracket.build. The project is on Vercel Pro, which supports the minute cron.
  • Preview deployments do not dispatch remote alerts. The test button verifies local notification display. Real provider-to-device background delivery, including an installed iOS PWA, still needs verification on a real device.
  • Delivery is bounded to 100 messages per run, ten at a time. Provider acceptance followed by a process crash can cause redelivery; stable tags coalesce notifications where supported. The README documents capacity, setup, timing, and recovery behavior.

Validation

  • Production build, TypeScript, and lint pass (seven existing lint warnings).
  • 51 unit/storage tests and 5 migration/service-worker tests pass, using isolated Postgres 17 with migration retry coverage.
  • All 6 notification scenarios pass in Chromium, Firefox, and mobile Safari simulation; existing account-settings tests pass in Chromium.
  • Axe accessibility checks, keyboard activation, save-failure recovery, enrollment/revocation/sign-out, and 390/1366/2560px layouts checked. T3 browser verification confirmed the active worker, manifest, no horizontal overflow, and 16px form controls.
  • Both lockfiles updated; npm's dry-run install passes. Drizzle reports no schema drift.

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nfl-playoff-bracket Ready Ready Preview Oct 6, 2026 11:47pm UTC

Request Review

@avatarneil avatarneil changed the title t3code/pwa game notifications Add opt-in game notifications and PWA push support Oct 6, 2026

This branch was successfully deployed

1 active deployment
Preview — db59bca8 Deployed Oct 6, 2026 by vercel[bot]
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.

1 participant