Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgecoke/express-typescript-swagger-zod-template
Express ๐ template, including Typesafety ๐ก, with automatic Swagger OpenApi ๐ docs generator and Zod validator ๐ฆ
https://github.com/jorgecoke/express-typescript-swagger-zod-template
express expressjs openapi swagger typescript zod
Last synced: about 2 months ago
JSON representation
Express ๐ template, including Typesafety ๐ก, with automatic Swagger OpenApi ๐ docs generator and Zod validator ๐ฆ
- Host: GitHub
- URL: https://github.com/jorgecoke/express-typescript-swagger-zod-template
- Owner: JorgeCoke
- Created: 2024-04-19T12:40:46.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-03T08:20:16.000Z (9 months ago)
- Last Synced: 2024-05-03T13:22:22.406Z (9 months ago)
- Topics: express, expressjs, openapi, swagger, typescript, zod
- Language: TypeScript
- Homepage:
- Size: 1.48 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Express + Typescript + Swagger + Zod [Template]
**Express** ๐ template, including **Typesafety** ๐ก, with **automatic Swagger OpenApi** ๐ docs generator and **Zod validator** ๐ฆ
## โจ Features
- ๐ [Express](https://expressjs.com/) NodeJS server
- ๐ [Swagger](https://swagger.io/) OpenApi definition automatically generated based on your Zod Schemas, served vรญa Swagger UI
- ๐ฆ [Zod](https://zod.dev/) Validate inputs and outputs, type Req and Res objects automagically, under a Typesafety environment
- ๐ Scalable Project Structure, split features into modules
- ๐งช Powerful testing suite setup with [Vitest](https://vitest.dev/) and [Supertest](https://www.npmjs.com/package/supertest). Unitary and Integration test included, +90% code coverage report included!
- ๐ [Morgan](https://www.npmjs.com/package/morgan) Log retention. Save your request logs automatically with an automated rotating write stream
- ๐ฒ [Pino](https://github.com/pinojs/pino) logger
- โ Global Error Handler included
- โค๏ธโ๐ฉน Monitoring Health check endpoint included
- ๐ Security middlewares provided: [Helmet](https://www.npmjs.com/package/helment) for HTTP header security, [CORS](https://www.npmjs.com/package/cors) setup, and [Rate Limiting](https://www.npmjs.com/package/express-rate-limit)
- ๐ [InversifyJS](https://github.com/inversify/InversifyJS) Dependency Injection
- ๐ Latest stable NodeJS working environment, with .env config variables validated with [Zod](https://zod.dev/)
- ๐จ [ESLint](https://www.npmjs.com/package/eslint) & [Prettier](https://www.npmjs.com/package/prettier) as linter and formatter
- ๐ถ Pre-Commit and Commit [Husky](https://github.com/typicode/husky) hooks (Runs linter and formatter before any commit against staged files only!)
- ๐ Commit nomenclature rules following [Conventional Commit Format](https://commitlint.js.org/) and [Commitizen CLI](https://github.com/commitizen/cz-cli) (emoji [powered](https://github.com/folke/devmoji))
- ๐ Release management policy with [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version), including automagically CHANGELOG.md generation, version bumping and GitTags
- ๐ฆ Included [npm-check](https://www.npmjs.com/package/npm-check) to check for outdated, incorrect, and unused dependencies.
- ๐ฅท๐ป Included [better-npm-audit](https://www.npmjs.com/package/better-npm-audit) to check for dependency vulnerabilities## ๐ Getting Started
```
npm ci # Install dependencies
cp .env.example .env # And fill .env file variables
npm run dev # Launch project locally
```## ๐จ Linter & Formatter
```
npm run lint # Run ESLint
npm run format # Run Prettier
```## โฉ Git Commit with Commitizen
```
git add . # Add files
npm run cz # Commit with Commitizen CLI
```## ๐ Release a new version
```
npm run release # Bump version and generate CHANGELOG.md
git push --follow-tags # Push changes and GitTag to origin
```## ๐ฆ Check vulnerabilities and update outdated dependencies
```
npm run npm:audit # Check dependency vulnerabilities
npm run npm:check # Check outdated dependencies
```## ๐ Build and launch
```
npm run build # Compile project
npm run start # Launch
```## ๐งช Testing
```
npm run test # Run all tests
npm run test:cov # Run all tests with code coverage report
npm run test:unit # Run unitary tests
npm run test:integration # Run integration tests
```