This is a simple collaborative text editor application built using the Melody WebSocket library in Go.
- Real-time collaboration: Multiple users can edit the same document simultaneously, and their changes are reflected in real-time.
- Basic operations: Users can perform the following operations:
- Add characters
- Delete characters
- Subscribe to the document
- Unsubscribe from the document
-
Clone the repository:
git clone https://github.com/Hallexz/jointInstruments.git
-
Navigate to the project directory:
cd jointInstruments
-
Build the application:
go build -o main .
-
Run the application:
./main
-
Open your web browser and navigate to
http://localhost:5000
. You should see the text editor. -
Open multiple browser windows or tabs to simulate multiple users collaborating on the document.
-
Perform various operations (add, delete, subscribe, unsubscribe) by sending messages in the following format:
- Add character:
add:character
- Delete character:
delete:position
- Subscribe:
subscribe:username
- Unsubscribe:
unsubscribe:username
The operations will be logged in the server console.
- Add character:
You can also run the application using Docker:
-
Build the Docker image:
docker build -t jointInstruments .
-
Run the Docker container:
docker run -p 5000:5000 jointInstruments
-
Open your web browser and navigate to
http://localhost:5000
to access the text editor.
- Melody: A WebSocket library for Go.
If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.