Real-time Inbox (Pusher)
Relevant source files
The following files were used as context for generating this wiki page:
The Real-time Inbox system in KudosWall is designed to provide immediate updates to the user dashboard when new social proof—such as text or video testimonials—is received. By leveraging a real-time communication layer, the platform ensures that founders and marketing teams can triage and manage incoming content without manual page refreshes.
This system integrates with the broader System & Monorepo Architecture to bridge the gap between visitor submissions on public collection pages and the administrative dashboard. It supports high-performance triage workflows, including keyboard-driven actions for approving or rejecting content.
Sources: README.md:1-20, README.md:46-51
Architectural Overview
The real-time infrastructure utilizes a pub/sub model to broadcast events from the server to the client. When a visitor submits a testimonial, the server processes the data through the tRPC API layer, persists it in the Neon Postgres database, and simultaneously triggers an event via Pusher.
This diagram illustrates the flow of data from a visitor's submission to the live update on the administrator's dashboard.
Sources: README.md:82-101, AGENTS.md:45-50
Event Lifecycle and State Updates
When the testimonial_received event is triggered, the system updates the count and state of the user's workspace. This is synchronized with external marketing loops to ensure consistency across the platform's operational and marketing layers.
| Event Name | Source | Trigger Condition | Data Payload |
|---|---|---|---|
project_created | apps/web/src/app/dashboard/actions.ts | New project saved | Project ID, Workspace ID |
testimonial_received | apps/web/src/lib/email-helpers.ts | Form submission success | Testimonial ID, Status |
widget_created | packages/api/src/routers/widget.ts | New widget generated | Widget ID, Type |
Sources: loops-email-collection.md:42-55
Inbox Triage and Interaction
The Real-time Inbox is optimized for rapid moderation. Administrators can utilize keyboard-driven triage to manage the flow of content received through the real-time layer.
Keyboard Shortcuts
The inbox interface supports specific hotkeys to improve the speed of the "Zero to Hero" social proof workflow:
J/K: Step through or highlight testimonials in the list.A: Instantly approve the highlighted testimonial.R: Reject the highlighted testimonial.
Sources: README.md:50-51, README.md:166-174
Data Fetching and Caching
To maintain high performance, the inbox utilizes unstable_cache for project data and testimonial lists. This ensures that while updates are real-time, the heavy database queries are optimized to prevent latency.
The sequence shows how the system balances real-time responsiveness with efficient data retrieval.
Sources: apps/web/src/app/wall/[slug]/page.tsx:64-124, AGENTS.md:56-60
Implementation Standards
Implementing real-time features follows strict monorepo rules to maintain type safety:
- Business Logic: Real-time event triggers are defined within
packages/apior shared library helpers. - UI Updates: The
apps/weblayer handles the subscription to channels and UI state transitions. - Type Safety: All event payloads are validated using Zod to ensure the client-side handlers receive expected data structures.
Sources: AGENTS.md:12-16, AGENTS.md:38-43, AGENTS.md:105-115
Summary
The Real-time Inbox powered by Pusher is a critical component of KudosWall's elite SaaS experience. By enabling instant feedback loops between visitor submissions and administrative actions, it allows users to manage social proof with minimal friction. This system, integrated with the monorepo's tRPC and Drizzle ORM layers, ensures that the platform remains both highly performant and easy to scale.