English / 简体中文
EST (Express Starter Template) is an opinionated Express/TypeScript/Prisma/PostgreSQL
starter template.
- Based on Express
- TypeScript, of course
- Prisma for ORM
- JWT authentication and role based authorization
- File service with
multer
- Fully configured logger with [Winston] and [Morgan]
- Unit, Integration and E2E tests with [Jest] and [Supertest]
- Linting with
ESLint
- Formatting with
Prettier
- Spelling check with
cspell
- Git commit management with
Husky
,lint-staged
andcommitlint
- Containerised with
Docker
andDocker Compose
- Absolute path with
@/*
EST requires Node version >=14.16.0
Create a repo from this template.
If you prefer to do it manually for a cleaner Git history, do the following:
npx degit recallwei/est my-est-app
cd my-est-app
pnpm i
When using this template, try to update your own information correctly according to the checklist:
- Clean up
README.md
- Change author name in
LICENSE
- Change project name, description, author, etc. in
package.json
- Modify environment variables in
.env
and delete the file.env.example
which is an example of environment variables - Delete the example controller and route information in the
src/routes
directory
- The file service will be saved in the
./storage
directory by default, which is added to.gitignore
by default. The directory can be reset byFILE_STORAGE_PATH
in.env
. Don't forget to add the storage directory to.gitignore
to prevent the stored files from being uploaded to GitHub.
- Node.js >=16.14.0
- pnpm
- PostgreSQL
Config .env
file, refer to .env.example.
pnpm i
pnpm prisma:migrate
pnpm prisma:generate
pnpm prisma:seed
pnpm dev
pnpm build
-
chalk
v5.x doesn't work withts-node
well, usechalk
v4.x instead. - Use
bcrypt.js
instead ofbcrypt
to avoid dependencies installing.
MIT License © 2023 Bruce Song