TeamComms Docs

Message Architecture

How messages move through the TeamComms client, server, database, and realtime layer

Last modified: 11/8/2026

This page documents the message lifecycle for contributors working on the conversation experience.

Architecture

The message flow spans the conversation UI, the typed oRPC route, Prisma persistence, Inngest mention notifications, and the PartyKit realtime room.

Send lifecycle

  • ConversationView in app/(organization)/organizations/[organizationId]/_components/conversation-view.tsx — Composes the message list and input.
  • MessageInput in app/(organization)/organizations/[organizationId]/_components/message-input.tsx — Owns form state, optimistic updates, mutation handling, and realtime sends.
  • MessageComposer in app/(organization)/organizations/[organizationId]/_components/message-composer.tsx — Connects the editor, mentions, attachments, and send controls.
  • MessageList in app/(organization)/organizations/[organizationId]/_components/MessageList.tsx — Loads paginated messages and renders conversation state.
  • MessageItem in app/(organization)/organizations/[organizationId]/_components/message-item.tsx — Renders message content, reactions, actions, and thread entry points.
  • message.create in app/router/message.ts — Validates access and content before persisting messages and mentions.
  • ConversationRealtimeProvider in components/conversation-realtime-provider.tsx — Applies realtime events to message and thread caches.
  • conversationKey in lib/conversation.ts — Provides the shared query key and realtime room identity for a conversation.

Built by Ali1raz. Source on GitHub.

On this page