Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Real-Time In-Editor Chat System

The in-editor chat system allows collaborators working on the same project to communicate instantly without leaving the editor. The chat is session-based and exists only while users are actively connected to the project.

When a project is opened, the user is automatically connected to the chat room associated with that project.


Overview

  • One chat room per project
  • Users are connected automatically
  • Messages are delivered instantly
  • Chat history is not stored
  • Messages disappear when all users leave

The chat is designed for quick coordination, not long-term discussion.


Technology Used

The chat backend is implemented using:

  • Go for the server
  • Gorilla WebSocket for real-time communication
  • WebSockets for low-latency message delivery

This setup allows fast, reliable message exchange between all collaborators in a project.


How It Works

Automatic Connection

User opens a project
        │
        ▼
Client connects to chat server
        │
        ▼
User joins the project chat room
        │
        ▼
Chat is ready to use instantly

No manual “join” action is required.


Sending Messages

User types a message
        │
        ▼
Message is sent to the server
        │
        ▼
Server relays message to all users in the project
        │
        ▼
Everyone sees the message instantly

Messages are shared only with users who are currently online in the same project(collaborators).


Ephemeral Chat Behavior

The chat system does not store messages.

All users leave the project
        │
        ▼
Chat room becomes empty
        │
        ▼
All messages are discarded

If a user refreshes the page or reconnects later, the chat starts fresh.


Join and Leave Indicators

Users can see when others join or leave the chat in real time.

🟢 Alice joined the chat
🔴 Bob left the chat

This helps collaborators stay aware of who is currently active.


Typical Use Cases

  • Coordinating edits in real time
  • Asking quick questions
  • Notifying others about changes
  • Live discussion during collaboration

The chat is intended to support editing, not replace structured communication tools.


Separation from Document Editing

The chat system is independent from document editing:

  • Document changes are handled by the collaboration engine
  • Chat messages are handled by the chat server

This ensures that chat issues never affect document synchronization.