A real-time collaborative text editor that allows multiple users to edit documents simultaneously using advanced conflict resolution algorithms. Built with Qt (C++) for the frontend and Python WebSockets for the backend.
- Real-time Collaboration: Multiple users can edit the same document simultaneously
- Conflict-Free Editing: Uses RGA (Replicated Growable Array) algorithm for seamless conflict resolution
- Rich Text Formatting: Support for bold, italic, underline, and text alignment
- File Operations: Create, open, save, and save as functionality
- Client Identification: Automatic assignment of unique client IDs (A, B, C, etc.)
- Version Vector Synchronization: Advanced synchronization mechanism for concurrent edits
- Cross-platform: Works on Windows, macOS, and Linux
- Frontend: Qt 6.x (C++) with rich text editing capabilities
- Backend: Python WebSocket server for real-time communication
- Algorithm: RGA (Replicated Growable Array) for conflict-free replicated data types (CRDT)
- Networking: WebSocket protocol for low-latency real-time updates
- Qt 6.x with Qt WebSockets module
- Python 3.7+ with the following packages:
asyncio(built-in)websocketsjson(built-in)
- Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
- Minimum 4GB RAM
- Network connectivity for collaboration features
- Download Qt Online Installer from qt.io
- Create a Qt account and accept terms and conditions
- Select Custom Installation
- Choose Qt 6.8.x and ensure Qt WebSockets module is selected
- Complete the installation
pip install websocketsgit clone https://github.com/TahaZahid05/edit-together.git
cd edit-together- Open a terminal and navigate to the project directory
- Start the Python WebSocket server:
python server.py
- You should see:
WebSocket Server Started on ws://0.0.0.0:12345
- Open Qt Creator
- Open the project file
HelloWorld.pro - Build the project: Build → Build All Projects
- Run the application: Build → Run
- Start the server (as described above)
- Launch multiple instances of the client application
- Each client will automatically connect and receive a unique ID (A, B, C, etc.)
- Start editing - changes will be synchronized in real-time across all connected clients
- Use the formatting toolbar for rich text features
edit-together/
├── main.cpp # Application entry point
├── MainWindow.h/.cpp # Main window and UI logic
├── ds2_proj.h # RGA algorithm implementation
├── mainwindow.ui # Qt UI design file
├── server.py # Python WebSocket server
├── HelloWorld.pro # Qt project configuration
├── resources.qrc # Qt resources file
├── HelloWorld_en_GB.ts # Translation file
└── icons/ # Application icons
The Replicated Growable Array (RGA) is a conflict-free replicated data type (CRDT) that enables multiple users to edit a document simultaneously without conflicts. Key features:
- Unique Identifiers: Each character has a unique ID
- Version Vectors: Track the state of each client
- Tombstone Deletion: Deleted characters are marked but not removed
- Deterministic Ordering: Ensures consistent document state across all clients
- WebSocket Communication: Real-time bidirectional communication
- JSON Messages: Structured message format for operations
- Client Management: Server tracks connected clients and assigns unique IDs
- Message History: New clients receive full document state upon connection
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project was developed as part of a research study on collaborative editing algorithms and conflict-free replicated data types (CRDTs). The implementation demonstrates practical applications of distributed systems concepts in real-time collaborative software.
Server won't start:
- Ensure Python 3.7+ is installed
- Check if port 12345 is available
- Install websockets:
pip install websockets
Client won't connect:
- Verify server is running
- Check firewall settings
- Ensure Qt WebSockets module is installed
Build errors:
- Update Qt to version 6.x
- Verify Qt WebSockets module is available
- Check C++17 compiler support
For questions, issues, or contributions, please open an issue on GitHub or contact the development team.