Skip to content

focus-io/node-es6-restapi-boilerplate

Repository files navigation

node-es6-restapi-boilerplate

An easy start restapi nodejs project boilerplate for development, in module architecture with airbnb coding standerd & all latest stable packages with es6 code format.

Start coding fast with stright forwarded application flow and build in user & authentication modules, with integration & unit test & apidoc rest api documentation.

Getting Started

You can clone & follow the below sections to make it use of your own.

Pre-requisites

Make sure you have installed all of the following prerequisites on your development machine:

Dependencies

Some popular dependencies used to build the boileplate.

Dependency Description
express Minimalist web framework
mongoose MongoDB ODM
bluebird Fully featured promise library
commander Nodejs cli solution
passport Authentication library for nodejs
moment Parse, validate, manipulate date
joi Object schema validation
pug HTML template language
lodash Utility library
nodemailer Mailer package
onesignal-node Push notification
textlocal SMS package
morgan HTTP request logger
winston Nodejs logger pakage

Some popular dev dependencies

Dependency Description
eslint Pattern checker for JS
nodemon Montior script runner for nodejs
apidoc Resful api documentation
mocha Test framework
chai Assertion library for nodejs
supertest Test HTTP servers
sinon JS test spies, stub & mocks
coveralls Test runner report
faker Generate fake data

Some optional packages to install globally in your dev machine.

Dependency Installation
EsLint yarn global add eslint
Nodemon yarn global add nodemon

Installation

  • Clone the repository from github as your project name
git clone https://github.com/focus-io/node-es6-restapi-boilerplate.git project-name
cd project-name
  • Install dependent packages
yarn install

Configuration

  • Create environment file
mv .env.example .env
  • Change your application name & database name from .env
vi .env
  • Run the project
yarn start
  • Application will start in port 3000 by default url

Usage

  • To create user
yarn scripts user create

Docs & Lint

  • Generate api docs by running
yarn docs
  • Test lint by
yarn lint
  • Lint fixes
yarn lint:fix

Test & Coverage

  • Unit Test
yarn test:unit
  • Integration Test
yarn test:integration
  • Test
yarn test
  • Test Coverage
yarn coverage

Deployment

YTC

Contribution

We welcome any contribution you make contributors guidelines.

Versioning

We use SemVer for versioning. For the versions available, see the versions on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgement

Inspirations

Todo

  • Unit Test
  • Test System module
  • Seeder
  • S3 for user image
  • CI/CD
  • Docker
  • Build