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-stagedandcommitlint - Containerised with
DockerandDocker 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 iWhen 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
.envand delete the file.env.examplewhich is an example of environment variables - Delete the example controller and route information in the
src/routesdirectory
- The file service will be saved in the
./storagedirectory by default, which is added to.gitignoreby default. The directory can be reset byFILE_STORAGE_PATHin.env. Don't forget to add the storage directory to.gitignoreto prevent the stored files from being uploaded to GitHub.
- Node.js >=16.14.0
- pnpm
- PostgreSQL
Config .env file, refer to .env.example.
pnpm ipnpm prisma:migrate
pnpm prisma:generate
pnpm prisma:seedpnpm devpnpm build-
chalkv5.x doesn't work withts-nodewell, usechalkv4.x instead. - Use
bcrypt.jsinstead ofbcryptto avoid dependencies installing.
MIT License © 2023 Bruce Song