realtime-analytics

1.0.6 • Public • Published

It Uses a Node server in order to expose through Express specific apis for real-time inbound data tracking, storage (Rethinkdb) and visualization [dashboard: [Angularjs, Socket-io, Jade]

getting started

First of all it's necessary to install Rethinkdb (via Homebrew package manager):

brew install rethinkdb

And set it on system startup;

Then [Install] and include in your node project the realtime-analytics module [Example]).

install

With npm do:

npm install realtime-analytics

example

var ra = require('realtime-analytics');
 
ra.initServer('3000');
ra.initDashboard('/',['cars','toys']);
 
ra.listen('/cars','cars', function (data) {
  ra.dbInsert('stuffdb','cars',data);
});
 
ra.listen('/toys','toys', function (data) {
  ra.dbInsert('stuffdb','toys',data);
});

Then execute you node app: node /path/to/app/appname.js, and visit http://localhost:port

In order to populate the Db and accordingly the Dashboard, it's necessary to make an HTTP:POST request against the webpaths defined with the listen(webpath, ...)

usage

Standard APIs:

.initServer(port) - init the server port.

.initDashboard(path, tables_array) - init dashboard webpath and db.tables to be analyzed.

.listen(webpath, category_name)data - exposes a webpath which listen for HTTP:POST and return the data.

.dbInsert(db_name, table_name, data_from_listen) - takes data from listeners and store it in the DB.

include

var ra = require('realtime-analytics')

changelog

Releases are documented in changelog.markdown.

license

MIT - malgaboy

Readme

Keywords

none

Package Sidebar

Install

npm i realtime-analytics

Weekly Downloads

1

Version

1.0.6

License

ISC

Last publish

Collaborators

  • malgaboy