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
Related code
ConversationViewinapp/(organization)/organizations/[organizationId]/_components/conversation-view.tsx— Composes the message list and input.MessageInputinapp/(organization)/organizations/[organizationId]/_components/message-input.tsx— Owns form state, optimistic updates, mutation handling, and realtime sends.MessageComposerinapp/(organization)/organizations/[organizationId]/_components/message-composer.tsx— Connects the editor, mentions, attachments, and send controls.MessageListinapp/(organization)/organizations/[organizationId]/_components/MessageList.tsx— Loads paginated messages and renders conversation state.MessageIteminapp/(organization)/organizations/[organizationId]/_components/message-item.tsx— Renders message content, reactions, actions, and thread entry points.message.createinapp/router/message.ts— Validates access and content before persisting messages and mentions.ConversationRealtimeProviderincomponents/conversation-realtime-provider.tsx— Applies realtime events to message and thread caches.conversationKeyinlib/conversation.ts— Provides the shared query key and realtime room identity for a conversation.
Related documentation
- Send a message — End-user instructions.
- Edit or delete a message
- React to a message