HtetAungKhant23 / RBAC

learn RBAC with nestjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Role-Based Access Control (RBAC) with NestJS

Introduction

Role-Based Access Control (RBAC) is a crucial aspect of security and permission management in modern web applications. This repository serves as a comprehensive resource for understanding and implementing RBAC in NestJS.

Features

  • Role Management
  • Permission Management (not implement yet)
  • User Role Assignment
  • API Endpoint Authorization
  • Fine-Grained Access Control

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js and npm installed
  • NestJS CLI installed
  • Mysql installed

Installation

  1. Clone the repository :

    git clone https://github.com/HtetAungKhant23/RBAC
  2. Navigate to the project directory :

    cd RBAC
  3. Install dependencies :

    pnpm install
  4. Create .env :

    cp .env.example .env
  5. Configure your database connection in .env:

    DATABASE_URL=your_database_url
    PORT=your_database_port
    JWT_ACCESS_TOKEN=your_jwt_access_token_key
    JWT_REFRESH_TOKEN=your_jwt_refresh_token_key
  6. Migrate your database :

    npx prisma migrate deploy
    npx prisma generate
  7. Start the NestJS application :

    pnpm start:dev

The application will be available at http://localhost:8800/docs.

Reference

Medium Blog by Muhammet Özen

Special thanks to Muhammet Özen for the insightful article that inspired this repository.

About

learn RBAC with nestjs


Languages

Language:TypeScript 96.3%Language:JavaScript 3.7%