A Progressive Web Application that provides a real-time notification inbox, powered by MagicBell.
Each visitor gets a unique inbox URL with server-generated authentication. On mobile, the app can be installed as a PWA with push notification support.
- Preact 10 with SSR via
preact-render-to-string - Hono for server-side routing
- Vite 6 with
@cloudflare/vite-pluginand@preact/preset-vite - Tailwind CSS 4 via
@tailwindcss/vite - Cloudflare Workers for deployment
- MagicBell for notifications, inbox UI, and web push
- Node.js 18+
- A Cloudflare account
- MagicBell API credentials (API key and secret)
npm installCreate a .dev.vars file with your MagicBell credentials:
API_KEY=your_api_key
API_SECRET=your_api_secret
npm run devnpm run deployBefore your first deploy, set the production secrets:
npx wrangler secret put API_KEY
npx wrangler secret put API_SECRET- Visiting
/generates a unique ID and redirects to/:id - The worker generates a JWT token for the inbox and SSR-renders the page
- The client hydrates with the MagicBell Inbox component
- On mobile, a dialog prompts to enable push notifications via PWA install
- On desktop, a dialog shows a QR code for mobile setup and a curl snippet for testing
src/
index.tsx # Worker entry point (Hono routes, SSR)
client.tsx # Client entry point (hydration)
App.tsx # Main Preact component
styles.css # Tailwind + MagicBell style overrides
components/ # UI components (Dialog, SendTestButton, etc.)
lib/ # Shared utilities (JWT, echo, badge sync, etc.)
templates/ # Service worker template