GithubHelp home page GithubHelp logo

vonwenm / leaps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeffail/leaps

0.0 2.0 0.0 3.78 MB

A collaborative text editing service written in Golang

License: MIT License

Makefile 1.58% JavaScript 32.42% Go 61.19% Shell 1.00% HTML 1.63% CSS 2.18%

leaps's Introduction

Leaps

Leaps is a service for hosting collaboratively edited documents using operational transforms to ensure zero-collision synchronization across any number of editing clients.

To read more and find examples check out the wiki: leaps wiki

##How to run

Leaps is a single binary, with no runtime dependencies, everything is set through a single config file. Just download a release package for your OS and do the following to run an example:

tar -xvf ./leaps-linux_amd64-v0.4.0.tar.gz
cd leaps
./bin/leaps -c ./config/leaps_example.yaml

and then visit: http://localhost:8001 to play with an example server. A leaps service by default will run and host a statistics page to view event counts and uptime, for the example this is hosted at: http://localhost:4040.

To generate a configuration file of all default values:

# for a JSON file
./bin/leaps --print-json

# for a YAML file
./bin/leaps --print-yaml

For a cooler example check out the website

##Customizing your service

There are lots of example configuration files in ./config to check out for various use cases.

To learn how to customize your leaps service read here: leaps service wiki

##Leaps clients

The leaps client is written in JavaScript and is ready to simply drop into a website. You can read about it here: leaps client wiki

The files to include can be found in the release packages at ./js, or in a built repository at ./bin/js. Here's a short example of using leaps to turn a textarea into a shared leaps editor:

window.onload = function() {
	var client = new leap_client();
	client.bind_textarea(document.getElementById("document"));

	client.on("connect", function() {
		client.join_document("test_document");
	});

	client.connect("ws://" + window.location.host + "/socket");
};

Then at some point you might want to close it:

client.close();

##System compatibility

OS Status
OSX x86_64 Supported, tested
Linux x86 Supported, tested
Linux x86_64 Supported, tested
Linux ARMv5 Supported, tested
Linux ARMv7 Supported, tested
Windows x86 Supported
Windows x86_64 Supported

##How to build

Leaps has a Makefile that can lint, run tests, generate the client libraries and package leaps builds into archives. However, if you only wish to get a leaps binary then you can simply use go get github.com/jeffail/leaps.

Build dependencies for Makefile:

  • Golang 1.2+
  • golint
  • nodejs
  • npm (global install of uglifyjs, jshint, nodeunit)

Make sure you have go 1.2+ and nodejs installed and then:

go get github.com/golang/lint
sudo npm install -g uglifyjs jshint nodeunit

To build and then start up an example server do the following:

go get github.com/jeffail/leaps
cd $GOPATH/src/github.com/jeffail/leaps

make build
./bin/leaps -c ./config/leaps_example.yaml

Or, to simply build the service binary on its own is just:

go get github.com/jeffail/leaps

For more build options call make help.

##Contributing and customizing

Contributions are very welcome, just fork and submit a pull request.

Godocs for the service library can be found here.

##Contact

Ashley Jeffs

leaps's People

Contributors

jeffail avatar

Watchers

 avatar  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.