Skip to content

valtervalik/Nestjs-TypeORM-Auth-Template

Repository files navigation

Nest Logo

Nestjs Authentication and Authorization Module with TypeORM(PostgreSQL) and Redis

Description

This is an authentication and authorization Nestjs module. It implements JWT access and refresh tokens in the safest way using HTTPOnly cookies and Redis for token invalidation. It also implements user roles and permissions for authorization using Nestjs guards. The database used for storing user, role, and permission entities is PostgreSQL.

In addition to these features, this template provides Two Factor Authentication and Google OAuth2 authentication functionalities.

Steps to Run the Application

  1. Clone the repository: Use git clone command to clone the repository to your local machine.
git clone --depth 1 https://github.com/valtervalik/Nestjs-TypeORM-Auth-Template.git my-app
  1. Enter the project folder and copy .env.example as .env:
cd my-app
cp .env.example .env
  1. Install dependencies: Run any of the following commands to install all the necessary dependencies.
npm install
yarn install
pnpm install
  1. Run docker-compose: Use the following command to start the Docker containers.
docker-compose up -d
  1. Run the application in development mode: Use any of the following commands to start the application in development mode.
npm run start:dev
yarn start:dev
pnpm start:dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages