Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mean-expert/loopback-component-realtime

The LoopBack Component that turns this great framework into a powerful real-time platform

IBM, StrongLoop, LoopBack, Angular 2, LoopBack SDK Builder, LoopBack Component Real-Time, FireLoop

readme

LoopBack Component Real-Time

A LoopBack Framework Component that provides publish events over WebSockets.

This module will supersedes the LoopBack Component PubSub and implements the new FireLoop Module.

Installation

$ npm install --save @mean-expert/{loopback-sdk-builder,loopback-component-realtime}

Setup Back End Module

Update the server/component-config.json as follows:

{
  "loopback-component-explorer": {
    "mountPath": "/explorer"
  },
  "@mean-expert/loopback-component-realtime": {
    "debug": true,
    "auth": true,
    "driver": {
      "name": "socket.io"
    }
  }
}

Update the server/model-config.json as follows:

{
    "mixins": [
        "loopback/common/mixins",
        "loopback/server/mixins",
        "../common/mixins",
        "./mixins",
        "../node_modules/@mean-expert/loopback-component-realtime/dist/mixins"
    ]
}

Enable Model to use FireLoop API

From version 1.0.0-rc.8 you need to specify in which models you want to enable FireLoop events to be sent.

Explanation: In an attempt to enable server and rest triggered events a new mixin has been introduced, this will trigger events either from REST calls or from the NodeJS Api e.g. Model.create().

NOTE: Due a LoopBack limitation the server triggered events are only available for root model methods (Model.create()), but it won't work for relationship methods, these will continue being executed only from FireLoop Child References in the Front-End

{
  "mixins": {
    "FireLoop": true
  }
}

Update Server

To propagate the App from LoopBack to FireLoop, so to finalize just update the file server/server.js by editing the app.start method as follow:

app.start = function() {
  // start the web server
  var server = app.listen(function() {
    app.emit('started', server);
    var baseUrl = app.get('url').replace(/\/$/, '');
    console.log('Web server listening at: %s', baseUrl);
    if (app.get('loopback-component-explorer')) {
      var explorerPath = app.get('loopback-component-explorer').mountPath;
      console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
    }
  });
  return server;
};

PRESENTING FIRELOOP.IO (NEW)

FireLoop.io

Generate FireLoop Angular 2 Client

FireLoop Client for Angular 2 Applications are built in when generating your LoopBack SDK. Read the Following Instructions in order to automatically generate your software development kit.

changelog

version 1.0.2

  • Upgraded pingInterval to avoid disconnections on socket io 2.X

version 1.0.1

  • Upgraded dependency versions

version 1.0.0

  • Stable Release
  • Fixed scalability issues.

version 1.0.0-rc.9.8

  • Hot Fix: hot fix evil setInterval creating CPU issues.

version 1.0.0-rc.9.7

  • Hot Fix: fix null references on scope methods

version 1.0.0-rc.9.6

  • Feature: Implemented Custom Access token
  • Fix: Fixed missing value when requesting model reference

version 1.0.0-rc.9.5

  • Fix: Fixed issues with unreleased subscription contexts

version 1.0.0-rc.9.4

  • Feature: Implemented secure SSL connections

version 1.0.0-rc.9.3

  • Feature: Hot Fix crash while upserting related data

version 1.0.0-rc.9.2

  • Feature: Hot Fix internal namespaces restore

version 1.0.0-rc.9.1

  • Feature: Fixed authentication flow issues

version 1.0.0-rc.9

  • Feature: Implemented custom authentication strategy resolver

version 1.0.0-rc.8.9

  • Hot Fix: Removed buggy socket.io-auth library and replaced for custom code.

version 1.0.0-rc.8.8

  • Fix: Fixed remove events not being triggered from backend

version 1.0.0-rc.8.7

  • Hot Fix: Fix issue with scoped methods not executing the right context to Dynamic Roles

version 1.0.0-rc.8.6

  • Hot Fix: Change findOne for findById on upsert method

version 1.0.0-rc.8.5

  • Hot Fix: Response Error to client starting the process on remove

version 1.0.0-rc.8.4

  • Hot Fix: Response Error to client starting the process

version 1.0.0-rc.8.3

  • Hot Fix: Publish broadcast on error
  • Hot Fix: Fix upsert method
  • Fix: Remove userId from access token verification

version 1.0.0-rc.8.2

  • Revert 1.0.0-rc.8.1

version 1.0.0-rc.8.1

version 1.0.0-rc.8

version 1.0.0-rc.7

version 1.0.0-rc.6

Milestone: https://github.com/mean-expert-official/loopback-component-realtime/milestone/3?closed=1

version 1.0.0-rc.5

  • Implemented Internal Event Distribution
  • Implemented Socket.io adapters interface

version 1.0.0-rc.4

  • Dispose complete reference not only remote methods

version 1.0.0-rc.3

  • Handle client disconnections

version 1.0.0-rc.2

  • Hot Fix Stats Event

version 1.0.0-rc.1

  • Final FireLoop Implementation

version 1.0.0-beta.8

version 1.0.0-beta.7

version 1.0.0-beta.6

  • Added missing documentation

version 1.0.0-beta.5

version 1.0.0-beta.4

  • Hot Fix Update Query issues

version 1.0.0-beta.3

version 1.0.0-beta.2

version 1.0.0-beta.1

version 1.0.0-alpha.3

version 1.0.0-alpha.2

version 1.0.0-alpha.1

  • First published release
  • Implements Drivers
  • Implements TypeScript Configuration
  • Implements PubSub Functionality
  • Implements IO Functionality
  • Implement Socket.io Driver.
  • Implements Test Environment