Author: Panos

JWT and Passport JWT Strategy for your NestJS REST API Project
| |

JWT and Passport JWT Strategy for your NestJS REST API Project

NestJS offers us the solo @nestjs/jwt module that allows us to integrate JWT in our project.
The Passport package is a massively used NodeJS library, whose “sole purpose is to authenticate requests, which it does through an extensible set of plugins known as strategies.
Here is a detailed post of how you can implement them in your project.

NestJS: Use a solo @injectable class as a singleton Provider
| |

NestJS: Use a solo @injectable class as a singleton Provider

NestJS Modules are Singletons by default. Their Providers are also singletons when they are provided from within the same module. However, there are cases where we want to use just a single solo class as provider to a couple or more modules. In such cases we can use the solo class as singleton or not. Let’s see how we can do that.

MongoDB schema validation rules

MongoDB schema validation rules

MongoDB is a very popular free and open-source cross-platform document-oriented database. It is a NoSQL database and it is based on JSON-like documents. Document-based databases are either schema-less or they provide a certain level of flexibility defining schemas using schema validation rules.
The purpose of this post is to demonstrate how we can apply some schema validation rules in a collection.

Step ahead fast, with NestJS environment configuration
|

Step ahead fast, with NestJS environment configuration

NestJS provides the necessary documentation for working with different environments (development, production, etc.) using external configuration files and environment variables. So, if you have already taken a look there, then the below provided cases, will give you a hand to start implementing your (relatively simple) project as well.

gh – GitHub Command Line Tool

gh – GitHub Command Line Tool

This is a short intro for the gh -the GitHub Command Line Tool. Prior to the gh introduction, most of the job, working with terminal and trying to automate somehow the interaction with GitHub repositories, required the using of other CLI tools like curl. This was not such a handy approach, especially for DevOps. But now, we can rely on the gh tool that simplifies quite a lot, the automation of operations needed to deal with GitHub repos.