Skip to content

feat(chat): add ephemeral store-and-forward messaging - #131

Merged
codenamed22 merged 2 commits into
mainfrom
feat/ephemeral-chat
Aug 13, 2026
Merged

codenamed22 merged 2 commits into
mainfrom
feat/ephemeral-chat

Conversation

@codenamed22

Copy link
Copy Markdown
Owner

Summary

  • add authenticated direct and small-group messaging for active ShardUp members
  • persist conversation metadata and transient per-recipient deliveries in PostgreSQL, deleting payloads after browser acknowledgement
  • keep delivered history locally in IndexedDB with reconnect/inbox recovery and idempotent sends
  • add a self-hosted, stateless WebSocket gateway with JWT authentication, origin checks, protected publish access, heartbeats, and hardened Docker deployment
  • add responsive desktop/mobile messaging UI, member-profile entry points, cleanup cron, health checks, and deployment documentation

Architecture

Messages are committed to the transient PostgreSQL inbox before best-effort realtime fan-out. Connected recipients persist envelopes in IndexedDB and ACK them; offline recipients recover the same envelopes from /api/chat/inbox. The final recipient ACK deletes the server payload. Undelivered payloads expire after 30 days.

The WebSocket gateway stores only live socket references. Redis is intentionally deferred until multiple gateway replicas require cross-process fan-out.

Deployment

  • migration: 20260808120000_add_ephemeral_chat
  • required app variables are documented in .env.example
  • gateway Docker/Caddy setup is documented in docs/chat-gateway.md
  • Vercel cron calls /api/cron/chat-cleanup daily

Verification

  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run test:unit — 120 tests passed
  • full Playwright suite — 30 tests passed against local PostgreSQL with a clean fake-judge server
  • npm run build
  • authenticated public WebSocket publish/receive smoke test passed against the deployed gateway

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shardup-site Ready Ready Preview Aug 13, 2026 7:20pm

@codenamed22
codenamed22 merged commit 7a40981 into main Aug 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant