项目
在 GitHub 查看
mkosir/typeorm-express-typescript
关于
💊 精简的 Express RESTful API 样板项目。只需一条命令即可启动。使用 TypeScript、TypeORM、Postgres 和 Docker。
系统与基础设施可以做什么
- Express framework
- TypeScript v4 codebase
- TypeORM using Data Mapper pattern
- Easily start local development using Docker Compose with single command npm run docker:dev
实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文TypeORM / Express / TypeScript RESTful API boilerplate
Boilerplate with focus on best practices and painless developer experience:
- Minimal setup that can be extended 🔧
- Spin it up with single command 🌀
- TypeScript first
- RESTful APIs
- JWT authentication with role based authorization
Requirements
Running
Easily set up a local development environment with single command!
- clone the repo
npm run docker:dev🚀
Visit localhost:4000 or if using Postman grab config.
What happened 💥
Containers created:
- Postgres database container seeded with 💊 Breaking Bad characters in
Userstable (default credentialsuser=walter,password=whitein .env file) - Node (v16 Alpine) container with running boilerplate RESTful API service
- and one Node container instance to run tests locally or in CI
Features:
- Express framework
- TypeScript v4 codebase
- TypeORM using Data Mapper pattern
- Docker environment:
- Easily start local development using Docker Compose with single command
npm run docker:dev - Connect to different staging or production environments
npm run docker:[stage|prod] - Ready for microservices development and deployment.
Once API changes are made, just build and push new docker image with your favourite CI/CD tooldocker build -t <username>/api-boilerplate:latest .docker push <username>/api-boilerplate:latest - Run unit, integration (or setup with your frontend E2E) tests as
docker exec -ti be_boilerplate_test shandnpm run test
- Easily start local development using Docker Compose with single command
- Contract first REST API design:
- never break API again with HTTP responses and requests payloads using type definitions
- Consistent schema error response. Your frontend will always know how to handle errors thrown in
try...catchstatements 💪
- JWT authentication and role based authorization using custom middleware
- Set local, stage or production environmental variables with type definitions
- Logging with morgan
- Unit and integration tests with Mocha and Chai
- Linting with ESLint
- Prettier code formatter
- Git hooks with Husky and lint-staged
- Automated npm & Docker dependency updates with Renovate (set to patch version only)
- Commit messages must meet conventional commits format.
After staging changes just runnpm run commitand get instant feedback on your commit message formatting and be prompted for required fields by Commitizen
Other awesome boilerplates:
Each boilerplate comes with it's own flavor of libraries and setup, check out others:
- Express and TypeORM with TypeScript
- Node.js, Express.js & TypeScript Boilerplate for Web Apps
- Express boilerplate for building RESTful APIs
- A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
Contributing
All contributions are welcome!
探索相关项目
加载中…
