{"id":13602758,"url":"https://github.com/cdimascio/generator-express-no-stress","last_synced_at":"2025-04-08T13:00:26.394Z","repository":{"id":19270835,"uuid":"80230875","full_name":"cdimascio/generator-express-no-stress","owner":"cdimascio","description":"🚂 A Yeoman generator for Express.js based 12-factor apps and apis","archived":false,"fork":false,"pushed_at":"2025-03-09T03:13:18.000Z","size":9997,"stargazers_count":597,"open_issues_count":3,"forks_count":82,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-01T12:00:08.659Z","etag":null,"topics":["12-factor","babel","express","express-js","expressjs","openapi","openapi3","scaffold","structured-logging","swagger","yeoman-generator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://buymeacoffee.com/m97tA5c"}},"created_at":"2017-01-27T17:45:14.000Z","updated_at":"2025-03-09T16:36:12.000Z","dependencies_parsed_at":"2024-01-08T07:57:54.587Z","dependency_job_id":"61747cfc-9162-4695-862d-3b281e9c3774","html_url":"https://github.com/cdimascio/generator-express-no-stress","commit_stats":{"total_commits":306,"total_committers":21,"mean_commits":"14.571428571428571","dds":0.5555555555555556,"last_synced_commit":"122a40991166f19e4c84eeea13805259818737ab"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fgenerator-express-no-stress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdimascio","download_url":"https://codeload.github.com/cdimascio/generator-express-no-stress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247847596,"owners_count":21006098,"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","babel","express","express-js","expressjs","openapi","openapi3","scaffold","structured-logging","swagger","yeoman-generator"],"created_at":"2024-08-01T18:01:37.152Z","updated_at":"2025-04-08T13:00:26.364Z","avatar_url":"https://github.com/cdimascio.png","language":"JavaScript","funding_links":["https://buymeacoffee.com/m97tA5c","https://www.buymeacoffee.com/m97tA5c"],"categories":["JavaScript","babel","⚙️ Backend \u0026 APIs"],"sub_categories":[],"readme":"# 🚂 generator-express-no-stress\n\n![](https://img.shields.io/badge/status-stable-green.svg) ![](https://img.shields.io/npm/v/generator-express-no-stress.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/56c006ccc44c47f49d12b6b35fcf35da)](https://www.codacy.com/app/cdimascio/generator-express-no-stress?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=cdimascio/generator-express-no-stress\u0026utm_campaign=Badge_Grade) [![](https://img.shields.io/gitter/room/cdimascio-oss/community?color=%23eb205a)](https://gitter.im/cdimascio-oss/community) [![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-) ![](https://img.shields.io/badge/license-MIT-blue.svg)\n\nCreate awesome [Express.js](http://www.expressjs.com) applications with best of breed tech including ES.next via [Babel.js](https://babeljs.io/), structured logging with [Pino](https://github.com/pinojs/pino), API validation and interactive documentation using an [OpenAPI 3.x](https://swagger.io/specification/), environment based config with [dotenv](https://github.com/motdotla/dotenv), and linting with [ESLint](http://eslint.org/).\n\n[![GitHub stars](https://img.shields.io/github/stars/cdimascio/generator-express-no-stress.svg?style=social\u0026label=Star\u0026maxAge=2592000)](https://GitHub.com/cdimascio/generator-express-no-stress/stargazers/) [![Twitter URL](https://img.shields.io/twitter/url/https/github.com/cdimascio/generator-express-no-stress.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20express-no-stress%20by%20%40CarmineDiMascio%20https%3A%2F%2Fgithub.com%2Fcdimascio%2Fgenerator-express-no-stress%20%F0%9F%91%8D)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/cdimascio/generator-express-no-stress/master/assets/express-no-stress-logo-v.png\"\u003e\n\u003c/p\u003e\n\ngenerator-express-no-stress 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 request and response validation, structured logging, environment driven config, and more. Simply run the generator and smile :-D\n\n[Here's what you get!](#what-you-get)\n\n## Install\n\n_Requires Node 8 or greater_\n\n```shell\nnpm install -g yo@4.3.0 generator-express-no-stress\n```\n\n- See [here](#usage-cli) for use with Yarn and/or Docker\n- See [here](#faqs) for Node 6 support\n\n## Scaffold\n\n```shell\nyo express-no-stress 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 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 e.g. [VSCode](#debug-in-vscode):\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 [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 lint`       | View a listing of all errors discovered by the linter                    |\n| `npm run lint:fix`   | Fix all errors discovered by the linter                                  |\n| `npm start`          | Run the in _production_ mode. |\n\n### Debug in VSCode\n\nAdd these [contents](https://github.com/cdimascio/generator-express-no-stress/blob/next/assets/.vscode/launch.json) to your `.vscode/launch.json` file\n\n### Debug in WebStorm\n\n1. Start debug in _development_ mode via `npm run dev:debug`\n2. From the \"Run\" menu, select \"Debug\"\n3. Select \"Edit Configurations...\"\n4. From the list of Templates on the left side of the dialog, select \"Attach to Node.js/Chrome\"\n5. Press the \"Debug\" button to attach the WebStorm debugger\n\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 myapp --yarn\ncd myapp\n\n# run in development mode\nyarn run dev\n\n# run in production mode\nyarn start\n\n# test\nyarn test\n```\n\n---\n\n## What you get!\n\n- [Express.js](http://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- [ESLint](http://eslint.org/) - a pluggable linting utility for JavaScript and JSX\n\n  Choose from the following ESLint lint rules:\n\n     - [Airbnb](https://github.com/airbnb/javascript) - A mostly reasonable approach to JavaScript\n     - [Prettier](https://github.com/prettier/prettier) - Prettier is an opinionated code formatter\n\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 request validation (OpenAPI 3.x)\n- API response validation\n  - To enable set `OPENAPI_ENABLE_RESPONSE_VALIDATION=true` in `.env`\n  \n\n#### Interactive API Doc\n\n![](https://raw.githubusercontent.com/cdimascio/generator-express-no-stress/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://raw.githubusercontent.com/cdimascio/generator-express-no-stress/master/assets/api-validation.png)\n\n### Structured Logging\n\nStructured logging out of the box!\n\n#### raw\n\n![](https://raw.githubusercontent.com/cdimascio/generator-express-no-stress/master/assets/logging-raw.png)\n\n#### pretty\n\nStructured logging pretty printed by default - great for dev!\n\n![](https://raw.githubusercontent.com/cdimascio/generator-express-no-stress/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://raw.githubusercontent.com/cdimascio/generator-express-no-stress/master/assets/interactive-doc.png)\n\n### Linting\n\nexpress-no-stress uses [ESLint](http://eslint.org/) and provides two choices, Airbnb or Prettier.\n\nTo add your own ESLint customizations, edit`eslint.conf.mjs`.\n\nNote that the Airbnb variant provides a slightly modified Airbnb [base](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) configuration.\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.js` - 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.js`\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\n\u003ca href=\"https://www.buymeacoffee.com/m97tA5c\" target=\"_blank\"\u003e\u003cimg src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/yellow_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://github.com/leosuncin\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/4307697?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJaime Leonardo Suncin Cruz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=leosuncin\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/amygdaloideum\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/18416252?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel Bornstrand\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=amygdaloideum\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.about.me/jasoncorns\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/3839416?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJason Corns\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=JasonAllenCorns\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://frankcalise.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/374022?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFrank Calise\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=frankcalise\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://blog.daskepon.com/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6374952?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaisuke Tsuji\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=daskepon\" title=\"Documentation\"\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/commits?author=uronly14me\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://mkly.io\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/965353?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMike Lay\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=mkly\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jodejar214\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/9385902?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ejodejar214\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/cdimascio/generator-express-no-stress/commits?author=jodejar214\" 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","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdimascio%2Fgenerator-express-no-stress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Fgenerator-express-no-stress/lists"}