NestJS-Auth

A clean and simple Nest project shipped with Passport(Local, JWT, Google) and RBAC Auth and MongoDB.

folder
NestJS-Auth @root:bash
last login:

NestJS-Auth: Nest and Passort Boilerplate W/ (Local, JWT, Google) Strategies Already Implemented!

Makes a Great NestJS Auth Microservice 🍻

Install with degit or from Github as a template

Step 1.) Install degit
[]:root$ npm i -g degit

Step 2.) Clone with degit, replace <project-name> is the name of your new project.
[]:root$ degit git@github.com:CamSkiTheDev/nestjs-auth-boilerplate.git <project-name>

Configuration

Note: You must register an application with Google to use the Google Auth Strategy. If you have not already done so, a new project can be created in the Google Developers Console. Your application will be issued a client ID and client secret, which need to be provided to the strategy. You will also need to configure a redirect URI which matches the route in your application. The default redirect URI for this project is /google/callback

Create a .env file with these required properties.

APP_BASE_URL=http://localhost:3000
DATABASE_URI=mongodb://127.0.0.1:27017/nestjs-auth
JWT_SECRET=Secure Secret To Generate Auth Tokens
JWT_EXPIRES_IN=7d
GOOGLE_CLIENT_ID=123-G-CLIENT-ID
GOOGLE_CLIENT_SECRET=123-G-CLIENT-SECRET