Language : English | 简体中文
Koa Web
-
Preview: http://localhost:3000/doc.html
Features
- 💡 TypeScript: support TypeScript
- ⚓ Commitlint:git commitlint
- 🎨 Prettier:prettier lint code
- 🚀 Exception:Global exception handling
✈️ Validator:Practical and efficient data validation usage- ⚡ MySQL:Support for MySQL database connections
- 🔥 Redis:Support for Redis database connections
- 🔢 Log:Log SQL and error logs
- ✅ Unit Test:Support unit test
- 📝 API Doc:API Doc UI
Usage
If you are not using the
pnpm
tool, usingnpm
andyarn
are the same to achieve the same performance.
-
install dependencies
$ pnpm install
-
start app
$ pnpm start or $ pnpm prod
-
lint code
$ pnpm lint
-
run test
$ pnpm test
Project Layout
├── .husky // hooks - here start pre-commit and commitlint
├── coverage // test output
├── build // build output
├── logs // log output
│ ├── error // error log
│ └── info // info log
├── src
│ ├── app.ts // koa start
│ ├── app // app modules
│ ├── config // env config
│ ├── typings // ts type
│ └── core // core mudules
│ ├── init.ts // core start
│ ├── global.ts // global var
│ ├── tool.ts // tool
│ ├── exception // global exception
│ ├── log // log modules
│ ├── mysql // mysql modules
│ ├── redis // redis modules
│ ├── swagger // api docs
│ └── validator // data validator
├── test // jest test.ts
├── .cz-config.js // commitlint tip
├── .editorconfig // lint config
├── .gitignore
├── .prettierignore
├── .prettierrc // prettier style config
├── commitlint.config.ts // commit-lint config
├── jest.config.js // jest test config
├── LICENSE
├── package.json
├── pnpm-lock.yaml
├── README.md
└── tsconfig.json
License
Copyright (c) 2022-present, Zeffon Wu