4. Realtime & deploy
Broadcast domain events to the browser and ship to production.
WebSocket broadcasting
Since v0.13.0, Pondoknusa ships a native WebSocket hub (@pondoknusa/broadcasting-websocket) — no Socket.io or Pusher.
Follow the full Broadcasting & realtime guide for config, channel auth, Echo client setup, and nginx proxy notes.
Quick checklist:
- Scaffold with Redis:
pondoknusa new my-app --redis - Set
BROADCAST_CONNECTION=websocketin.env - Register
WebSocketBroadcastServiceProviderinsrc/main.ts - Define channels in
routes/channels.ts(private channel prefixes ship in current scaffolds since v0.16)
examples/hello-world does not include broadcasting yet — use a --redis scaffold or the realtime Echo recipe for a minimal client.
Production checklist
| Task | Command / config |
|---|---|
| Config cache | pondoknusa config:cache |
| Route cache | pondoknusa route:cache |
| View compile cache | pondoknusa view:cache + compiled: true |
| Deploy gate | pondoknusa deploy:check |
| Queue worker | pondoknusa queue:work (separate process) |
| Graceful shutdown | Built into serve() / pondoknusa start |
Choose a host
| Guide | Best for |
|---|---|
| Platform matrix | Compare options |
| Railway | Fastest first deploy |
| Fly.io | Multi-region + Postgres |
| Docker | VPS / Kubernetes |
| Cloudflare | CDN + R2 in front of Node |
| CI/CD | GitHub Actions release pipeline |
| Pondoknusa Cloud | Future managed platform |
Manifests: examples/hello-world/deploy/.
Minimum production boot:
bash
export NODE_ENV=production APP_DEBUG=false
export PONDOKNUSA_HOST=0.0.0.0 PONDOKNUSA_PORT=${PORT:-3000}
pondoknusa migrate
pondoknusa config:cache && pondoknusa route:cache && pondoknusa view:cache
pondoknusa startRun pondoknusa queue:work in a separate process when using the database or Redis queue.
Cloudflare in one minute
Full Pondoknusa does not run on Workers yet. The recommended pattern:
- Deploy to Fly or Railway (Node origin).
- Add domain in Cloudflare (proxied DNS).
- Optional: R2 for uploads via
@pondoknusa/storage-r2. - Cache public GETs with ETag middleware.
Details: Deploy with Cloudflare.