cachapa / crdt_server

Generic REST server based on Conflict-free Replicated Data Types (CRDTs)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRDT Server

Generic REST + WebSocket server based on Conflict-free Replicated Data Types (CRDTs).

Serves as a demonstration of real-world use of the CRDT package.

This server listens for REST requests and WebSocket connections and maintains independent CRDTs for each route (created lazily). It makes it trivial to test APIs by simply calling a '/users' or '/todo' routes.

Usage

Simply run main.dart:

$ cd crdt_server
$ pub get
$ dart bin/main.dart
Serving at http://localhost:8080

Perform a GET request against any path in the server to get the CRDT in JSON format:

curl http://localhost:8080/todo

Merge an existing CRDT with the server using POST requests:

curl -d '{"x":{"hlc":"2020-02-09T12:04:13.476Z-0000","value":{"Learn CRDTs":false}}}' http://localhost:8080/todo

To do

  • Optional parameters for fetching CRDT subsets (partial merges)

Features and bugs

Please file feature requests and bugs at the issue tracker.

About

Generic REST server based on Conflict-free Replicated Data Types (CRDTs)


Languages

Language:Dart 100.0%