feat: implement complete web push notification system
- Add self-hosted push notifications using VAPID (no external services) - Create PushSubscription model in database - Implement server-side push logic with web-push library - Add notification helpers for list events (items, invitations, collaborators) - Create NotificationSettings UI component for profile page - Add usePushNotifications React hook for subscription management - Create API routes for subscription management and VAPID key - Update service worker with push event handlers - Integrate notifications into item actions (add, remove, complete) - Integrate notifications into sharing actions (invite, accept, remove) - Add VAPID key generation script - Add comprehensive documentation and setup guides Notifications are sent when: - Items are added/removed/completed in shared lists - Users are invited to lists - Invitations are accepted - Collaborators are removed from lists Works on iOS 16.4+ (when installed to home screen), Android, and desktop browsers.
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
"db:studio": "prisma studio",
|
||||
"db:migrate": "npx tsx scripts/migrate-lists.ts",
|
||||
"icons:generate": "node scripts/generate-icons.js",
|
||||
"icons:info": "node scripts/svg-to-png.js"
|
||||
"icons:info": "node scripts/svg-to-png.js",
|
||||
"vapid:generate": "node scripts/generate-vapid-keys.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@auth/prisma-adapter": "^2.11.1",
|
||||
@@ -25,6 +26,7 @@
|
||||
"next-auth": "^4.24.5",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"web-push": "^3.6.7",
|
||||
"zod": "^4.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,6 +34,7 @@
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@types/web-push": "^3.6.3",
|
||||
"@vitest/ui": "^4.0.14",
|
||||
"autoprefixer": "^10.0.1",
|
||||
"eslint": "^8",
|
||||
|
||||
Reference in New Issue
Block a user