Giter Site home page Giter Site logo

sandedit's Introduction

SandEdit

Keywords: Distributed, Decentralized, Collaborative, Editing, CRDT, Real-time

SandEdit is a project aiming to provide a distributed collaborative editor based on Conflict-free Replicated Data Type (CRDT) using Node.js. CRDTs for sequences allow to insert or delete in the sequence without the burden of managing conflicts. It makes it ideal for real-time editing. Furthermore, contrarily to well-known editors such as Google Docs, the network architecture is decentralized. As a consequence, it avoids the single point of failure and the limitations imposed by the service.

The browser part of this project is only a prototype. It does not manage multiple documents, saving document etc... Nevertheless, it should be in the near future (hopefully).

Installation

$ npm install sandedit

Usage

Within your browser

$ npm install socket.io
$ cd sandedit
$ node server
       siteId
       socketioPort replicaAddress replicaMask
       remoteAddress
$ node server 0 1337 127.0.0.1:1338 255.0.0.0 127.0.0.1:1338

As a Node.js module

var Replica = require('sandedit');

// #1 creating a new node holding a sequence
var replica = new Replica(siteId, 
    localAddress, localPort, localMask,
    remoteAddress, remotePort);

// #2 inserting an element
// insert the character 'a' at index 0
replica.emit('insert', 'a', 0);

// #3 removing an element
// remove the character at index 0
replica.emit('remove', 0)

// #4 received a remote insertion
replica.on('INS', function(element, index){ ... });

// #5 received a remote removing
replica.on('DEL', function(index){ ... });

Dependencies

SandEdit uses the following packages:

Within the web page served by socket.io:

  • ace: the code editor embedded in the web page
  • bootstrap: the style of the web page

sandedit's People

Contributors

ane-wane avatar

Watchers

Diego avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.