Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mnutt committed Sep 13, 2012
1 parent 5267069 commit d9a3b8f
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ sends back tracking data generated by javascript.
Requirements
-------------------

* node.js v0.2.0
* npm v0.2.4
* mongodb

* node.js v0.8.0

Installation
--------------
Expand All @@ -28,9 +25,6 @@ Installation
# Use npm to install the dependencies
npm install

# Copy the default configuration file
cp config/app.json.sample config/app.json

# To use the map, download MaxMind's GeoIP database and extract to the root directory:
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
Expand All @@ -41,35 +35,35 @@ Running Hummingbird

To start the analytics server, run the following:

mongod & (or start mongo some other way)
node server.js

By default a dashboard will be run on port 8080. You can disable it for production use in
config/app.json. The dashboard is just html served out of public/; you can serve it using
config/config.js. The dashboard is just html served out of public/; you can serve it using
any webserver.


Deployment
----------

Make sure to properly secure the dashboard if you don't want outside people to see it. The dashboard
httpServer's 'listen' function takes a second argument that is the interface to bind; typically you
Make sure to properly secure the dashboard if you don't want outside people to see it. This
typically means putting the dashboard behind nginx or apache using basic auth. The dashboard's
'listen' function takes a second argument that is the interface to bind; typically you
would choose "127.0.0.1" to only allow access from localhost, or "0.0.0.0" to listen on all
interfaces. In production you should change the instances of "localhost:8000" in public/index.html
to point to the server where you're hosting the dashboard.
interfaces. You should then run the tracking pixel on a different port so that it is accessible
to the outside world.


Architecture Overview
---------------------

Hummingbird is organized into two parts: a node.js-based tracking server that records user
activity via a tracking pixel, and a collection of javascript-based widgets that display that
activity. The server records all activity in MongoDB and broadcasts it to the clients using
WebSockets if possible, and falling back to Flash sockets if necessary.
activity. The server broadcasts all activity to the clients using Websockets if possible, and
falls back to Flash sockets or long polling if necessary.

The Hummingbird.WebSocket object receives websocket events from the server in the form of JSON
objects. Individual widgets subscribe to a property in the JSON tree and register handler
functions to be called whenever that property is present.
objects. Individual widgets subscribe to a metric and register handler functions to be called
whenever that metric is present.


Logging Customization
Expand All @@ -78,8 +72,8 @@ Logging Customization
Metrics are stored in lib/metrics and auto-loaded. Each metric contains a handler function that is
called every time a new user event occurs. Metrics store data in the `data` object property which
gets emitted to clients in intervals specified by the metric. A basic example can be found in
lib/metrics/total_views.js. An example of how a metric can filter based on urls is in
lib/metric/sales.js.
lib/metrics/total_views.js. An example of how a metric can filter based on query params is in
lib/metric/cart_adds.js.


Display Customization
Expand Down

0 comments on commit d9a3b8f

Please sign in to comment.