Skip to content

Push Notifications

Louise Davies edited this page Feb 18, 2020 · 4 revisions

Push Notifications

The scigateway:api:notification has been created to send notifications that will appear on the notification bell in the main UI. This event is 'public' in that it can be triggered from any plugin or from within the host application.

WebSocket Plugin

The example plugin has been extended to include a connection to a WebSocket server to generate notifications externally.

In a production system this functionality could be implemented in a headless plugin that serves only to convert notifications pushed through a connected WebSocket into DaaaS application events. For the demonstration it is incorporated into the single demonstration plugin which registers multiple UI routes.

WebSocket Block diagram

Demonstration server

A simple WebSocket server implementation has been created in the demonstration plugin source that includes two elements:

  • WebSocket that the plugin index.tsx page connects to.
  • a REST API /notification endpoint that can be used to create a new notification message

Running the demonstration server

The demo plugin is configured (in index.tsx) to connect to a WebSocket server running on localhost:3210. The demonstration server should be started from the command line in the plugin src directory:

yarn serve:backend
Clone this wiki locally