A basic collaborative code editing and execution system inspired by a design described in this Replit blog post. Note that this does not use a separate proxy server and still has the container manager double as the proxy.
- Client: Allows users to connect to remote directories, trigger file edits and code execution, and runs the OT sync protocol in the background
- Container Manager: Manages containers and proxies client connections to containers
- Containers: Isolated environments that handle file OT operations and code execution, streaming back results to container manager to be proxied back to user
Start Connection Manager
python server/conman.py
Start/Connect Client A
python client/client.py
open:<path_to_project>/example_remote_repo
Start/Connect Client B
python client/client.py
open:<path_to_project>/example_remote_repo
Inspect File We Will Edit
cat:blastoff.lua
Client A Sends Ops to Modify blastoff.lua (adds OT1 tags)
edit:blastoff.lua:[36, "[OT1] ", 55, "[OT1] ", 83, "[OT1] ", 42, "[OT1] ", 680]
Check Client B Has Updated Ops
cat:blastoff.lua
Client B Sends Ops to Modify blastoff.lua (adds OT2 tags)
edit:blastoff.lua:[42, "[OT2] ", 61, "[OT2] ", 89, "[OT2] ", 48, "[OT2] ", 680]
Check Client A Has Updated Ops
cat:blastoff.lua
Client A or B Can Execute The Updated File
run:blastoff.lua
Start/Connect Client C
python client/client.py
open:<path_to_project>/example_remote_repo
See Client C Has Synced Files (should have OT1 and OT2 tags)
cat:blastoff.lua