I spent a year building Kobin — an agency operating system that replaces Slack, Notion, HubSpot, Linear, and Buffer. The inbox was the hardest part to build. Here’s how it works technically.
The architecture
The inbox uses Supabase Realtime WebSocket channels. Each room (project room, group chat, DM) gets its own channel subscription. Switching rooms tears down the old channel and creates a new one — this keeps memory clean and avoids stale message states.
Messages load the last 20 first. Older messages load on scroll-up demand with no flash to top. An animated skeleton UI shows while rooms are loading.
The features that were harder than expected
Replies — storing the quoted message as a nested reference without blowing up query complexity. We denormalize the preview text at write time.
Unread badges — tracked via last_read_at timestamp per user per room. Simple in theory, surprisingly tricky when you have real-time updates coming in while the user is actively reading.
@ai mentions — when a message contains @AI, the server assembles a full context payload (project status, last 20 messages, open tasks, upcoming meetings, vault items) and sends it to the model. The response streams back as a message in the thread with a purple avatar.
File attachments — images open in a full-screen lightbox with download. Office docs and PDFs get a preview card. ZIPs show a file icon with size.
Why I built it instead of using Slack
Slack’s AI sees messages. Asana’s AI sees tasks. Notion’s AI sees documents. None of them see the full picture.
When everything — messages, tasks, files, meetings, CRM contacts — lives in the same schema, the AI actually has something to work with. That’s the whole point of building the inbox as part of a unified workspace rather than integrating with Slack.
Performance
Room list loads with 5 total queries regardless of how many rooms exist. This took several iterations to get right with Supabase RLS policies in play.
The full product
The inbox is one of 8 modules in Kobin. The others: Vault (Google Drive-backed), Tasks, CRM, Client Portal, Calendar, LinkedIn Studio, and an AI layer in development.
Full writeup on the problem it solves (with data): https://www.kobin.team/blog/the-283-problem
Waitlist if you run an agency: https://www.kobin.team
Happy to go deeper on any of the technical decisions in the comments.
Top comments (0)