> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat apps

> Prompts for real-time messaging — channels, threads, presence, attachments.

Chat apps lean heavily on Convex's real-time sync. Foundation prompt:

```text theme={null}
**Goal**: Real-time team chat with channels, messages, and presence.

**User**: Workspace members; each channel scoped to a workspace.

**Data**:
- `channels`: { workspaceId, name, slug, isPrivate, createdAt }
- `messages`: { channelId, authorId, content, attachments, createdAt }
- `channelMembers`: { channelId, userId, lastReadAt }

**Behavior**:
- Sidebar lists channels in the active workspace
- Click channel → message list (newest at bottom)
- Type and press Enter to send (Shift+Enter for newline)
- Unread indicator per channel based on lastReadAt
- Show presence: avatars of users currently in the channel

**Constraints**:
- Real-time updates via Convex reactive queries
- Message list virtualized for performance (1000+ messages)
- Markdown rendering in messages
```

## Variations

<Tabs>
  <Tab title="Threads">
    Add: each message can have a thread. Replies go in a side panel.
  </Tab>

  <Tab title="Reactions">
    Add: emoji reactions on each message. Aggregated count + names of reactors.
  </Tab>

  <Tab title="DMs">
    Add: 1:1 conversations between users, separate from channels.
  </Tab>

  <Tab title="Search">
    Add: full-text search across all channels the user has access to.
  </Tab>
</Tabs>

## Related

<CardGroup cols={3}>
  <Card title="Real-time chat recipe" icon="message-square-text" href="/recipes/realtime-chat-app">
    Full build walkthrough.
  </Card>

  <Card title="Real-time sync patterns" icon="zap" href="/architecture/realtime-sync-patterns">
    Architectural patterns.
  </Card>

  <Card title="Five-layer method" icon="layers" href="/prompting/the-five-layer-method">
    The framework.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.