Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

A Node.js RESTful API application boilerplate with TypeScript, Docker, Koa, Swagger, Jest, and CircleCI

License

Notifications You must be signed in to change notification settings

qas/boilerplate-nodejs-swagger

Repository files navigation

Koa REST API Boilerplate

Node.js RESTful API Boilerplate

Boilerplate for Node.js Koa RESTful API application with TypeScript, Docker, Swagger, Jest, and CircleCI.

MIT Licence

Koa REST API Boilerplate is a highly opinionated boilerplate template for building a RESTful API application with TypeScript & Koa - this template comes loosely-typed.

This boilerplate includes the following features:

  • tsoa for autogenerated Swagger documentation, routes, and request validation
  • Style and linting with Google TypeScript style
  • Multi-process clustering with production-ready process manager PM2
  • Log rotation and log management using Winston
  • A tiny optimized Docker image based on Alpine image
  • Continuous integration and delivery using CircleCI
  • Unit and Integration tests along with test Coverage using Jest testing framework

Getting Started

$ git clone https://github.com/https://github.com/qas/boilerplate-server-node-swagger-api your-project-name
$ cd your-project-name
$ rm -rf .git && git init
$ yarn
$ yarn build
$ yarn start

Commands

Run

# Run normally
$ yarn start
# Run the application with Docker for development with Nodemon
$ docker-compose up
$ curl localhost:7070/v1/spec
$ curl localhost:7070/v1/health

Test

sfrkh.png

# Test
$ yarn test                           # Run all test
$ yarn test:unit                      # Run only unit test
$ yarn test:e2e                       # Run only integration test
# Test (Watch Mode for development)
$ yarn test:watch                     # Run all test with watch mode
$ yarn test:watch:unit                # Run only unit test with watch mode
$ yarn test:watch:e2e                 # Run only integration test with watch mode
# Test Coverage
$ yarn test:coverage                  # Calculate the coverage of all test
$ yarn test:coverage:unit             # Calculate the coverage of unit test
$ yarn test:coverage:e2e              # Calculate the coverage of integration test
# Test consistent coding style (Lint)
$ yarn lint                           # Lint all sourcecode

Archive

$ yarn pack

Contributing

This project follows the Contributor Covenant Code of Conduct.

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or ask feature requests.

License

Provided under the terms of the MIT License.

Copyright © 2018, Qasim Soomro.

About

A Node.js RESTful API application boilerplate with TypeScript, Docker, Koa, Swagger, Jest, and CircleCI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published