Skip to content

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:

  1. Scaffold with Redis: pondoknusa new my-app --redis
  2. Set BROADCAST_CONNECTION=websocket in .env
  3. Register WebSocketBroadcastServiceProvider in src/main.ts
  4. 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

TaskCommand / config
Config cachepondoknusa config:cache
Route cachepondoknusa route:cache
View compile cachepondoknusa view:cache + compiled: true
Deploy gatepondoknusa deploy:check
Queue workerpondoknusa queue:work (separate process)
Graceful shutdownBuilt into serve() / pondoknusa start

Choose a host

GuideBest for
Platform matrixCompare options
RailwayFastest first deploy
Fly.ioMulti-region + Postgres
DockerVPS / Kubernetes
CloudflareCDN + R2 in front of Node
CI/CDGitHub Actions release pipeline
Pondoknusa CloudFuture 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 start

Run 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:

  1. Deploy to Fly or Railway (Node origin).
  2. Add domain in Cloudflare (proxied DNS).
  3. Optional: R2 for uploads via @pondoknusa/storage-r2.
  4. Cache public GETs with ETag middleware.

Details: Deploy with Cloudflare.

Cookbook & reference

Released under the MIT License.