Boilerplate for Node.js Koa RESTful API application with TypeScript, Docker, Swagger, Jest, and CircleCI.
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
$ 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
# 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
$ 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
$ yarn pack
This project follows the Contributor Covenant Code of Conduct.
Please use the issue tracker to report any bugs or ask feature requests.
Provided under the terms of the MIT License.
Copyright © 2018, Qasim Soomro.