Giter Site home page Giter Site logo

ro-dash's Introduction

ro-dash

ro-dash is a metric dashboard. Built using React/Redux with a small PHP backend, this app allows you to visualize how your rest api is being used. Check out the sample to see it in action: https://ro-dash-sample.herokuapp.com

Getting Started

Deploy

You can use the button above to spin up a Heroku app with this code. The app will populate the database with sample metrics so you can get a feel for how it is set up. Read on to get the details for how the metric data is formated.

Card Configuration

The backend api is built to be very flexible. Each individual card can config its filters, grouping, etc in the request it sends to the server. See www/reducers/cardConfig.js for the sample card configuration.

Querying for Data

The api is /api/metric/{xaxis}/{yaxis}?{filters|sort|limit}

Example: /api/metric/date/total?split=isTrial This card will graph total hits by day, grouping them into groups based on the isTrial field.

Example: /api/metric/userId/total?userId!=null&sort=-total&limit=10 This card will graph the total hits by user, where the userId is not null, sorted by total (descending), and limited to the top 10 results.

Card Type

There are three types of cards:

  • Time Graph - Graph with time along the x-axis
  • Pie Chart
  • List

Card Layout

Cards are laid out using Bootstrap's grid system. See www/reducers/cardLayout.js for how the sample layout is built.

Metric Data Schema

The app is set up to read metrics from a MongoDB database. The format for the metrics collection is:

{
    "_id": {
        "date": MongoDate(),
        "method": "GET",
        "path": "/api/posts/{id}",
        "userId": MongoId(),
        "responseCode": 200
    },
    "count": 15
}

Any item you want to group your metrics by (path, method, etc) should be placed inside _id. The count is the number of times that set of criteria was hit.

Developing

Build the app with

gulp

or

gulp watch

Run the unit tests with

npm test

ro-dash's People

Contributors

fearfullymade avatar

Stargazers

Branden Dane avatar  avatar

Watchers

James Cloos avatar  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.