Index

nodejs-microservice-poc

GitHub version Build Status Dependency Status DevDependency Status Inline docs Code Climate Coverage Status

Microservice PoC running at Nodejs inside Docker

Dev op tools

  • Source code coverage with coveralls. Note this is in addition to Codeclimate code coverage
  • Continous Integration (build and test Github projects) with open-source tool travis-ci
  • Version control and issue tracking with github
  • Project dependency checker with david-dm
  • Automated code review with and show source code coverage codeclimate. Note that this is in addition to Coveralls coverage
  • Javascript documentation notation with jsdoc
  • Evaluation of inline code documentation from Inch CI

Scaffolding based on yeoman generator

Install and setup

Node.js

npm install

Connect to remote Github repository (one-time only)

cd nodejs-microservice-poc
git init
git add .
git commit -m “Initial commit with use of scaffolding”
git remote add origin git@github.com:ismarslomic/nodejs-microservice-poc.git
git push --set-upstream origin master

Setup Travis (one time only)

  1. Go to Travis account
  2. Press the Sync button
  3. Switch to ON for the repository
  4. If Travis has not been configured to make push towards GitHub, then follow these instructions
  5. Make new git pushto trigger build

Setup Codeclimate (one time only)

  1. Add Github Repository at codeclimate.com
  2. Fill out the repository name and press `Import repo from Github
  3. Follow the JavaScript instructions to connect code quality with test coverage. Remember to add the environment variable to Travis and to your local env as well. You can find the repo token in the URL barl of your browser.

Setup Inch-CI (one time only)

  1. Go to the Inch-CI project and press Create button

Setup David-dm (one time only)

No setup is required, david-dm will automatically recognise and run check

Setup Coveralls (one time only)

  1. Add new repo by swithing Github repo to ON
  2. Follow the SET UP COVERALLS steps for adding .coveralls.yml in repository root
  3. Run the NPM script npm run coveralls
  4. Travis will automatically run this command after each build. See .travis.yml

Gulp tasks

  • gulp test to run lint and istanbul
  • gulp release to bump version number in package.json
  • gulp to test and watch

NPM scripts

  • npm run docs generates HTML documentation in /docs based with help of jsdoc annotations
  • npm run coveralls
  • npm run test runs mocha test by triggering gulp test

Shell scripts

  • /publish_docs.sh publish documentation placed at /docs to github pages by commiting to branch gh-pages

Dependencies

devDependencies

dependencies

  • Debug your code with debug
  • Neat utilities with lodash
  • Creating and composing asynchronous promises with q

Update dependencies

Upgrade npm modules to latest version by use of npm-check-updates

# Install the npm package globally
npm install -g npm-check-updates

# Get list of all upgrades
ncu

# Upgrade all npm modules to latest version and update package.json file
sudo ncu -u

API

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

Reference

License

Copyright (c) 2015 Ismar Slomic. Licensed under the MIT license.