The Problem
The browser Push API and service workers already provide everything needed to send a real push notification — but most guides route straight to Firebase Cloud Messaging or OneSignal, adding a vendor dependency and an external account for something the platform supports natively.
The Approach
This demo registers a service worker in the browser (public/sw.js), subscribes it to the Push API, and stores that subscription server-side. A minimal PHP class (SimpleWebPushSender) then sends a real push notification to that subscription using VAPID keys, triggerable either over HTTP (public/push.php) or from the command line (bin/push).
Why It's Structured This Way
Keeping the sender as a small, dependency-light PHP class rather than pulling in a push SDK makes the actual mechanics (subscription storage, VAPID signing, payload delivery) visible and auditable — useful both as a learning reference and as a starting point to embed directly into an existing PHP application without adding a new vendor integration.
The Outcome
A working, open-source reference for web push that a client project can adopt directly when push notifications are needed but a third-party notification vendor isn't wanted or already in the stack.