Skip to content

[weather-voodoo] Watch a place & notify on a good window (Web Push) #20

Description

@radumarias

Right now the user has to remember to come back and check. A "ping me when the window opens" feature is the only thing that turns this from a tool you use once into one you keep installed.

Goal

Let the user subscribe a saved location + threshold and receive a Web Push notification when a matching window appears within the forecast horizon.

Example subscription

Phi Phi · sea · 4h window · score ≥ 80 · within next 3 days

Scope

  • UI: "🔔 Watch this place" button on a forecast view; opens a small modal to set duration, mode, score threshold, lookahead.
  • Web Push permission request and PushSubscription capture.
  • Server side:
    • Storage for subscriptions (Vercel KV is gone; use Marketplace Postgres / Upstash Redis).
    • Cron job (crons in vercel.ts) every 30 min that re-fetches each subscribed location, runs the same findBestWindows logic, and emits a push if a window passes the threshold and hasn't been notified for this 24h slot already.
  • VAPID keys + web-push library on the server.
  • Unsubscribe link in each notification.

Out of scope

  • iOS < 16.4 doesn't support Web Push; treat as graceful degradation.

Effort

Large. Touches infra (cron + KV/Postgres), client (notification permission UX), and a non-trivial scheduler. Worth doing only after #15 (saved locations) and #19 (tides if marine-focused).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions