Giter VIP home page Giter VIP logo

gateway's Introduction

Hyperwell Gateway

DOI

Proof-of-concept implementation of a peer-to-peer (P2P) system that leverages collaboration, local-first principles, and more on W3C Web Annotations. The system provides software for local nodes that store annotations, as well as a gateway server that implements the Web Annotation Protocol.

For establishing an environment of local-first applications for collaborative annotation, we store collections of annotations called notebooks in Hypermerge documents. These documents are distributed via the hyperswarm decentralized network and merged without conflicts via automerge.

The Hyperwell gateway aims to bridge the decentralized network and the web, offering collaborative annotation to Linked Data systems and web-based annotation environments alike by implementing the W3C Web Annotation specifications. For users, the gateway aims to offer institutional affiliation and archiving.

Hyperwell architecture

We laid out the motivation behind the decentralized annotation architecture of Hyperwell in our 2020 paper, ‘From Me to You: Peer-to-Peer Collaboration with Linked Data‘. For more on Hyperwell and the journey behind it: https://kassel.works/hyperwell

Important: This is alpha software for research. Your annotations will be available publicly and accessible without authentication. This software has not been professionally audited.

Usage

Run a gateway server via npm start or ./bin/server.js. The CLI accepts the following arguments:

  • --port <number> (-p): The port number to listen on. Defaults to 3000. Example: --port 8080.
  • --host <hostname>: The public hostname. Defaults to localhost:3000. Example: --host www.example.com:8080
  • --ssl (-s): Whether the gateway is served via SSL. This will not make the gateway actually terminate HTTPS requests (it listens for standard HTTP requests), but will transform annotation IDs accordingly, using the https: scheme. Defaults to false (not set).

API

The gateway exposes a web-based API as a superset of the Web Annotation Protocol, including support for batch operations as well as subscribing to real-time updates on notebooks via the WebSocket protocol. In the following, the <notebook> identifier corresponds to the notion of ‘containers’ on the LDP. We simply use a hexadecimal encoding of the respective Hypermerge document URL (hypermerge://abc123...) for URL safety. <annotation> corresponds to the ID of an annotation within a notebook, which commonly is a UUID string.

  • /annotations/<notebook>. REST endpoint for operations on an entire notebook. This endpoint supports retrieval of all of its annotations (GET) and creation of new a new annotation (POST).
  • /annotations/<notebook>/<annotation>. REST endpoint for operations on a particular annotation within a notebook. This endpoint supports retrieval (GET), editing (PUT), and deletion (DELETE).
  • /annotations/batch/<notebook>. REST endpoint for batch operations on a notebook. This endpoint supports batch creation (POST), batch edits (PUT), and batch deletions (DELETE).
  • /annotations/subscribe/<notebook>. WebSocket endpoint for subscribing to changes on a notebook. Upon initiating a connection via the standard WebSocket protocol, the gateway will send messages as soon as the respective notebooks receives changes.

(tbc).

License

MIT License, see ./LICENSE.

gateway's People

Contributors

dependabot[bot] avatar jankaszel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fruitbox12

gateway's Issues

subscription event handling

right now, we push the whole document state to subscribers when changes occur. this, however, can lead to bottlenecks especially when considering the WS bridge and gateway in the gateway process.

  • make change requests transmit their responses before sending out subscriber pushes
  • try out hash-based diffing for watch handlers and sparsely transmit changes to subscribers
  • debounce watch calls?

investigate connection issues

as load tests showed (run npm test), peers have issues managing more than ~30 connections and will stop accepting new ones afterwards. this shouldn't happen.

add bridge protocol buffer

closes #2 and #3, as we move from HTTP to our own protocol schema. parsing HTTP in the browser can't be leveraged that easily.

use stream response queues

use stream response queues in the distribution node for serial processing of requests for the same connection. also, add parallel transmission of requests from the client side to different nodes of a distribution swarm for increased performance.

client library

build a client library (browserify?) that can be included in browsers. should be able to change the stream type of request-swarm.js to enable proxy/webrtc-based streams.

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.