Collaborative Editing: A CRDT implementation
A simple list-based CRDT to implement collaborate editor, please go to /CRDT
folder for more information.
Assume end users are talking to two data centers and there is a network partition. Commit means the replica is pushing operations to other replicas. Sync means the replica is receiving updates from other replicas. The system is not real-time, each step requires a click.
Will make sure:
For live demo, please play here.
Please also refer to this blog.
My initial design was to utilize user system and make people really collaborate over browsers. According to the limited time for this project, I compromised and only implemented a naive demo with two editors inside.
$ npm install
$ npm run first-time-setup
$ npm start
Point your browser to http://127.0.0.1:8000/.
nodemon
watches for changes in server code
and restarts the app automatically. gulp
andwebpack
watch the front-end files and
re-build those automatically too.
$ node server.js
Use forever
to run the application in background!
$ npm install -g forever
$ forever start server.js
This doesn’t watch for file changes. Also be sure to set
these environment variables in your production environment:
NODE_ENV=production
- This is important for many different optimizations,NPM_CONFIG_PRODUCTION=false
- This tells $ npm install
to not skipdevDependencies
, which we need to build the front-end files.