A NestJS authentication starter project with Git hooks, commit linting, and code formatting pre-configured.
- 🚀 NestJS — scalable server-side framework
- 🧹 Prettier — automatic code formatting
- 🛡️ ESLint — code linting for consistent style
- 📝 Commitlint — enforce Conventional Commits
- 🪝 Husky + lint-staged — run linters & formatters on staged files before commit
-
Clone the repo:
git clone https://github.com/your-username/nestjs-auth.git cd nestjs-auth -
Install dependencies:
npm install
-
Start development server:
npm run start:dev
This project uses Husky with the following hooks:
pre-commit: runs Prettier/ESLint on staged files (lint-staged)commit-msg: runs Commitlint to check commit message format
All commits follow Conventional Commits:
Examples:
feat(auth): add JWT strategy
fix(api): correct response format
chore(deps): bump dependency versions
npm run start:dev— start NestJS in watch modenpm run lint— run ESLintnpm run format— run Prettiernpm test— run tests (Jest, with--passWithNoTestsenabled)
nestjs-auth/
├── src/ # source code
├── test/ # test files
├── commitlint.config.cjs
├── .eslintrc.js
├── .prettierrc.json
├── package.json
└── README.md
✨ Happy coding!