GithubHelp home page GithubHelp logo

marcioaffonso / insights-dashboard-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opentok/insights-dashboard-sample

0.0 1.0 0.0 1.95 MB

License: Other

CSS 29.38% HTML 10.01% JavaScript 60.62%

insights-dashboard-sample's Introduction

Insights Dashboard Sample

Dashboard Sample which makes use of OpenTok Insights GraphQL API

Preview

Insights Dashboard Sample Preview

Local Installation

  1. Clone the repository.

  2. Install dependencies: npm install.

  3. Copy .env.template to .env and edit the environment variables.

  4. Run the server and the client app: npm start. This will run both the server (server.js) and the client app (react-scripts).

Configuration options

Configuration can be done using environment variables. You can create an .env file for easier config.

Environment Variable Names and Description:

  • REACT_APP_INSIGHTS_URL (Required): The URL for the OpenTok Insights API.
  • REACT_APP_API_KEY (Required): Your OpenTok API Key.
  • API_SECRET (Required): Your OpenTok API Secret.
  • SERVER_PORT (Required): The port number for your server to run on.
  • REACT_APP_SERVER_URL (Required): The URL for your server app.
  • APP_CLIENT_URL (Required): The URL for your client app.

Notice that all the environment variables used by the client start with REACT_APP_. This ensures that only those are accessible by the client, protecting your API secret.

Charts - Query samples

Usage by Day

Usage by Day

Query to Insights API (Sample)

{
  project(projectId: ${YOUR_API_KEY}) {
    projectData(
      start: ${moment().subtract(10, 'days')},
      interval: DAILY
    ) { 
      resources {
        intervalStart,
        intervalEnd,
        usage {
          streamedPublishedMinutes,
          streamedSubscribedMinutes
        }
      }
    }
  }
}

SDK Distribution

SDK Distribution

Query to Insights API (Sample)

{
  project(projectId: ${YOUR_API_KEY}) {
    projectData(
      start: ${moment().subtract(10, 'days')},
      groupBy: SDK_TYPE,
      sdkType: [JS, ANDROID, IOS]
    ) {
      resources {
        sdkType,
        usage {
          streamedSubscribedMinutes
        }
      }
    }
  }
}

Failures by Browser

Failures by Browser

Query to Insights API (Sample)

{
  project(projectId: ${YOUR_API_KEY}) {
    projectData(
      start: ${moment().subtract(10, 'days')},
      groupBy: BROWSER_NAME,
      browserName: [CHROME, FIREFOX, IE]
    ) { 
      resources {
        browserName,
        errors {
          guidConnect {
            failures
          },
          guidPublish {
            failures
          },
          guidSubscribe {
            failures
          }
        }
      }
    }
  }
}

Bitrate by Country

Bitrate by Country

Query to Insights API (Sample)

{
  project(projectId: ${YOUR_API_KEY}) {
    projectData(
      start: ${moment().subtract(10, 'days')},
      groupBy: COUNTRY,
      country: [AR, BR, ES, FR, MX, US]
    ) {
      resources {
        country,
        quality {
          subscriber {
            videoBitrateAvg
          }
        }
      }
    }
  }
}

insights-dashboard-sample's People

Contributors

marcioaffonso avatar

Watchers

 avatar

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.