🚀 Use LAUNCH75 Promo Code At Checkout for 75% Off. Limited Time. Expires in 3 days, 18 hours, 38 minutes, 22 seconds.

Full Stack NestJS + NextJS JWT Authentication Tutorial

GitHub Repos:


How to set up JWT authentication and authorization with NestJS and NextJS.


npm i -g @nestjs/cli
nest new fullstackbook-nestjs-jwt
npm install --save @nestjs/passport passport passport-local
npm install --save-dev @types/passport-local
nest g module auth
nest g service auth
nest g module users
nest g service users
createdb fullstackbook-nestjs-jwt
npm i --save @nestjs/config @nestjs/typeorm typeorm pg
npx typeorm migration:create src/migration/create-users-table
npx typeorm migration:create src/migration/create-roles-table
npx typeorm migration:create src/migration/create-users-to-roles-table
npx typeorm migration:create src/migration/insert-roles
npm run typeorm migration:run
npm run typeorm migration:revert
npm i bcrypt
npm i -D @types/bcrypt