Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
/ cem Public archive

Concurrent Editing Manager - simple, fast and safe

License

Notifications You must be signed in to change notification settings

fontelemos/cem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrent editing manager (CEM) [:hammer: WORK IN PROGRESS :hammer:]

Actions Status

Table of contents

  1. About
  2. API Interface
  3. Webpage example
  4. License
  5. Contribution

About

Simple lightweight concurrent state editing API using Tokio and websockets. There's a webpage example using react inside the webpage directory, see more in Webpage example.

You can start the API by running cargo run in your terminal!

API Interface

The API currently uses the json-patch format, provided by the json-patch rust crate. Currently the API only supports merging but will support patch operations in the future 😃 .

CEM will try to parse the payload into a Block which consists of a json in the following format:

{
  "id": "mylovellyid123",
  "content": {
    "time": 2, // => this is optional
    ...
  }
}
Field Description
id unique to this block, will be used as key to update future blocks
content object containing data which will be updated
time (unsigned 64 bits int) if a block's time is less than the stored one, the block will be ignored

After processing the message, CEM will broadcast to all connected users(except who updated) the updated block in the same Block format.

Webpage example

setup

  1. run cargo install --path . to install the API dependencies
  2. access the webpage directory and run npm install to install the webpage dependencies

running

  1. Start the API by running cargo run in the root of the project
  2. in another terminal window, access the webpage directory and run npm start

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in CEM by you, shall be licensed as MIT, without any additional terms or conditions.

About

Concurrent Editing Manager - simple, fast and safe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published