Skip to content

jonathanbarton/gomake-api

Repository files navigation

gomake-api

goMake API Layer

DimSum Image

Tools / Frameworks Used

Feature Summary
Docker Application is containerized with Docker containers.
Docker-Compose Local orchestration is currently done with Docker-Compose. Eventually we will move this to Kubernetes to match production deployment.
ES6 via Babel ES6 support using Babel.
Authentication via JsonWebToken Supports authentication using jsonwebtoken.
Code Linting JavaScript code linting is done using ESLint - a pluggable linter tool for identifying and reporting on patterns in JavaScript. Uses ESLint with eslint-config-airbnb, which tries to follow the Airbnb JavaScript style guide.
Auto server restart Restart the server using nodemon in real-time anytime an edit is made, with babel compilation and eslint.
ES6 Code Coverage via istanbul Supports code coverage of ES6 code using istanbul and mocha. Code coverage reports are saved in coverage/ directory post npm test execution. Open lcov-report/index.html to view coverage report. npm test also displays code coverage summary on console.
Promisified Code via bluebird We love promise, don't we ? All our code is promisified and even so our tests via supertest-as-promised.
API parameter validation via express-validation Validate body, params, query, headers and cookies of a request (via middleware) and return a response with errors; if any of the configured validation rules fail. You won't anymore need to make your route handler dirty with such validations.
Secure app via helmet Helmet helps secure Express apps by setting various HTTP headers.

Requirements

  • Node >= 5.4.1
  • Mongodb instance

Installing Mongodb Locally

(Using mongodb via Docker container details TBA)

# Install mongo via brew
brew install mongodb

# Start mongod service via brew
brew services start mongodb

Getting Started

Install Docker. See this for help on OS X. Docker Compose comes in for free on OSX.

# install dependencies
npm install
  
# select the right version of node (>=4.2.4)
nvm use

# cd into the project root and install node dependencies:
npm install

Basic Commands

# build:
gulp
# containerize
docker build -t gomake/api .
# run
docker-compose up

API Documentation

API Endpoints fully documented and mockable on Apiary.io:

goMake API Documentation - https://docs.gomake.apiary.io

Running Unit Tests

# to run tests:
gulp mocha

# or
npm test

Test Coverage Report

Coverage report available after running unit tests at:

  coverage/lcov-report/index.html

Launching from Docker

Make sure Docker is installed:

OSX: https://docs.docker.com/engine/installation/mac/

Windows: https://docs.docker.com/engine/installation/windows/

(Details TBA)

About

gomake-api

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •