Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0eaedb4
feat: ✨ added testing functions
MihaiZecheru May 3, 2026
f454757
feat(db): ✨ add push_subscriptions table and migration for PWA notifi…
ShyamThangaraj May 3, 2026
41820a7
feat(api): ✨ add subscribe and unsubscribe procedures for PWA push no…
ShyamThangaraj May 3, 2026
406ef65
feat(api): ✨ add getSubscription query for PWA push notifications
ShyamThangaraj May 3, 2026
501bd98
feat: ✨ add notification subscribe btn
MihaiZecheru May 3, 2026
8f29295
feat: ✨ add subscribe btn to page (temp)
MihaiZecheru May 3, 2026
92a50a6
feat: ✨ add .env.example vapid data
MihaiZecheru May 4, 2026
ab2a0d4
feat: ✨ add cron job for PWA push notifs
MihaiZecheru May 5, 2026
2d4f90e
feat(next): ✨ style notification bell button and replace alerts with …
ShyamThangaraj May 5, 2026
ddb5226
fix: 🐛 sort devDependencies alphabetically in server package.json
ShyamThangaraj May 5, 2026
a76d472
fix: 🐛 cron jobs were failing due to zod reqs
MihaiZecheru May 5, 2026
ff85fda
fix: 🐛 improve subscribe btn placement
MihaiZecheru May 6, 2026
c110044
fix: 🐛 add vapid keys to env loader
LexTruong May 12, 2026
f95e5e0
fix: 🐛 resolve merge conflicts and regenerate migration for push_subs…
ShyamThangaraj May 19, 2026
eb41399
feat: ✨ add notifications panel, saved_notifications table, subscript…
ShyamThangaraj May 19, 2026
c458db3
feat: ✨ wire notifications panel to DB, add updateSubscription and ge…
ShyamThangaraj May 19, 2026
af02808
fix: 🐛 remove deprecated script
MihaiZecheru May 19, 2026
27ca9f0
feat: ✨ delete PushSubscriptionButton component
MihaiZecheru May 19, 2026
4414b5e
feat: ✨ complete notif subscrbe logic & ark notifs read on open
MihaiZecheru May 19, 2026
9a1d49b
feat: ✨ add script for sending event notifs & update menu script
MihaiZecheru May 19, 2026
568260c
chore(db): :wrench: drop any existing push_sub table before creating it
EightBitByte May 19, 2026
6427691
fix: 🐛 add Lex's new better auth secret
MihaiZecheru May 20, 2026
006aeaf
fix(notifications): 🐛 stop toggle overwrites, and add VAPID keys
TheAbubakrAbu Oct 9, 2026
aa3bcf8
Merge remote-tracking branch 'origin/dev' into pwa-push-notifications…
TheAbubakrAbu Oct 9, 2026
a883f6d
fix(lockfile): 🐛 restore web-push entries lost in the dev merge
TheAbubakrAbu Oct 9, 2026
de0ed05
fix(notifications): 🐛 add a push-only service worker so toggles work
TheAbubakrAbu Oct 11, 2026
6bcaddb
fix(notifications): 🐛 send menu notifications at 7am with event notif…
TheAbubakrAbu Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
DATABASE_URL="postgres://postgres:postgres@localhost:5432/peterplate"
BETTER_AUTH_SECRET=""
BETTER_AUTH_SECRET=""
# Generate both with: npx web-push generate-vapid-keys
NEXT_PUBLIC_VAPID_PUBLIC_KEY=""
VAPID_PRIVATE_KEY=""
2 changes: 2 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
NEXT_PUBLIC_VAPID_PUBLIC_KEY: ${{ secrets.NEXT_PUBLIC_VAPID_PUBLIC_KEY }}
VAPID_PRIVATE_KEY: ${{ secrets.VAPID_PRIVATE_KEY }}
DATABASE_URL: ${{ secrets.PROD_DATABASE_URL }}
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN: ${{ secrets.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN }}
NEXT_PUBLIC_POSTHOG_HOST: ${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
NEXT_PUBLIC_VAPID_PUBLIC_KEY: ${{ secrets.NEXT_PUBLIC_VAPID_PUBLIC_KEY }}
VAPID_PRIVATE_KEY: ${{ secrets.VAPID_PRIVATE_KEY }}
DATABASE_URL: ${{ secrets.DEV_DATABASE_URL }}
NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN: ${{ secrets.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN }}
NEXT_PUBLIC_POSTHOG_HOST: ${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}
Expand Down
3 changes: 2 additions & 1 deletion apps/next/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ DATABASE_URL="postgres://postgres:postgres@localhost:5432/peterplate"
NEXT_PUBLIC_API_URL="/api/trpc"
NEXT_PUBLIC_BASE_URL="http://localhost:3000/"
BETTER_AUTH_SECRET=""
# Generate both with: npx web-push generate-vapid-keys
NEXT_PUBLIC_VAPID_PUBLIC_KEY=""
VAPID_PRIVATE_KEY=""
VAPID_PRIVATE_KEY=""
46 changes: 46 additions & 0 deletions apps/next/public/push-sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Push notifications only. No fetch handler on purpose: service workers
// that handle sign-in requests can break login on Safari.

self.addEventListener("install", () => self.skipWaiting());

self.addEventListener("push", (event) => {
if (!event.data) return;

// Fall back to text: iOS can cancel subscriptions if a push shows nothing.
let payload;
try {
payload = event.data.json();
} catch {
payload = { title: "PeterPlate", body: event.data.text() };
}

event.waitUntil(
self.registration.showNotification(payload.title, {
body: payload.body,
icon: payload.icon || "/icons/icon-192x192.png",
badge: "/icons/icon-72x72.png",
data: { url: payload.data?.url || "/" },
}),
);
});

self.addEventListener("notificationclick", (event) => {
event.notification.close();

const targetUrl = new URL(
event.notification.data?.url || "/",
self.location.origin,
).href;

event.waitUntil(
self.clients
.matchAll({ type: "window", includeUncontrolled: true })
.then((windowClients) => {
const existing = windowClients.find(
(client) => client.url === targetUrl,
);
if (existing) return existing.focus();
return self.clients.openWindow(targetUrl);
}),
);
});
Loading
Loading