{"id":21806499,"url":"https://github.com/thibseisel/node-api-starter","last_synced_at":"2026-04-06T02:34:16.375Z","repository":{"id":129022752,"uuid":"364522653","full_name":"thibseisel/node-api-starter","owner":"thibseisel","description":"Template project for building a TypeScript node REST API","archived":false,"fork":false,"pushed_at":"2021-05-05T09:21:41.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T05:06:44.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thibseisel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-05-05T09:20:29.000Z","updated_at":"2021-05-12T15:30:30.000Z","dependencies_parsed_at":"2023-05-02T21:26:29.285Z","dependency_job_id":null,"html_url":"https://github.com/thibseisel/node-api-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/thibseisel/node-api-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibseisel%2Fnode-api-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibseisel%2Fnode-api-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibseisel%2Fnode-api-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibseisel%2Fnode-api-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibseisel","download_url":"https://codeload.github.com/thibseisel/node-api-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibseisel%2Fnode-api-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31457722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-27T12:20:08.512Z","updated_at":"2026-04-06T02:34:16.359Z","avatar_url":"https://github.com/thibseisel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node API starter\n\nThis is a template project for quickly setting up a server-side web application with the following tech stack:\n\n- nodejs\n- TypeScript\n- Express\n- Docker\n\n# What's included?\n\n## Pre-build features\n\n- JSON Web Token-based authentication\n- Global error handling\n- API response standardization (subclasses of `ApiResponse`)\n\n## Tooling\n\n- A standard project structure that groups files by feature and separates tests from production sources\n- 2 configurations to run the application in development mode or to build for production\n- Automated server restart on local code change\n- Self-hosted OpenAPI documentation\n- Unit and end-to-end automated tests\n- Portable static code analysis\n- Consistent code formatting\n- Pre-commit code quality validation\n- Full integration with the following editors:\n  - Visual Studio Code\n  - IntelliJ / WebStorm\n\n# Getting started\n\n## Prerequisites\n\nYou need to have the following software installed:\n\n- nodejs 14.x\n- Docker Compose\n\n## Project initial setup\n\nFollow these steps to quickly setup your new project from this template:\n\n1. Either clone or download this project's sources as a zip archive. If you cloned this repository make sure to delete the `.git` folder and run `git init` so that the commit history is reset.\n\n2. Open `package.json` with a text editor and replace values for `name`, `description`, `version`, `author`, etc. to match your project's.\n\n3. Run the following command:\n   ```bash\n   docker-compose build\n   ```\n   This may take a few minutes depending on your internet connection.\n\n# Running the app\n\nThe whole development environment is run within Docker containers.\nExecute the following command to start all containers:\n\n```bash\ndocker-compose up -d\n```\n\nYou should now have a container listening on `localhost:8081`.\nYou're now ready to code the next Facebook!\n\n# Debugging\n\nWhen running the application in development mode (the default when using `docker-compose.yml`), the app process is waiting for the debugger to attach on port `9229`.\nDepending on your text editor you may need to add a specific configuration.\n\n## Visual Studio Code\n\nLaunch the pre-configured `Docker: Attach to Node` Run and Debug configuration to attach the debugger.\n\n## IntelliJ / Webstorm\n\nYou should use the pre-configured `Attach to Node` Run configuration to attach the debugger.\n\n# Running tests\n\nYou can run all tests at once using the following command:\n\n```bash\nnpm test\n```\n\nIf you need to run a specific test (for example `token.spec.ts`):\n\n```bash\nnpm test token\n```\n\nTo re-run tests on code change so that you can go TDD:\n\n```bash\nnpm test -- --watch\n```\n\n## Debugging tests\n\nBecause tests are run locally with `ts-node` and not from within the container, attaching the debugger using the procedure described above won't work.\n\nSee the section that matches your code editor below.\nIf you are using another editor, you may need to configure it to run `jest` with the debugger active.\n\n### Visual Studio Code\n\nOpen the spec file containing the test you'd like to debug, then launch the `Run tests in current file` Run and Debug configuration.\n\n### IntelliJ / Webstorm\n\nThese IDEs should have built-in support for the Jest test framework.\nOpen the spec file you'd like to debug, click on the green arrow gutter icon that's on the same line as the `describe`,\n`it` or `test` function call, then select \"Debug\" in the dropdown list.\n\n# What dependencies are included and why?\n\n| Dependency                  | Rationale                                                                             |\n| --------------------------- | ------------------------------------------------------------------------------------- |\n| `compression`               | Adds Gzip compression to Express responses, making requests faster                    |\n| `express`                   | Web server framework                                                                  |\n| `express-async-handler`     | Simplifies defining express middlewares that use ES6 `async/await`                    |\n| `express-jwt`               | Add support for stateless authentication with JSON Web Tokens                         |\n| `jsonwebtoken`              | Generate and parse JSON Web Tokens                                                    |\n| `lodash`                    | Array operators and general purpose utilities                                         |\n| `luxon`                     | Safe replacement of JS `Date`                                                         |\n| `module-alias`              | Defines aliases to avoid importing modules with backwards paths                       |\n| `morgan`                    | Request logging middleware for Express                                                |\n| `multer`                    | Express middleware to handle file uploads                                             |\n| `swagger-ui-express`        | Serves interactive API documentation from OpenApi3 definition                         |\n| `tslib`                     | Reduces duplication of compiled code when using features only available in TypeScript |\n| `winston`                   | Logger facade for nodejs                                                              |\n| `winston-daily-rotate-file` | Strategy for rotating log files                                                       |\n\n| Dev dependency                     | Rationale                                                                                                   |\n| ---------------------------------- | ----------------------------------------------------------------------------------------------------------- |\n| `@types/*`                         | TypeScript type definitions for JavaScript-only dependencies                                                |\n| `@typescript-eslint/eslint-plugin` | Configures ESLint with additional rules that rely on TypeScript features                                    |\n| `@typescript-eslint/parser`        | Makes ESLint work with TypeScript                                                                           |\n| `concurrently`                     | Defines a package.json task that runs TypeScript and nodemon in parallel                                    |\n| `eslint`                           | Static code analysis for TypeScript                                                                         |\n| `eslint-config-prettier`           | Disables formatting rules from ESLint that conflicts with Prettier                                          |\n| `eslint-plugin-jsdoc`              | Defines rules for checking format of JSDoc comments                                                         |\n| `eslint-plugin-no-null`            | Disallows usages of `null`                                                                                  |\n| `husky`                            | Configures local on-commit hook on install. _Note: stick to husky@4.x for use in non-open source projects_. |\n| `jest`                             | Test framework                                                                                              |\n| `lint-staged`                      | Combined with `husky`, runs lint/format tasks only on files to be committed                                 |\n| `nodemon`                          | Auto-reloads server on file changes, used for development                                                   |\n| `prettier`                         | An anti-bikeshedding file formatter                                                                         |\n| `supertest`                        | Framework for testing HTTP servers                                                                          |\n| `ts-jest`                          | Adds support for running tests written in TypeScript                                                        |\n| `ts-node`                          | Runs TypeScript code by transpiling on the fly, required by `ts-jest`                                       |\n| `typescript`                       | type-safe JavaScript                                                                                        |\n\n# Known issues\n\n- When running tests from the command-line, the last executed end-to-end test that uses `supertest` will report having an open handle. This is a known issue with `supertest` that occurs when using Jest with async functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibseisel%2Fnode-api-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibseisel%2Fnode-api-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibseisel%2Fnode-api-starter/lists"}