Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haimkastner/node-api-spec-boilerplate
Build API server fast and get API spec and documentation for free - Node.JS boilerplate
https://github.com/haimkastner/node-api-spec-boilerplate
Last synced: about 1 month ago
JSON representation
Build API server fast and get API spec and documentation for free - Node.JS boilerplate
- Host: GitHub
- URL: https://github.com/haimkastner/node-api-spec-boilerplate
- Owner: haimkastner
- License: mit
- Created: 2022-07-03T18:11:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-07T19:44:37.000Z (11 months ago)
- Last Synced: 2024-11-15T23:32:18.317Z (3 months ago)
- Language: TypeScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node.JS API Spec Boilerplate
[](https://github.com/haimkastner/node-api-spec-boilerplate/actions/workflows/actions.yml)
Build API server fast and get API spec, documentation and consumer facade for free
---
📙 For all info of how to create and build it, see [Perfect API Server](https://blog.castnet.club/en/blog/perfect-api-server-part-a) article in [my blog](https://blog.castnet.club/en) 📙
---
`Goal`This boilerplate project used to be a start to API server that includes one-time deceleration of API controller, and from it generate all other required API components, instead of massive code and types duplication for each components.
---
`Includes`This project used to be a boilerplate for building an API server with the following parts:
* Implementation Rest API controllers using [TSOA](https://tsoa-community.github.io/docs/)
* Build app, generate and publish OpenAPI spec using [GitHub Actions](https://github.com/haimkastner/node-api-spec-boilerplate/actions) CI/CD pipes
* Host OpenAPI documentation on [SwaggerHub](https://app.swaggerhub.com/apis/haimkastner/node-api-spec-boilerplate)
* Host [API Server](https://node-api-spec-boilerplate.castnet.club/) instance
* Build OpenAPI based TypeScript SDK [open-api-based-sdk-boilerplate](https://github.com/haimkastner/open-api-based-sdk-boilerplate)
* Hosting example SDK front UI on [NPM regitery](https://www.npmjs.com/package/@haimkastner/open-api-based-sdk-boilerplate)
* Build Frontend API Facade for TypeScript based projects [react-typescript-spec-facade](https://github.com/haimkastner/react-typescript-spec-facade)
* Hosting example app front UI on [Netlify](https://react-typescript-spec-facade.castnet.club/)---
`Config`All config by env vars, see for all options in [./env.example](./.env.example):
* `PORT`: The API Server port, as default it's `8080`---
### `Pase 2 - Long processing via Rest API`
Adding jobs infrastructure required the following implementation:
* A new [jobs service](https://github.com/haimkastner/node-api-spec-boilerplate/blob/with-jobs/src/services/jobs.service.ts) & [API](https://github.com/haimkastner/node-api-spec-boilerplate/blob/with-jobs/src/controllers/jobs.controller.ts).
* TSOA [template](https://github.com/haimkastner/node-api-spec-boilerplate/blob/with-jobs/src/infrastructure/routes.template.hbs) to inject job execution for operation.
* A [middleware](https://github.com/haimkastner/node-api-spec-boilerplate/blob/with-jobs/src/infrastructure/jobify.middleware.ts) for handling request to execute as jobs.For all info of how to implement the job infrastructure, see [Long processing via Rest API](https://blog.castnet.club/en/blog/perfect-api-server-part-c-jobs) article in [my blog](https://blog.castnet.club/en) 📑