Minimal personal PWA + Web Push bridge for sending notifications from a terminal to an installed mobile web app, with no server-side database.
Demo
side_by_side.mp4
How it works
- The installed PWA subscribes the phone to Web Push.
- You copy the subscription JSON from the phone and save it on your Mac.
POST /v1/:VAPID_PUBLIC_KEYsends a message and that subscription to Web Push.- The service worker shows the notification and stores it locally in IndexedDB with a timestamp.
Local development
-
Generate VAPID keys:
npx web-push generate-vapid-keys
-
Create
.env.localfrom.env.example. -
Set a strong
API_TOKENfor send requests. -
Install dependencies:
-
Run with Vercel dev:
Deploy
- Import this folder into Vercel.
- Add the same environment variables in Vercel project settings.
- Deploy.
- Open the deployed URL on iPhone Safari.
- Use
Share -> Add to Home Screen. - Launch the installed app and tap
Enable Push. - Tap
Copy Subscription JSONand save that JSON on your Mac assubscription.json.
The app uses the provided drricon-light PNG/SVG assets for the manifest, home screen icon, and notification icon.
Send a notification
DRRDRR_BASE_URL=https://drrdrr.vercel.app \
DRRDRR_VAPID_PUBLIC_KEY=YOUR_VAPID_PUBLIC_KEY \
DRRDRR_API_TOKEN=YOUR_API_TOKEN \
DRRDRR_SUBSCRIPTION_FILE=./subscription.json \
node scripts/push.mjs "Hello from Node"Notes
- On iOS, Web Push requires iOS 16.4+ and an installed Home Screen web app.
- The send API now requires both the public VAPID key in the path and a private bearer token in the
Authorizationheader. - The server is stateless. If the phone's push subscription changes, copy the new subscription JSON back to your Mac.