Skip to content

feat: add push_subscriptions table, VAPID config, and web-push depend…#271

Open
Bellamzy wants to merge 1 commit into
codebestia:mainfrom
Bellamzy:feat/push-subscriptions
Open

feat: add push_subscriptions table, VAPID config, and web-push depend…#271
Bellamzy wants to merge 1 commit into
codebestia:mainfrom
Bellamzy:feat/push-subscriptions

Conversation

@Bellamzy

Copy link
Copy Markdown

feat: push subscriptions with VAPID support

Adds the push_subscriptions table and all supporting infrastructure for Web Push notifications.

Changes:

  • Schema — push_subscriptions table tied to user_devices.id (cascade delete) with endpoint, p256dh, auth, createdAt,
    lastUsedAt, disabledAt
  • Migration — 0009_push_subscriptions.sql creates the table with a unique constraint on endpoint and FK to user_devices
  • Dependency — web-push@3.6.7 + @types/web-push@3.6.4 added to backend
  • VAPID config — VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT added to EnvSchema (validated at startup);
    NEXT_PUBLIC_VAPID_PUBLIC_KEY exposed to the browser via next.config.ts
  • Push route — POST /push/subscriptions upserts subscription and sets lastUsedAt; re-subscribing clears disabledAt. Exports
    touchSubscription / disableSubscription helpers for use when sending notifications
  • Env — .env.example updated with all VAPID variables

Testing:

Generate VAPID keys and populate .env before running:

node -e "const wp = require('web-push'); console.log(wp.generateVAPIDKeys())"
closes #234

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Bellamzy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

push_subscriptions schema + VAPID config

1 participant