Skip to content

tomers/node-devops-boilerplate

Repository files navigation

node-devops-boilerplate

A simple boilerplate from Node.js web applications.

This project focuses on a showcasing a usable Continuous Integration / Continuous Deployment (CI-CD) process. This boilerplate is not opinionated as for the type of application, thus express was ommitted.

The project borrowed from and is heavily inspired from the following sources:

Features

  • Pre-commit hooks to ensure 100% test pass rate
  • Coverage tests to ensure 100% code coverage by tests
  • Fully working CI/CD process using Circle CI web service
  • Deployment to AWS Elastic Beanstalk service

Technologies used

For building

Yarn: a fast, reliable, and secure dependency management

For testing

Mocha: a feature-rich JavaScript test framework Chai: a BDD / TDD assertion library Istanbul: a JavaScript test coverage tool ESLint: a pluggable linting utility

For deployment

Codecov: a code coverage service Circle CI: a continuous integration and delivery platform AWS Elastic Beanstalk: an easy-to-use service for deploying and scaling web applications and services

Getting Started

The easiest way to get started is to clone the repository:

Get the latest snapshot:

git clone https://github.com/tomers/node-devops-boilerplate.git myproject

# Change directory
cd myproject

Install yarn:

npm install -g yarn

Install dependencies:

yarn

Create a GitHub project

Create a new GitHub project and commit your code to it.

Create a Codecov project

Simply enter the Codecov website and follow instructions. It should be rather straightforward.

Create a Circle CI build

After you have created your GitHub project, sign-up to Circle CI, then create a new project. Add the following environment variables in the project settings console:

Create an AWS Elastic Beanstalk application

Follow instructions here.

Test your setup

Commit any code change to your repository and push the changes back to Github. Verify the build is monitored by Circle CI.

Yarn vs NPM

This project includes a yarn.lock file by default and as project dependencies are updated, this file will be updated to reflect those changes.

To upgrade your local dependencies using Yarn, simply run yarn upgrade. This will update all dependencies to their latest version based on the version range specified in the package.json file. The yarn.lock file will be recreated as well. For further information, please see the official documention for managing dependencies and upgrading dependencies. This Yarn vs NPM article by SitePoint also has some very useful information.

About

Simple Node.js boilerplate to demonstrate deployment with testing, linting and coverage reporting, CI/CD using Circle CI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published