A modular data warehouse system
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 for the new Kazana
constructor
Name of the app / plugin
SemVer compatible version. Pro tip:
version: require('./package').version
Default port number for app.
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'
}
}
}]
Array of hapi routes
Either a function with a callback, or a path to bootstrap CouchDB using couchdb-bootstrap
CouchDB-compatible map/reduce functions by database & index names
Key/Value map of transformation scripts by sourceId
s.
Key/Value map of validation scripts by indicator "type"
s
// handlers for integrated data validate: { 'accountMovement': validate }
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()
}
Array of objects with same properties as options
for the
Kazana
constructor.
$ 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
git clone [email protected]: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
Brought to you by eHealth Africa โ good tech for hard places.