Nest Mongo Auth Starter

screenshot of Nest Mongo Auth Starter

A starter code for NestJS REST API using Mongoose, implements the authentication guards.

Overview:

The NestJS-Mongo Authentication Starter is a starter code for creating a NestJS REST API authentication using MongoDB. It aims to provide a quick start on the project by handling the tedious task of implementing authentication, allowing developers to focus on other aspects of the project.

Features:

  • Separation of Concern: Being a NestJS project, it follows the principle of separation of concern, ensuring a clean and organized code structure.
  • JWT Based Authentication: Implements JWT (JSON Web Token) based authentication using the passport middleware, providing a secure way to authenticate users.
  • Custom Guards and Strategies: Allows the implementation of custom guards and strategies, offering flexibility in handling authentication logic.
  • Global Validation Pipe: Supports a global validation pipe that can be overridden with custom validations, ensuring input data is validated correctly.
  • CORS Enabled: Enables Cross-Origin Resource Sharing (CORS) to allow API calls from different domains.
  • Logged Operations: Logs operations using the Nest console logger, providing visibility into API activities.
  • Minimal Implementation: Provides a minimal implementation, allowing developers to extend and customize the project according to their needs.

Summary:

The NestJS-Mongo Authentication Starter provides a convenient starting point for creating a NestJS REST API with MongoDB authentication. It offers key features such as JWT-based authentication, custom guards and strategies, global validation pipe, CORS support, and more. By using this starter code, developers can save time and effort in setting up authentication and focus on other project aspects.