Home

Awesome

<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> </p>

Nestjs Permission Boilerplate

Description

This is a basic Nest boilerplate project built on the more powerful node.js framework. The main purpose of this project is to dynamically handle roles and permissions assigned to the user

Installation

# install nodejs packages
$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Database

Postgres is the database we use in the project, on the other hand you can install the package for your database and start enjoying.

# create database 
$ docker-compose up

# generate database structure
$ npm run migrate

# insert roles, permissions and users
$ npm run seed

Swagger

Users

Features

Project Structure

src
├── common
│  ├── decorators
│  ├── dtos
│  ├── enums
│  └── http
│     ├── exceptions
│     ├── http-error-type.ts
│     ├── http-exception.filter.ts
│     └── response.interceptor.ts
├── config
│  └── swagger.config.ts
├── database
│  ├── entities
│  │  └── base.entity.ts
│  ├── migrations
│  ├── seeds
│  ├── database.module.ts
│  └── database.providers.ts
├── helpers
│  └── hash.helper.ts
├── libs
│  └── pagination
├── modules
│  ├── admin
│  │  ├── access
│  │  │  ├── permissions
│  │  │  ├── roles
│  │  │  ├── users
│  │  │  └── access.module.ts
│  │  └── admin.module.ts    
│  └── auth
│     ├── decorators
│     ├── dtos
│     ├── enums
│     ├── guards
│     ├── services
│     ├── auth.controller.ts
│     ├── auth.module.ts
│     └── jwt.strategy.ts
├── app.module.ts
└── main.ts

Stay in touch

License

Nest is MIT licensed