• 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: v68
View latest version
README.md

πŸ”Ά HN Watcher

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

Features

  • Multi-user β€” sign in with Val Town, each user has their own watch list
  • Watch HN users β€” get notified on new posts, comments, karma changes, profile edits
  • Watch HN items β€” track score changes, new comments on stories
  • Real-time via Firebase SSE β€” browser connects directly to Firebase for instant updates
  • Web Push notifications β€” native browser notifications even when tab is closed
  • Interval backup poller β€” catches everything every 5 minutes when no browser is open

Architecture

Rendering mermaid diagram...

How It Works

  1. Sign in with your Val Town account
  2. Add HN usernames or item IDs to your personal watch list
  3. The browser opens EventSource connections directly to Firebase for each watched entity
  4. When Firebase pushes changes, the client-side diff engine detects what changed
  5. Changes are reported to the backend, stored per-user in SQLite, and trigger Web Push notifications
  6. When the browser is closed, the interval val polls every 5 min and sends push to all affected users

Setup

  1. Go to /setup to generate and save VAPID keys (needed for Web Push)
  2. Open the dashboard at /
  3. Sign in with Val Town
  4. Click "Enable Notifications" for Web Push
  5. Add HN usernames or item IDs to watch

Env Vars

  • VAPID_KEYS β€” ECDSA P-256 keypair in JWK format (generate at /setup)
  • 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.