This is a template for a NestJS API. It is based on the Nest
- Node 16.0.0 or later
- Yarn 1.22.10 or later
- MySQL 8.0.25 or later
Optional:
- Docker 25.0.0 or later
$ yarn install
Create a .env
file in the root of the project with the content of the .env.example
file.
cp .env.example .env
Edit the .env
file with the appropriate values.
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# Build the image
$ docker build -t nest-api-template .
# Run the container
$ docker compose up
# Create a new migration
# Yarn
$ npm_config_migration_name=[nombre_de_la_migracion] yarn run migration:create
# NPM (recommended)
$ npm run migration:create --migration_name=[nombre_de_la_migracion]
# Run the migrations
$ yarn run migration:run
# Revert the migrations
$ yarn run migration:revert
- Author - fermelli
- Authentication with JWT
- Sign up
- Sign in
- Me
- Authorization with roles and permissions
- Permission guard
- Permission decorator
- Public decorator
- User management
- Create user
- Get users
- Get by email
- Get user
- Delete user
- Soft delete user
- Restore user
- Assign roles
- Assign permissions
- Get all permissions (permissions from roles and direct permissions)
- Role management
- Create role
- Get roles
- Get role
- Update role
- Delete role
- Assign permissions
- Permission management
- Get permissions
- Get permission