A production-ready NestJS authentication starter with JWT, Refresh Token, Prisma, and Bcrypt — designed to help you kickstart secure backend projects quickly and efficiently.
Built with NestJS, this starter project follows clean architecture and best practices for scalable authentication APIs.
- ✅ JWT Authentication (Access + Refresh Tokens)
- ✅ Secure Password Hashing with Bcrypt
- ✅ Refresh Token Rotation & Cookie Management
- ✅ User Registration & Login
- ✅ Role-Based Authorization
- ✅ Prisma ORM Integration
- ✅ Swagger Documentation Integration
- ✅ TypeScript Support
- ✅ Error Handling & Validation
- ✅ Clean, Modular Folder Structure
git clone https://github.com/sakilanwar12/nest-auth
cd nest-auth
pnpm installAdjust the secrets and database URL according to your setup.
cp .env.example .env
# dev server (watch mode)
$ pnpm run dev
# production mode
$ pnpm run start:prodThe app will run on: 👉 http://localhost:3000
Swagger Docs: http://localhost:3000/api/docs#/
- Saves hours of setup time
- Follows NestJS best practices
- Includes token rotation and cookie management
- Ready for production deployment
- Easy to extend for OAuth, 2FA, or role-based systems
- Google / GitHub OAuth integration
- Email verification system
- Two-Factor Authentication (2FA)
- Forgot / Reset password
This project is licensed under the MIT License — free to use, modify, and distribute. Author
Frontend & Backend Developer — specializing in scalable web applications
NestJS authentication starter, NestJS JWT refresh token, NestJS Prisma auth, NestJS login register example, secure NestJS boilerplate, NestJS authentication with cookies, NestJS TypeScript starter, backend authentication starter.