Public
Likehn-watcher
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v36View latest version
Real-time Hacker News user & item watcher with Firebase SSE streaming and Web Push notifications.
- Watch HN users — get notified when they post, comment, or update their profile
- Watch HN items — track score changes, new comments on stories
- Real-time via Firebase SSE — changes pushed instantly when dashboard is open
- Web Push notifications — native browser notifications even when tab is closed
- Interval backup poller — catches everything every 5 minutes when browser is closed
Rendering mermaid diagram...
- Open the dashboard and add HN usernames or item IDs to watch
- The browser opens EventSource connections directly to Firebase for each watched entity
- When Firebase pushes a
put/patchevent, the client-side diff engine detects changes - Changes are reported to the backend, stored in SQLite, and trigger Web Push notifications
- When the browser is closed, the interval val polls every 5 minutes and sends push notifications
- VAPID keys are pre-generated and stored as env vars
- Open the dashboard and click "Enable Notifications" for Web Push
- Add HN usernames (e.g.
pg) or item IDs (e.g.42424242) to watch
VAPID_KEYS— ECDSA P-256 keypair in JWK formatVAPID_SUBJECT—mailto:contact email for VAPID