Skip to content

potzenheimer/xdash

Repository files navigation

xdash application

User dashboards and reporting tool

  • Source code @ GitHub <https://github.com/potzenheimer/xdash>_
  • Releases @ GitHub <https://github.com/potzenheimer/xdash/releases>_
  • Continuous Integration @ Travis-CI <http://travis-ci.org/kreativkombinat/cab.cab>_

How it works

This project templates provides a full blown Plone project environment. I t comes with a preconfigured project specific theme package located under the src directory.

Installation

This buildout is intended to be used via the development profile to provide a ready to work on development setup including the relevant debugging tools. The relevant steps to get started with a new development environment you would need a workign installation of Python 2.7 and virtualenv:

$ virtualenv-2.7 xdash
$ cd ./xdash
$ git clone git@github.com:potzenheimer/xdash.git buildout.xdash
$ cd ./buildout.xdash
$ python bootstrap.py -c development.cfg
$ bin/buildout -Nc development.cfg

This will download and compile all system components.

Configuration

When the buildout is ready you should be able to start you new setup and add a new Plone site.

Launch the application server in debug mode:

$ bin/instance-debug fg

Point your browser at http://localhost:8499.

In order to use the new installation you need to create a Plone site and install at least the following packages:

  • xpose.seotool
  • xpose.seodash
  • xpose.sitetheme

Then visit http://localhost:8499/your-new-site-id/@@setup-tool to generate the basic structure.

Setup API Access

In order to access external APIs you need to authenticate with the services.

For GA access the following details are required:

{
  "installed": {
    "client_id": "[[INSERT CLIENT ID HERE]]",
    "client_secret": "[[INSERT CLIENT SECRET HERE]]",
    "redirect_uris": [],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
  }
}

These details are best provided via the autogenerated configuration file that you recieve upon creating and registering your app with google apps. The associated private keys need to be placed into the seotool package.

Xovi API paramters:

    'key'     => 'myPersonalKey',
    'service' => 'user',
    'method'  => 'getCreditState',
    'format'  => 'json',

Report data format

Since we are dealing with data from several sources and origins all stored data is serialized into a general purpose json format agnostic of the original format. This way we can savely asume a data structure returned by the underlying database like this:

{
  "id": "${id}",
  "uid": "${uid}",
  "timestamp": "${timestamp}",
  "_runtime": "0.0000059604644775390625",
  "created": "${created}",
  "dashboard": "${dashboard}",
  "project": ${project},
  "items": []
}

The items dictionary will then include entries for each data table of metrics and dimensions. For the sake of readability and interchangability the google API implementation for dataTable was taken as a blueprint for our own schema.