notifyhub
GraphQL notification service with live subscriptions over WebSocket.
GitHub repo (opens in a new tab) ↗
- License:
- MIT
- CI security:
- CodeQL, dependency-review, gitleaks, npm audit, osv-scanner
~/problem
A single schema, auth model and transport pair for real-time notifications, instead of a REST API with a WebSocket added on the side.
A Node.js and Express service whose whole API is GraphQL: CRUD through queries and mutations, real-time delivery through graphql-ws subscriptions. Users create channels, subscribe, and publish notifications that reach live subscribers; an APNs channel delivers to registered iOS devices.
~/highlights
- Apollo Server 5 with graphql-ws; the WebSocket server uses noServer plus a manual upgrade handler to avoid a double-close crash on shutdown (ADR-004).
- Prisma 7 on PostgreSQL with a generated client and pinned matching CLI, client and adapter versions.
- JWT and bcrypt auth shared across HTTP and WebSocket, with rate limits on both paths.
- ApnsPushChannel implemented against the PushChannel interface, tested with a real local HTTP/2 server and throwaway EC keys.
- CI runs CodeQL, dependency review and a Docker job that boots the runtime image, applies migrations and checks health, a query and SIGTERM exit.
- Integration tests use a real Postgres and a real WebSocket client, run in-band.
~/decisions
From the repo's own decision log, not summarized from memory.
A raw HTTP/2 APNs client, verified without ever holding real Apple credentials
Apple's push API is implemented directly on Node's http2 module rather than adding a dependency. Because http2.connect() picks plaintext or TLS purely from the URL scheme, the test suite runs the identical client against a real local HTTP/2 server, not a mock, while production points the same code at Apple's real endpoint.
~/screenshots
Real captures committed in the repo, not mockups.

Real API output captured from a running instance, not a mockup
~/architecture
- GraphQL endpoint → Services
- Queries and mutations over HTTP with rate limiting.
- Subscription server → PubSub
- graphql-ws over WebSocket with connection cap and upgrade limiter.
- Services → PostgreSQL, PubSub, Push dispatcher
- Users, channels, notifications, device tokens, push dispatch.
- PubSub → Subscription server
- In-process fan-out of published notifications.
- Push dispatcher → APNs
- WebSocket channel plus APNs channel behind one interface.
- PostgreSQL
- Users, channels, notifications, device tokens via Prisma.
- APNs
- Apple push service, reached over HTTP/2 with a signed JWT.
~/stack
- Node.js
- TypeScript
- Express 5
- Apollo Server 5
- graphql-ws
- Prisma 7
- PostgreSQL
- Docker
- Jest
~/status
Complete and documented in project memory. Real APNs credentials are deliberately never present, so the APNs path is tested but not delivered to a device. MIT.
~/related
- notifyhub-ios Native SwiftUI client for notifyhub with APNs push and live subscriptions.