Nestjs Serverless Boilerplate

screenshot of Nestjs Serverless Boilerplate
nestjs

Serverless Multi-tenant NestJS backend "Boilerplate" + Fastify + Serverless Framework 3 + Graphql + Modules for AWS Serverless Services (SES,SQS,SecretsManager,Aurora RDS)

Overview

This product analysis is about a Serverless Multi-tenant NestJS backend "Boilerplate" that is made with NestJS 8 and the Serverless Framework. It features NestJS, Graphql, Pagination, sorting, searching and filtering for Rest and Graphql APIs, custom validators, IAC using Serverless Framework (AWS), AWS Cognito JWT token validation with AuthGuard, core modules like Cognito, SQS, SES, S3, and SecretsManager, and follows semantic versioning guidelines.

Features

  • NestJS 8 + Fastify + TypeORM: The backend is built using NestJS 8 with Fastify as the underlying web framework and TypeORM as the ORM.
  • NestJS/Graphql - Multiple Endpoints: The application supports multiple endpoints for public, management, and internal use, allowing different levels of access and functionality.
  • Pagination, Sort, Search, and Filtering: The Rest and Graphql APIs provided by the backend support pagination, sorting, searching, and filtering of data to enhance data retrieval capabilities.
  • Business Logic Exceptions with Namespaced Codes: The backend handles business logic exceptions using namespaced codes, allowing for better error identification and handling.
  • Exception Filters and Logging: The application utilizes exception filters and logging mechanisms to provide better error handling and troubleshooting capabilities.
  • IAC Serverless Framework (AWS): The backend is deployed using the Serverless Framework, making it easy to define and manage the infrastructure as code on AWS.
  • Serverless Offline: The development environment includes the use of serverless-offline, which allows for a full working local environment with AWS services mocking.
  • Single Lambda Function: The application uses a single Lambda function, also known as mono-lambda, instead of separate functions for different purposes.
  • Lambda Function URLs: Instead of using Lambda + API Gateway combination, the backend uses Lambda function URLs directly for easier configuration and deployment.
  • Custom Domain Endpoints: The application utilizes Route53, Cloudfront, and Lambda for configuring custom domain endpoints, providing a more user-friendly experience.
  • ARM64 Architecture for Lambda: The Lambda functions in the backend are built and optimized for the ARM64 architecture.
  • 100% AWS-SDK (v3): The application uses the AWS SDK (v3) exclusively for interacting with AWS services, ensuring compatibility and up-to-date features.
  • AWS Cognito JWT Token Validation with AuthGuard: The backend integrates with AWS Cognito for user authentication and authorization, using AuthGuard to validate JWT tokens.
  • Core Modules: The backend includes core modules for AWS services like Cognito, SQS, SES, S3, and SecretsManager, providing easy access and integration with these services.
  • Semantic Versioning: The project follows semantic versioning guidelines, ensuring a consistent and predictable versioning scheme for releases.

Summary

The Serverless Multi-tenant NestJS backend "Boilerplate" is a powerful and feature-rich solution for building serverless applications using NestJS and AWS. With its extensive set of features, including support for multiple endpoints, pagination, sorting, searching, and filtering, it provides a solid foundation for developing scalable and efficient backend systems. The integration with AWS services such as Cognito, SQS, SES, S3, and SecretsManager further enhances the capabilities of the backend. By following semantic versioning and using the Serverless Framework for infrastructure as code, the project ensures modularity, maintainability, and easy deployment.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

graphql
Graphql

A website that uses GraphQL as a query language to manage data fetching and state management. This includes features such as a strongly typed schema, client-side caching, and declarative data fetching to streamline data management and optimize website performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.