Git Product home page Git Product logo

plugin-flex-realtime-stats-dashboard's Introduction

plugin-flex-realtime-stats-dashboard

This plugin is intended to demonstrate how a realtime dashboard might be setup using a backend service with websocket approach. The backend service can poll the statistics APIs and then clients can subscribe to the updates via a websocket managed by the backend. In a large system this could scale out using a persistence layer that stores the updates with multiple nodes providing access to websockets that retrieve from this persistence layer.

The backend system is available here and can rapidly be deployed to Heroku using the link provided or setup locally with ngrok.

It also supports toggling to a twilio functions and twilio sync "backend" instead of the websocket backend, but this is less scalable and doesn't support reliable continuous updates for task aging. At most it will support 20 queues with no channel specific data, or 5 queues with channel specific data for voice, chat, video and all channels (5x4=20). The limit is enforced by the concurrent updates that can be pushed to the sync service.

screenshot

alt text

use

This plugin can be used with either
(a) A custom backend solution written in node.js that supports a websocket with authentication - this design is suitable for production but relies on the provided backend being available

(b) twilio functions and twilio sync - this has scalability limitations and without an external scheduler can't ensure changes to dashboard as tasks age - this is not suitable for production without an external scheduler instead of task router event call back

Setting up with a custom backend (recommended)

  1. Create backend system by following the instructions provided here
  2. Create a clone of this repository and update
  3. Run npm install
  4. Create your own public/appConfig.js based on the public/appConfig.example.js and include your own account number
  5. Run npm start

Setting up with Twilio Functions and Twilio Sync

  1. Create a twilio function on your flex twilio account and name it realtimestats-updateQueueStatistics. Copy the contents of this function into it
    • Uncheck the box that says "Check for valid Twilio Signature" and save it.
    • You should now have a function path like https://<runtime-domain>/realtimestats-updateQueueStatistics
  2. Execute your function from the browser with the parameter checkMap=true e.g. https://<runtime-domain>/realtimestats-updateQueueStatistics?checkMap=true
    • you can now optionally enable "check for valid twilio signature" again
  3. Head to twilio/console -> task router -> select your flex workspace -> select settings
    • Under "EVENT CALLBACK URL" copy the path of your twilio function e.g. https://<runtime-domain>/realtimestats-updateQueueStatistics
    • Select all call back events
    • Save
  4. Create a clone of this repository and update the variable USE_TWILIO_FUNCTIONS to true, this is in FlexRealTimeStatsDashboardPlugin.js
  5. Run npm install
  6. Create your own public/appConfig.js based on the public/appConfig.example.js and include your own account number
  7. Run npm start

change log

v1.2 - updated to support optional use of twilio functions with sync map instead of a backend.

v1.1 - updated to flexui 1.9.1, fixed bug where adding a queue caused a fatal error

v1.0 - initial release with flex-ui 1.8.2 (material-ui v 1.5.2)

Code of Conduct

Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other ❤️

TODOs

plugin-flex-realtime-stats-dashboard's People

Contributors

dkundel avatar imagentleman avatar jared-hunter avatar ktalebian avatar nathan78906 avatar raffaele-abramini avatar silvia-odwyer avatar

Stargazers

 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  avatar  avatar

plugin-flex-realtime-stats-dashboard's Issues

Moving to twilio-labs

Hi @jhunter-twilio :)

I'm happy to move this into Twilio Labs. Could you please check the following things first.

  • Clearly mark a core maintainer in the repo. One way to do this to specify the "author" in the package.json file or by specifying a Maintainer in the Readme somewhere
  • Link to the Code of Conduct. You can see an example in twilio-labs/plugin-serverless

Thank you,
Dominik

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.