開發動機
There are a lot of express project templates that support typescript on the Internet, but some structures are too large, or some grammatical structures are far from the original framework because of different writing methods such as decorator, which will cause a steep learning curve.
Therefore, after developing several express server projects, I want to build a template for rapid development, and make this template structure as concise and easy to read as possible, and keep the syntax not much different from the original framework, so that other developers can get started faster.
功能介紹
I developed a boilerplate project to quickly build an Express server, support Sequelize, TypeScript and hot reload.
-
MySQL
using Sequelize v6 and supporting the enhanced BaseModel.
-
Validation
request data validation using yup.
-
Logging
using winston and supporting daily-rotate.
-
Environment variables
using dotenv.
-
API documentation
using swagger-ui-express to serve the API documentation.
-
Testing
using Jest.
-
Error handled and created
error handled by middleware, and using ApiError Class to centrally create the error object.
-
CORS
support CORS.
-
Linting
with ESLint and Prettier.
-
TypeScript
TypeScript is supported.
-
Hot Reload
Hot reload is supported.
開發工具
Express
Sequelize
MySQL
TypeScript
Swagger
Jest
winston
yup