{"id":13564225,"url":"https://github.com/cdimascio/generator-express-no-stress-typescript","last_synced_at":"2025-04-04T11:07:40.095Z","repository":{"id":21449603,"uuid":"92780080","full_name":"cdimascio/generator-express-no-stress-typescript","owner":"cdimascio","description":"🚄 A Yeoman generator for Express.js based 12-factor apps and apis using Typescript","archived":false,"fork":false,"pushed_at":"2023-07-12T15:22:04.000Z","size":7454,"stargazers_count":362,"open_issues_count":7,"forks_count":43,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T10:08:16.930Z","etag":null,"topics":["12-factor","expressjs","openapi","openapi3","swagger","typescript","yeoman-generator"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdimascio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_HISTORY.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"custom":"https://buymeacoffee.com/m97tA5c"}},"created_at":"2017-05-29T22:33:47.000Z","updated_at":"2025-03-15T12:20:35.000Z","dependencies_parsed_at":"2024-01-16T19:00:12.656Z","dependency_job_id":"1d5a0a14-99af-4054-8341-9bb5f787e90a","html_url":"https://github.com/cdimascio/generator-express-no-stress-typescript","commit_stats":{"total_commits":268,"total_committers":18,"mean_commits":14.88888888888889,"dds":0.5895522388059702,"last_synced_commit":"0a0d02bc4d5b61c3960649c24db620f2a9dd93b3"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdimascio","download_url":"https://codeload.github.com/cdimascio/generator-express-no-stress-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166165,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12-factor","expressjs","openapi","openapi3","swagger","typescript","yeoman-generator"],"created_at":"2024-08-01T13:01:28.294Z","updated_at":"2025-04-04T11:07:40.077Z","avatar_url":"https://github.com/cdimascio.png","language":"TypeScript","funding_links":["https://buymeacoffee.com/m97tA5c","https://www.buymeacoffee.com/m97tA5c"],"categories":["typescript","TypeScript"],"sub_categories":[],"readme":"# generator-express-no-stress-typescript\n\n![](https://img.shields.io/badge/status-stable-green.svg) ![](https://img.shields.io/npm/v/generator-express-no-stress-typescript.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/21e362094c5a4c0da4841fc172cee95d)](https://www.codacy.com/app/cdimascio/generator-express-no-stress-typescript?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=cdimascio/generator-express-no-stress-typescript\u0026utm_campaign=Badge_Grade) [![](https://img.shields.io/gitter/room/cdimascio-oss/community?color=%23eb205a)](https://gitter.im/cdimascio-oss/community) \u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e ![](https://img.shields.io/badge/license-MIT-blue.svg)\nCreate awesome [Express.js](http://www.expressjs.com) applications with best of breed tech including [Typescript](https://www.typescriptlang.org/), structured logging with [Pino](https://github.com/pinojs/pino), API validation and interactive documentation via an [OpenAPI 3](https://swagger.io/specification/) or [Swagger 2](https://swagger.io/specification/v2/) spec, environment based config with [dotenv](https://github.com/motdotla/dotenv).\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/cdimascio/generator-express-no-stress-typescript/master/assets/express-no-stress-logo-ts.jpg\"\n\u003c/p\u003e\n\ngenerator-express-no-stress-typescript gets you up and running in seconds. It's ridiculously easy to configure. Heck, just take the defaults. Start it. Write code.\n\nThis generator scaffolds a fully functioning REST API server complete with interactive documentation, API validation, structured logging, environment driven config, and more. Simply run the generator and smile :-D\n\nThis project is a Typescript variant of [generator-express-no-stress](https://github.com/cdimascio/generator-express-no-stress)\n\n[Here's what you get!](#what-you-get)\n\n## Install\n\n_Requires Node 6 or greater_\n\n```shell\nnpm install -g yo generator-express-no-stress-typescript\n```\n\n- See [here](#usage-cli) for use with Yarn and/or Docker\n\n## Scaffold\n\n```shell\nyo express-no-stress-typescript myapp\ncd myapp\n```\n\n## Run\n\nRun in _development mode_:\n\n```shell\nnpm run dev\n```\n\nPackage and run in _production mode_\n\n```shell\nnpm run compile\nnpm start\n```\n\n## Test\n\n```shell\nnpm test\n```\n\n## Debug\n\nRun one of the following, then attach your favorite inspector.\n\n```shell\n# debug the server\nnpm run dev:debug\n\n# debug the tests\nnpm run test:debug\n```\n\n## Try it!\n\n- Interactive API doc at [http://localhost:3000/api-explorer](http://localhost:3000/api-explorer)\n- Landing page at [http://localhost:3000](http://localhost:3000)\n\n---\n\n## Usage: CLI\n\n```shell\nyo express-no-stress-typescript [appname] [--yarn] [--docker]\n```\n\n| Option     | default | Description                                                                |\n| ---------- | ------- | -------------------------------------------------------------------------- |\n| `appname`  | myapp   | The application folder                                                     |\n| `--yarn`   | -       | Use the [`yarn`](https://yarnpkg.com) package manager, instead of `npm`    |\n| `--docker` |         | Install [Docker](https://www.docker.com/) artifacts including a Dockerfile |\n\n## Usage: Project\n\nThe sections below describe all usage options available once the project is generated/scaffolded.\n\n### npm targets\n\n| Target               | Description                                                              |\n| -------------------- | ------------------------------------------------------------------------ |\n| `npm run dev`        | Run in _development_ mode                                                |\n| `npm run dev:debug`  | Debug in _development_ mode                                              |\n| `npm run test`       | Run tests                                                                |\n| `npm run test:debug` | Debug tests                                                              |\n| `npm run compile`    | Transpile source code for production use                                 |\n| `npm start`          | Run the in _production_ mode. \\*Requires running `npm run compile` first |\n\n### Deploy to the Cloud\n\ne.g. CloudFoundry\n\n```\ncf push myapp\n```\n\n### Use Yarn\n\n```\n# scaffold\nyo express-no-stress-typescript myapp --yarn\n\n# start\ncd myapp\nnpm start\n```\n\n---\n\n## What you get!\n\n- [Typescript](https://www.typescriptlang.org/) - Typescript is a typed superset of JavaScript that compiles to plain JavaScript\n- [Express.js](https://www.expressjs.com) - Fast, unopinionated\n  , minimalist web framework for Node.js\n- [Pino](https://github.com/pinojs/pino) - Extremely fast node.js logger, inspired by Bunyan. It also includes a shell utility to pretty-print its log files\n- [dotenv](https://github.com/motdotla/dotenv) - Loads environment variables from .env for nodejs projects\n- [Swagger](http://swagger.io/) - is a simple yet powerful representation of your RESTful API.\n- [SwaggerUI](http://swagger.io/) - dynamically generate beautiful documentation and sandbox from a Swagger-compliant API\n\n### API Validation\n\nSimply describe your APIs with Swagger and automagically get for free:\n\n- Interactive documentation\n- API validation\n\n#### Interactive API Doc\n\n![](https://github.com/cdimascio/generator-express-no-stress-typescript/raw/master/assets/interactive-doc1.png)\n\n#### API Validation!\n\nOops! I the API caller forgot to pass a `name` field, no stress, we've got this!\n\n![](https://github.com/cdimascio/generator-express-no-stress-typescript/raw/master/assets/api-validation.png)\n\n### Structured Logging\n\nStructured logging out of the box!\n\n#### raw\n\n![](https://github.com/cdimascio/generator-express-no-stress-typescript/raw/master/assets/logging-raw.png)\n\n#### pretty\n\nStructured logging pretty printed by default - great for dev!\n\n![](https://github.com/cdimascio/generator-express-no-stress-typescript/raw/master/assets/logging-pretty.png)\n\n### API Validation Example\n\nSimply describe your APIs with Swagger and automatically get:\n\n- API request validation\n- Interactive documentation\n\n### example\n\n#### Swagger API spec\n\n```yaml\nswagger: '2.0'\ninfo:\n  version: 1.0.0\n  title: myapp\n  description: My cool app\nbasePath: /api/v1\ntags:\n  - name: Examples\n    description: Simple example endpoints\n  - name: Specification\n    description: The swagger API specification\n\nconsumes:\n  - application/json\nproduces:\n  - application/json\n\ndefinitions:\n  ExampleBody:\n    type: object\n    title: example\n    required:\n      - name\n    properties:\n      name:\n        type: string\n        example: no_stress\n\npaths:\n  /examples:\n    get:\n      tags:\n        - Examples\n      description: Fetch all examples\n      responses:\n        200:\n          description: Returns all examples\n    post:\n      tags:\n        - Examples\n      description: Create a new example\n      parameters:\n        - name: example\n          in: body\n          description: an example\n          required: true\n          schema:\n            $ref: '#/definitions/ExampleBody'\n      responses:\n        200:\n          description: Returns all examples\n\n  /examples/{id}:\n    get:\n      tags:\n        - Examples\n      parameters:\n        - name: id\n          in: path\n          required: true\n          description: The id of the example to retrieve\n          type: integer\n      responses:\n        200:\n          description: Return the example with the specified id\n        404:\n          description: Example not found\n\n  /spec:\n    get:\n      tags:\n        - Specification\n      responses:\n        200:\n          description: Return the API specification\n```\n\n#### Invoke a POST request via the Interactive doc\n\n![](https://github.com/cdimascio/generator-express-no-stress-typescript/raw/master/assets/interactive-doc.png)\n\n## FAQ\n**Q**: How do I modify the example API and make it my own?\n\n**A**: There are two key files that enable you to customize and describe your API:\n1. `server/routes.ts` - This references the implementation of all of your routes. Add as many routes as you like and point each route your express handler functions.\n2. `server/common/api.yaml` - This file contains your [OpenAPI spec](https://swagger.io/specification/). Describe your API here. It's recommended that you to declare any and all validation logic in this YAML. `express-no-stress-typescript`  uses [express-openapi-validator](https://github.com/cdimascio/express-openapi-validator) to automatically handle all API validation based on what you've defined in the spec.\n\n**Q**: I previously generated an app, but I want to change the API root. How do I do this?\n\n**A**: You need to make to small changes\n  1. Modify `server/routes.ts`\n  ```javascript\n     // Change your original path e.g. /api/v1/examples, to:\n     app.use('/api/v2/examples', examplesRouter);\n   ```\n\n  2. Modify `server/common/api.yaml` and update the api root:\n  ```yaml\n    # Change e.g. /api/v1 to /api/v2\n    servers:\n    - url: /api/v2   \n  ```\n\n## License\n\n[MIT](LICENSE)\n\n\u003ca href=\"https://www.buymeacoffee.com/m97tA5c\" target=\"_blank\"\u003e\u003cimg src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://blog.brakmic.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/56779?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHarris Brakmić\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=brakmic\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/pubkeypubkey\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/8926560?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel Meyer\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=pubkey\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://otaku.codes\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/13603045?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eViraj Trivedi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=inf3cti0n95\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/uronly14me\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/5186814?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSangbeom Han\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=uronly14me\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.stefdegoey.nl\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/3907488?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStef de Goey\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=Steffion\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Rogermax\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/2633254?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRoger\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=Rogermax\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/bagofjuice\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1395172?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVikash Chauhan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=bagofjuice\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=bagofjuice\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tsekityam\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/3814422?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTse Kit Yam\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=tsekityam\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=tsekityam\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://medium.com/@rlkamradt\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6883379?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRandy Kamradt\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=rkamradt\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/2u6z3r0\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/10853329?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVitthal Patil\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress-typescript/commits?author=2u6z3r0\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Fgenerator-express-no-stress-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdimascio%2Fgenerator-express-no-stress-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Fgenerator-express-no-stress-typescript/lists"}