kaniska / project_realtime_analytics

Display charts and analytics reports on real-time data using cloudfoundry, node.js, dojo-toolkit, socket-io, redis and mongodb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

testApp

Objective

Initially the application was developed using cloudfoundry, then changed to make it work with mongodb and redis in a local ubuntu box.

Usage

( mongodb version 2.4.6 )

service mongodb start /tools/redis-stable/src/sudo service redis-server start node server.js

http://localhost:3000/

Developing

-- Package Dependency

express 3.4.0 socket.io 0.9.16 mongoose 3.6.20 redis 0.8.5

hiredis 0.1.15 dojo 1.9.1 jade 0.35.0

-- How it works ?

Tier 1 :

FRONT END : Javascript Templates, Stylesheets, CSS, Html

node.js first looks into layout.jade and home.jade

public/lib/app/app.js renders the content of home page

dojo.addOnLoad ...

show the stock symbols on click of a symbol.. Http Get request /summary/{symbol}

Tier 2:

BACK END : HTTP Get/Post Request Handler

server.js

Step 1 :

// Routes

app.get("/", function(req, resp) { resp.render("home", { pageTitle: "Indian Stock and Mutual Fund Analysis" }); });

Step 2 : when a symbol is clicked

app.get("/summary/:symbol", function(req, resp) {

  • get the symbol from the Reqest
  • Query the database to get the Summary data
  • send the data in JSON ()

Step 3 : see the result in the home page

Created with Nodeclipse v0.4 (Eclipse Marketplace, site)

About

Display charts and analytics reports on real-time data using cloudfoundry, node.js, dojo-toolkit, socket-io, redis and mongodb


Languages

Language:JavaScript 97.1%Language:CSS 2.9%