Delicious collaboration framework
sundae-collab is a set of tools that enable app developers to add collaboration over JSON documents to their client applications. The core of the collaboration system is sundae-server. It communicates with clients over web sockets and manages resource collaboration sessions. Operational Transformation algorithm ensures that local resource copies stay in sync.
This repository can be built into a docker image. Simply use https://github.com/prk3/sundae-collab-server.git
as a build path. Alternatively, you can clone this node project, install dependencies with npm install
, build the app with npm run build
and run it with npm run start
. The server listens on port 8100
by default, but you can override this with PORT env variable.
For the client integration, you can use sundae-collab-react with React apps or sundae-collab-client with vanilla javascript.
Yes. Use this docker-compose file to run sundae-collab-server, sundae-collab-demo-client, sundae-collab-demo-api and postgress. Open localhost:8200 and test collaboration on cooking recipes!
version: '3'
services:
postgres:
image: postgres:12.1
environment:
POSTGRES_PASSWORD: postgres
server:
build: https://github.com/prk3/sundae-collab-server.git
ports:
- "8100:8100"
environment:
NODE_ENV: "development" # to allow cross origin requests
LOG: warning
demo-api:
build: https://github.com/prk3/sundae-collab-demo-api.git
ports:
- "8000:8000"
depends_on:
- postgres
environment:
DB_HOST: postgres
NODE_ENV: "development" # to allow cross origin requests
demo-client:
build: https://github.com/prk3/sundae-collab-demo-client.git
ports:
- "8200:8200"
Before you run sundae-collab-server locally, copy example.env
file to .env
. The server respects the following env variables:
- NODE_ENV - environment - development / production / test (default = "production")
- PORT - defines port the server will run on (default = 8100)
- LOG - override of winstons's log level (default = "warning" in production, "debug" in development, undefined in test)
In the project directory, you can run:
Runs the server in development mode. Reload the app whenever source files change.
Compiles source files to build
folder.
Starts compiled application.
Runs the integration tests.
Lints all source files and tests.
This software is a part of my dissertation project. While the demo looks promising, the project needs more work before it becomes production ready. Feel free to experiment and contribute.
- Enable use of wss (secure web sockets).
- Add constraints to identity and use it to properly authenticate users.
- Save revisions in a persistent key-value store and add version control to the protocol.
- Allow to leave sessions without knowing session id.
- Add resource type schema support and validate new content revisions against those schemas.
- Fix session middleware.
Operational Transformations as an algorithm for automatic conflict resolution by Anton Zagorskii
Big thanks to JoshData for amazing work on jot - JSON OT library.