Skip to content

Commit 57f8548

Browse files
committed
Initial commit
1 parent 345b8df commit 57f8548

File tree

8 files changed

+3311
-1
lines changed

8 files changed

+3311
-1
lines changed

README.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# realtime-editor.js
2-
A realtime editor.js collaborative interface based on OT (instead of CRDTs)
2+
A realtime editor.js collaborative interface based on OT (instead of CRDTs). The goal for this repo is simplicity, so people can understand how easy collaborative realtime editing can be using OT (Operational Transforms).
3+
4+
I didn't do much more than setup the basics using editor.js.
5+
6+
If you add editor.js blocks besides headings and text, it will just show that users cursor on that block.
7+
8+
I tested this with 10 clients and there were no issues. Collaborating with more than 10 people would probably melt your users brains before the server would go above 1% usage, so this scales just fine for any sort of document collaboration.
9+
10+
Operational Transforms (OT) are simpler and much faster than CRDTs, and take advantage of structures like JSON.
11+
12+
I implemented this with ShareDB which handles all complexities of OT.
13+
14+
Google Docs and most apps that don't need more than a few dozen collaborators seem to all select OT over CRDT.
15+
16+
# Install
17+
18+
```
19+
npm i
20+
```
21+
22+
# Build
23+
```
24+
npm run build
25+
```
26+
27+
# Start
28+
```
29+
npm start
30+
```

package-lock.json

+2,686
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "collaborative-editorjs",
3+
"version": "1.0.0",
4+
"description": "Collaborative Editor.js implementation using ShareDB",
5+
"main": "server.js",
6+
"scripts": {
7+
"start": "node server.js",
8+
"dev": "nodemon server.js",
9+
"build": "webpack --mode production"
10+
},
11+
"dependencies": {
12+
"@editorjs/editorjs": "^2.28.2",
13+
"@editorjs/header": "^2.8.1",
14+
"@editorjs/list": "^1.9.0",
15+
"@editorjs/paragraph": "^2.11.3",
16+
"express": "^4.18.2",
17+
"reconnecting-websocket": "^4.4.0",
18+
"sharedb": "^3.3.0",
19+
"websocket-json-stream": "^0.0.3",
20+
"ws": "^8.14.2"
21+
},
22+
"devDependencies": {
23+
"nodemon": "^3.0.1",
24+
"webpack": "^5.89.0",
25+
"webpack-cli": "^5.1.4"
26+
}
27+
}

0 commit comments

Comments
 (0)