• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
paulkinlan

paulkinlan

hn-watcher

Real-time HN user & item watcher with Firebase SSE + Web Push
Public
Like
hn-watcher
Home
Code
7
database
2
frontend
7
shared
4
README.md
C
check-users.ts
generate-vapid-keys.ts
H
main.tsx
Connections
Environment variables
4
Branches
1
Pull requests
Remixes
History
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v33
View latest version
README.md

🔶 HN Watcher

Real-time Hacker News user & item watcher with Firebase SSE streaming and Web Push notifications.

Features

  • 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

Architecture

Rendering mermaid diagram...

How It Works

  1. Open the dashboard and add HN usernames or item IDs to watch
  2. The browser opens EventSource connections directly to Firebase for each watched entity
  3. When Firebase pushes a put/patch event, the client-side diff engine detects changes
  4. Changes are reported to the backend, stored in SQLite, and trigger Web Push notifications
  5. When the browser is closed, the interval val polls every 5 minutes and sends push notifications

Setup

  1. VAPID keys are pre-generated and stored as env vars
  2. Open the dashboard and click "Enable Notifications" for Web Push
  3. Add HN usernames (e.g. pg) or item IDs (e.g. 42424242) to watch

Env Vars

  • VAPID_KEYS — ECDSA P-256 keypair in JWK format
  • VAPID_SUBJECT — mailto: contact email for VAPID
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.