Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/posquit0/koa-rest-api-boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
https://github.com/posquit0/koa-rest-api-boilerplate
api boilerplate circle-ci circleci docker koa koa2 node pm2 rest restful skeleton swagger template
Last synced: 25 days ago
JSON representation
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
- Host: GitHub
- URL: https://github.com/posquit0/koa-rest-api-boilerplate
- Owner: posquit0
- License: mit
- Created: 2017-08-27T11:48:29.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-25T14:49:44.000Z (11 months ago)
- Last Synced: 2024-05-12T06:42:01.214Z (6 months ago)
- Topics: api, boilerplate, circle-ci, circleci, docker, koa, koa2, node, pm2, rest, restful, skeleton, swagger, template
- Language: JavaScript
- Homepage: https://koa-rest-api-boilerplate.js.org
- Size: 2.6 MB
- Stars: 486
- Watchers: 14
- Forks: 81
- Open Issues: 43
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Support: SUPPORT.md
Awesome Lists containing this project
- awesome-koa - koa-rest-api-boilerplate - Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, Coveralls and CircleCI (Examples & Boilerplates)
- awesome-koa - koa-rest-api-boilerplate - Node.js Koa RESTful API 样板程序,带 Docker、Swagger、Jest、Coveralls 和 CircleCI。 ![](https://img.shields.io/github/stars/posquit0/koa-rest-api-boilerplate.svg?style=social&label=Star) (仓库 / 案例 & 样板程序)
README
Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov, and Circle CI
![KoaJs Slack](https://img.shields.io/badge/Koa.Js-Slack%20Channel-Slack.svg?longCache=true&style=for-the-badge)
**Koa REST API Boilerplate** is a highly opinionated boilerplate template for building RESTful API application with Koa.
This boilerplate include the following features:
- Logging to STDOUT/STDERR stream using [Pino](http://getpino.io/)
- A super small and optimized [Docker](https://www.docker.com/) image based on [Node.js Alpine image](https://hub.docker.com/_/node/)
- [Swagger](https://swagger.io/) API documentation based on JSDoc
- Continuous integration and delivery using [CircleCI](https://circleci.com/)
- Unit Test and Integration Test along with Test Coverage using [Jest](https://facebook.github.io/jest/) testing framework---
## Getting Started
```zsh
$ git clone https://github.com/posquit0/koa-rest-api-boilerplate your-project-name
$ cd your-project-name
$ rm -rf .git && git init
``````zsh
$ yarn
$ yarn start
```## Commands
### Run
```zsh
# Run normally
$ yarn start
# Run the application with nodemon for development
$ yarn dev
```### Test
```zsh
# Test
$ yarn test # Run all test
$ yarn test:unit # Run only unit test
$ yarn test:integration # 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:integration # 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:integration # Calculate the coverage of integration test
# Test consistent coding style (Lint)
$ yarn lint # Lint all sourcecode
$ yarn lint:app # Lint app sourcecode
$ yarn lint:test # Lint test sourcecode
```### Archive
```zsh
$ yarn pack
```## Test
All test for this boilerplate uses following tools.
- [Jest](https://github.com/facebook/jest)
- [supertest](https://github.com/visionmedia/supertest) - Easy HTTP assertions for integration test## Contributing
This project follows the [**Contributor Covenant**](http://contributor-covenant.org/version/1/4/) Code of Conduct.
#### Bug Reports & Feature Requests
Please use the [issue tracker](https://github.com/posquit0/koa-rest-api-boilerplate/issues) to report any bugs or ask feature requests.
## Self Promotion
Like this project? Please give it a ★ on [GitHub](https://github.com/posquit0/awesome-engineer-onboarding)! It helps this project **a lot**.
And if you're feeling especially charitable, follow [posquit0](https://posquit0.com) on [GitHub](https://github.com/posquit0).## See Also
- [koa-logging](https://github.com/kasa-network/koa-logging) - A middleware that logs request and response with Pino.
- [koa-request-id](https://github.com/kasa-network/koa-request-id) - A middleware that generates a unique Request ID for every incoming HTTP request.
- [koa-http-client](https://github.com/kasa-network/koa-http-client) - A middleware that attachs HTTP client to communicate with the context during inter-service communications.## License
Provided under the terms of the [MIT License](https://github.com/posquit0/koa-rest-api-boilerplate/blob/master/LICENSE).
Copyright © 2017-2019, [Byungjin Park](http://www.posquit0.com).