← Back to Projects

SupportDesk (Realtime Support + Widget)

Socket.IO support inbox with assignment, tickets, analytics, and an embeddable widget (script + iframe)

Role
Solo
Focus
Realtime messaging, Embeddable widget, Multi-instance scaling
Testing
Playwright E2E (customer→agent flow), Invite acceptance flow, Widget postMessage integration
Key Patterns
Realtime, NestJS, Socket.IO, Redis
RealtimeNestJSSocket.IORedisEmbeddable WidgetPostgresPlaywright

What it does

  • Agents handle customer chats in a real-time inbox (claim/assign/close)
  • Converts conversations into tickets and tracks ticket status/priority
  • Embeds a widget on any site via a single <script> tag (Intercom-lite MVP)
  • Provides analytics and “needs attention” indicators (unreplied customer message)
  • Designed for multi-instance scaling with Redis pub/sub adapter

Architecture

┌────────────────────────┐      ┌────────────────────────┐
│  Vite + React          │─────►│  NestJS API + Gateway  │
│  (Agent UI /inbox)     │      │  REST + Socket.IO      │
└───────────┬────────────┘      └───────────┬────────────┘
            │                               │
            │ widget.js                     │ Prisma ORM
            ▼                               ▼
┌───────────────────────┐      ┌──────────────────────────┐
│  Iframe Widget UI     │◄───► │  Postgres                │
│  /embed/widget        │      │  convos/messages/tickets │
└───────────────────────┘      └────────────┬─────────────┘
                                            │
                                            ▼
                                    ┌──────────────────┐
                                    │  Redis adapter   │
                                    └──────────────────┘

Reliability & Guardrails

  • Room-based realtime model with explicit join/send events and guarded handlers
  • Needs-attention computed from last customer vs agent message timestamps
  • Rate limiting on invites/messages; 429 UX uses Retry-After to inform users
  • Health endpoint checks DB/Redis; deploy artifacts include Docker + healthchecks
  • OpenTelemetry tracing + metrics endpoints (hashed identifiers in spans)

How to demo in 2 minutes

  1. Clone repo and install deps (backend + frontend)
  2. docker compose up -d (Postgres + Redis)
  3. Run Prisma migrate/seed, then start backend + frontend
  4. Login as agent → open Inbox
  5. Open /widget (or embed example) → send message → watch it appear live in inbox
  6. Reply as agent → widget receives reply instantly; try claim/assign flows

Links