Skip to content

Chima1707/kazana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kazana

A modular data warehouse system

NPM version Build Status Coverage Status Dependency Status

Usage

module.exports = {
  name: 'myapp',
  version: '1.0.0',
  public: 'public',
  routes: routes,
  bootstrap: 'bootstrap',
  indices: {
    'integrated-data': {
      'byYearAndMonth': mapReduce
    }
  },
  transform: {
    'commodities-excel-report': ['commodity', transformCommoditiesExcelReport]
  },
  validate: {
    commodity: validateCommodityData
  },
  service: function (server, callback) {
    // initialise service, setup cron jobs and what not
    callback()
  },
  plugins: appPlugins
}

See example app at eHealthAfrica/kazana-example/index.js

Options

Options for the new Kazana constructor

name (required)

Name of the app / plugin

version (required)

SemVer compatible version. Pro tip:

  version: require('./package').version

port (required)

Default port number for app.

public

Path to folder from where to serve public assets at the root path.

  public: 'public'

Is simply a shortcut for

  routes: [{
    method: 'GET',
    path: '/{param*}',
    handler: {
      directory: {
        path: 'public'
      }
    }
  }]

routes

Array of hapi routes

bootstrap

Either a function with a callback, or a path to bootstrap CouchDB using couchdb-bootstrap

indices

CouchDB-compatible map/reduce functions by database & index names

transform

Key/Value map of transformation scripts by sourceIds.

validate tbd

Key/Value map of validation scripts by indicator "type"s

// handlers for integrated data validate: { 'accountMovement': validate }

service

A function that gets execute on app startup. Needs to call a callback when finished initialisation.

  service: function (kazana, callback) {
    // initialise service
    // e.g. start pulling data from some 3rd party service
    callback()
  }

plugins

Array of objects with same properties as options for the Kazana constructor.

Scripts

kazana-services

$ kazana-services
npm start -- --only=account
npm start -- --only=raw-data
npm start -- --bare

Lists commands to start main app and plugins in separate processes

Local setup and Testing

devDependency Status

git clone git@github.com:eHealthAfrica/kazana.git
cd kazana
npm install
npm test

CI test with selenium / chrome

npm run test:ci

CI test with saucelabs

SAUCE_USERNAME=*** SAUCE_ACCESS_KEY=*** TEST_CLIENT="saucelabs:internet explorer:10:Windows 8" npm run test:ci

Credit

Brought to you by eHealth Africa — good tech for hard places.

License

Apache-2.0

About

A modular data warehouse system

Resources

License

Stars

Watchers

Forks

Packages

No packages published