Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nya1/rest-api-boilerplate
Typescript-based REST API boilerplate with full integration tests
https://github.com/nya1/rest-api-boilerplate
api backend boilerplate eslint express integration-testing jest node openapi rest-api skeleton typescript winston
Last synced: 11 days ago
JSON representation
Typescript-based REST API boilerplate with full integration tests
- Host: GitHub
- URL: https://github.com/nya1/rest-api-boilerplate
- Owner: nya1
- Created: 2020-03-11T19:31:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T20:16:09.000Z (about 2 months ago)
- Last Synced: 2024-10-12T00:27:05.209Z (26 days ago)
- Topics: api, backend, boilerplate, eslint, express, integration-testing, jest, node, openapi, rest-api, skeleton, typescript, winston
- Language: TypeScript
- Homepage:
- Size: 661 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Template updated, visit https://github.com/nya1/ts-api-boilerplate
---
# TypeScript REST API Sample
Basic rest api setup to quickly bootstrap a project based on TypeScript and popular & maintened modules.
**Features**
* Use decorators to describe endpoints and middlewares (thanks to [routing-controllers](https://github.com/typestack/routing-controllers))
* Automatically create a OpenAPI v3 (swagger) file with minimal effort (based on decorators used - thanks to [routing-controllers-openapi](https://github.com/epiphone/routing-controllers-openapi))
* Jest for tests with code coverage (text summary and HTML)
* Unit and integration tests setup, integration tests can be run also against compiled JS server
* Dependency Injection via Inversify
* Linter setup (ESLint + Prettier)
* Configuration via TOML files (using [node-config](https://github.com/lorenwest/node-config))
* Automatically reloads the server if a file changes while developing
* Flexibile logging with winston
* Validate configuration before deployment against a json schema
* *Optional* deployment setup via Serverless (AWS) as a LambdaThe goal of this project is to provide a simple, easy to use base to build new rest apis.
## Documentation
* [Controllers, Middlewares, Services](src/README.md#request-response)
* [Configuration](config/README.md)
* [Development](src/README.md#development)
* [Testing](test/README.md)
* [Deployment](deploy/README.md)## Getting started
Clone this repository
`git clone [email protected]:nya1/rest-api-boilerplate.git my-api-project`
Install
`cd my-api-project && yarn install`
---
Using the following modules
* [routing-controllers](https://github.com/typestack/routing-controllers)
* Request / Response handling
* [class-validator](https://github.com/typestack/class-validator)
* Validate request data
* [class-transformer](https://github.com/typestack/class-transformer)
* For serialization / deserialization
* [routing-controllers-openapi](https://github.com/epiphone/routing-controllers-openapi)
* Allow to describe an OpenAPI spec file by using decorators* [winston](https://github.com/winstonjs/winston)
* Logging