nodejs-microservice-poc
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)
- Go to Travis account
- Press the Sync button
- Switch to ON for the repository
- If Travis has not been configured to make push towards GitHub, then follow these instructions
- Make new
git push
to trigger build
Setup Codeclimate (one time only)
- Add Github Repository at codeclimate.com
- Fill out the repository name and press `Import repo from Github
- 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)
- 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)
- Add new repo by swithing Github repo to ON
- Follow the SET UP COVERALLS steps for adding
.coveralls.yml
in repository root - Run the NPM script
npm run coveralls
- Travis will automatically run this command after each build. See .travis.yml
Gulp tasks
gulp test
to runlint
andistanbul
gulp release
to bump version number inpackage.json
gulp
totest
andwatch
NPM scripts
npm run docs
generates HTML documentation in /docs based with help ofjsdoc
annotationsnpm run coveralls
npm run test
runs mocha test by triggeringgulp test
Shell scripts
/publish_docs.sh
publish documentation placed at/docs
to github pages by commiting to branchgh-pages
Dependencies
devDependencies
- Mocha Unit Testing with gulp-mocha
- Automagically lint your code with gulp-jshint
- Check JavaScript code style with gulp-jscs
- Measuring code coverage with gulp-istanbul
- Upload LCOV data to coveralls.io with coveralls
- Bump npm versions with gulp-bump
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
- nodes-restful-api - RESTful API with MongoDB, Restify, NodeJS
- CI Test for Browser - Run your browser tests on every push, demo project js-traverse
- GA on Github - Google Analytics collector-as-a-service (using GA measurement protocol).
- idiomatic.js - Principles of Writing Consistent, Idiomatic JavaScript
- Use jsdoc
- Using the ES6 transpiler Babel on Node.js
- Node Collection
- http://tools.ampersandjs.com/
- https://github.com/sindresorhus/awesome-nodejs
- https://www.npmjs.com/package/frontend-npm-goodies
- https://github.com/Raynos/http-framework/wiki/Modules#response
- https://github.com/npm-dom
- https://www.npmjs.com/package/mad-science-modules
- https://www.npmjs.com/package/npm-collection-language-tools#readme
- And more...
License
Copyright (c) 2015 Ismar Slomic. Licensed under the MIT license.