Build a small, self-hosted team chat: channels, threaded replies, reactions, and search — scoped to a team you already trust, not a public community platform. Use Next.js/TypeScript with WebSockets for live delivery and Postgres as the durable store (every message is written to Postgres first; WebSocket delivery is a notification on top, not the source of truth). Support channels (public within the workspace, or invite-only), threaded replies attached to a parent message, emoji reactions, @mentions with a notification list, and file attachments stored on local disk or S3-compatible storage. Add full-text search across message history using Postgres's built-in search. Implement two roles — owner (can manage members and channels) and member — with an invite-link flow instead of open signup. Send an email digest of unread mentions for members who aren't actively online, so notifications don't depend on a native mobile app. Do not build voice or video calling, native mobile apps, or enterprise SSO/compliance features — those are out of scope; this is a web-only chat for a team small enough to invite by hand. Requires hosting, a domain, and a transactional email provider for the digest — no other external service needed.