{"id":14967366,"url":"https://github.com/mkosir/typeorm-express-typescript","last_synced_at":"2025-04-05T06:06:13.260Z","repository":{"id":41102160,"uuid":"271037782","full_name":"mkosir/typeorm-express-typescript","owner":"mkosir","description":"💊 Minimal Express RESTful API boilerplate. Spin it up with single command. TypeScript, TypeORM, Postgres, Docker.","archived":false,"fork":false,"pushed_at":"2022-10-14T06:23:08.000Z","size":1259,"stargazers_count":446,"open_issues_count":0,"forks_count":142,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-29T05:09:04.293Z","etag":null,"topics":["boilerplate","docker","docker-compose","express","express-boilerplate","jwt","mocha","nodejs","postgres","rest-api","typeorm","typescript"],"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/mkosir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-09T15:18:53.000Z","updated_at":"2025-03-24T15:41:37.000Z","dependencies_parsed_at":"2022-07-16T05:30:48.110Z","dependency_job_id":null,"html_url":"https://github.com/mkosir/typeorm-express-typescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkosir%2Ftypeorm-express-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkosir%2Ftypeorm-express-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkosir%2Ftypeorm-express-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkosir%2Ftypeorm-express-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkosir","download_url":"https://codeload.github.com/mkosir/typeorm-express-typescript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294536,"owners_count":20915340,"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":["boilerplate","docker","docker-compose","express","express-boilerplate","jwt","mocha","nodejs","postgres","rest-api","typeorm","typescript"],"created_at":"2024-09-24T13:37:56.168Z","updated_at":"2025-04-05T06:06:13.226Z","avatar_url":"https://github.com/mkosir.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  TypeORM / Express / TypeScript RESTful API boilerplate\n\n[![CI][build-badge]][build-url]\n[![TypeScript][typescript-badge]][typescript-url]\n[![prettier][prettier-badge]][prettier-url]\n![Heisenberg](misc/heisenberg.png)\n\nBoilerplate with focus on best practices and painless developer experience:\n\n- Minimal setup that can be extended 🔧\n- Spin it up with single command 🌀\n- TypeScript first\n- RESTful APIs\n- JWT authentication with role based authorization\n\n## Requirements\n\n- [Node v16+](https://nodejs.org/)\n- [Docker](https://www.docker.com/)\n\n## Running\n\n_Easily set up a local development environment with single command!_\n\n- clone the repo\n- `npm run docker:dev` 🚀\n\nVisit [localhost:4000](http://localhost:4000/) or if using Postman grab [config](/postman).\n\n### _What happened_ 💥\n\nContainers created:\n\n- Postgres database container seeded with 💊 Breaking Bad characters in `Users` table (default credentials `user=walter`, `password=white` in [.env file](./.env))\n- Node (v16 Alpine) container with running boilerplate RESTful API service\n- and one Node container instance to run tests locally or in CI\n\n## Features:\n\n- [Express](https://github.com/expressjs/express) framework\n- [TypeScript v4](https://github.com/microsoft/TypeScript) codebase\n- [TypeORM](https://typeorm.io/) using Data Mapper pattern\n- [Docker](https://www.docker.com/) environment:\n  - Easily start local development using [Docker Compose](https://docs.docker.com/compose/) with single command `npm run docker:dev`\n  - Connect to different staging or production environments `npm run docker:[stage|prod]`\n  - Ready for **microservices** development and deployment.  \n    Once API changes are made, just build and push new docker image with your favourite CI/CD tool  \n    `docker build -t \u003cusername\u003e/api-boilerplate:latest .`  \n    `docker push \u003cusername\u003e/api-boilerplate:latest`\n  - Run unit, integration (or setup with your frontend E2E) tests as `docker exec -ti be_boilerplate_test sh` and `npm run test`\n- Contract first REST API design:\n  - never break API again with HTTP responses and requests payloads using [type definitions](./src/types/express/index.d.ts)\n  - Consistent schema error [response](./src/utils/response/custom-error/types.ts). Your frontend will always know how to handle errors thrown in `try...catch` statements 💪\n- JWT authentication and role based authorization using custom middleware\n- Set local, stage or production [environmental variables](./config) with [type definitions](./src/types/ProcessEnv.d.ts)\n- Logging with [morgan](https://github.com/expressjs/morgan)\n- Unit and integration tests with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/)\n- Linting with [ESLint](https://eslint.org/)\n- [Prettier](https://prettier.io/) code formatter\n- Git hooks with [Husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged)\n- Automated npm \u0026 Docker dependency updates with [Renovate](https://github.com/renovatebot/renovate) (set to patch version only)\n- Commit messages must meet [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format.  \n  After staging changes just run `npm run commit` and get instant feedback on your commit message formatting and be prompted for required fields by [Commitizen](https://github.com/commitizen/cz-cli)\n\n## Other awesome boilerplates:\n\nEach boilerplate comes with it's own flavor of libraries and setup, check out others:\n\n- [Express and TypeORM with TypeScript](https://github.com/typeorm/typescript-express-example)\n- [Node.js, Express.js \u0026 TypeScript Boilerplate for Web Apps](https://github.com/jverhoelen/node-express-typescript-boilerplate)\n- [Express boilerplate for building RESTful APIs](https://github.com/danielfsousa/express-rest-es2017-boilerplate)\n- [A delightful way to building a RESTful API with NodeJs \u0026 TypeScript by @w3tecch](https://github.com/w3tecch/express-typescript-boilerplate)\n\n[build-badge]: https://github.com/mkosir/express-typescript-typeorm-boilerplate/actions/workflows/main.yml/badge.svg\n[build-url]: https://github.com/mkosir/express-typescript-typeorm-boilerplate/actions/workflows/main.yml\n[typescript-badge]: https://badges.frapsoft.com/typescript/code/typescript.svg?v=101\n[typescript-url]: https://github.com/microsoft/TypeScript\n[prettier-badge]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg\n[prettier-url]: https://github.com/prettier/prettier\n\n## Contributing\n\nAll contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkosir%2Ftypeorm-express-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkosir%2Ftypeorm-express-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkosir%2Ftypeorm-express-typescript/lists"}