Skip to content

HTWDD-RN/RTSync

Repository files navigation

RTSync

A library to facilitate Real-Time Collaborative Editing (RTCE). The intended use is to run one server and at least two clients that can then edit a data model together. All changes to the model are transmitted as Operational Transformation in Real-Time. This project uses otter-java which in turn uses Neil Fraser's Diff-Match-Patch.

RTSync's Subprojects

RTSync consists of ten subprojects which serve the purpose to provide executable projects with the required classes while avoiding the inclusion of unnecessary classes. The executable subprojects are separated by network node type (server or client) and Real-Time model grouping (simple or project). The combination of both can be thought of as a 2x2 matrix.

		Simple			Project				
Server	rtsync-server-simple	rtsync-server-project
Client	rtsync-client-simple	rtsync-client-project

List of Subprojects:

rtsync-core          	Includes types for all other subprojects as well es otter-java.
rtsync-node-simple   	Required for simple model grouping.
rtsync-node-project  	Required for project model grouping.
rtsync-client-core   	Required by clients.
rtsync-server-core   	Required by servers.
rtsync-client-simple 	Executable - Runs a client with simple model grouping
rtsync-client-project	Executable - Runs a client with project model grouping
rtsync-server-simple 	Executable - Runs a server with simple model grouping
rtsync-server-project	Executable - Runs a server with project model grouping
rtsync-combined      	Includes all other subprojects. Executable - Runs Any of the other executable subprojects. Contains integration tests.

Model Grouping

The model grouping determines the relation of network nodes to their real-time models. Clients and Servers can only communicate if their model grouping matches.

Simple: The network node has exactly one real-time model. This is the intended use case when there is only one model to share among the network.

Project: The network node has multiple real-time models which are adressed by an unique name. Each client can choose which model to receive changes from. The project's models don't interfere with each other. This is the intended use case when there are mutliple shared models with separate data among the network.

Build RTSync

Prerequisite

Maven: You need maven for the steps 1 and 3. Ask your IT department for it or see https://maven.apache.org/install.html.

1. Build the otter-java maven project

Get the files for otter-java

Either Check out otter-java from the HTWD repository using git: git clone https://github.com/HTWDD-RN/otter-java.git or download otter-java as an archive and unpack it.

Install otter-java

Open a console. Change into the otter-java project folder from the previous step which we assume to be called otter-java. Then have maven install it. The tests can be skipped in order to save time by using the parameter -DskipTests.

cd otter-java

mvn install -DskipTests

2. Build the RTSync maven project

Get the files for RTSync

Either Check out RTSync from the HTWD repository using git: git clone https://github.com/HTWDD-RN/RTSync.git or download RTSync as an archive and unpack it.

Install RTSync

Open a console. Change into the RTSync project folder from the previous step which we assume to be called RTSync. Then have maven install it. The tests can be skipped in order to save time by using the parameter -DskipTests.

cd RTSync

mvn install -DskipTests

If maven finishes its work successfully, then all target directories of executable subprojects contain a runnable JAR-file with dependencies with a name like RTSync*-jar-with-dependencies.jar.

Info about running RTSync

There are two ways to run a network node. Either execute one of the start files in the corresponding subprojects' target directory or execute one of the start files in rtsync-combined/target with the desired parameter. All target folders and the start files should have been generated by step 2. There are two start files in each of those target directories. One is simply called start.bat and the other one is called start_debug.bat. The later also keeps XDebug running which is listening to port 8888 and can be used to debug the application. The console is assumed to be opened in the directory RTSync at the beginning of the steps in 3. as well as at the beginning of the steps in 4.

3. Run a server

Server with Simple Model Grouping:

cd "rtsync-server-simple/target"

start.bat

or alternatively

cd "rtsync-combined/target"

start.bat s

Server with Project Model Grouping:

cd "rtsync-server-project/target"

start.bat

or alternatively

cd "rtsync-combined/target"

start.bat ps

If everything worked well, the last line in the console should end with "Application availability state ReadinessState changed to ACCEPTING_TRAFFIC", indicating that the server is up and ready. The server can be reached at port 8080 by default and accepts Websocket connections at the path "/socket". The server can be shut down by cancelling it in the console with CTRL+C.

4. Run a client with an example GUI.

Note about parameters: Clients can be run with up to two additional parameters. The first one is the client's initial preferred name and the second one is the client's initial preferred color. The color must be given as HTML color code consisting of six characters that are parsable as hexadecimal RGB-value. Optionally the color can be prepended by a sharp '#'. E.g. dark yellow would be #aaaa00.

Client with an example GUI that only allows for changing one string (Simple Model Grouping):

cd "rtsync-client-simple/target"

start.bat

or alternatively

cd "rtsync-combined/target"

start.bat c

Note, that the simple client can handle more than just a single string. It's just the example GUI that doesn't allow for it. Maybe this will be upgraded in a future release. The appropriate UI elements are prepared already as the rtsync-client-project shows.

Client with Project Model Grouping:

cd "rtsync-client-project/target"

start.bat

or alternatively

cd "rtsync-combined/target"

start.bat pc

The client GUI should now open. The client can connect to the server with the URL schema "ws" at port 8080 by default under the path "/socket". Thus, a locally run server can be reached by local clients by the URL "ws://localhost:8080/socket".

5. Run a Demo

Note, that one server and multiple clients can be run on the same machine. For demonstrative purposes, at least two clients are recommended, so execute step 3 one time and step 4 at least twice.

About

Client-Server-Solution for Real-Time Collaborative Editing (RTCE)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages