Nestjs Rest Microservices

screenshot of Nestjs Rest Microservices

REST API with gRPC back-end microservices built using the NestJS framework. Used for learning/trial & boilerplate purposes only.

Overview

The NestJS REST API Gateway + gRPC microservices project is a monorepo that includes a REST API gateway and gRPC backend microservices. It is built using the NestJS Framework and TypeScript and is primarily intended for learning and trial purposes. The REST API gateway acts as a proxy for the microservices, which handle requests to connect to databases or other services.

Features

  • Microservice Architecture: The project follows a microservice architecture pattern, allowing for modular and scalable development.
  • Subdomain Decomposition: The architecture decomposes functionality into separate microservices, each responsible for a specific domain or task.
  • Externalized Configuration: Configuration settings are externalized, making it easier to manage and update them without modifying the code.
  • Remote Procedure Invocation: The REST API gateway uses remote procedure invocation to communicate with the backend microservices.
  • API Gateway: The NestJS + Express framework acts as the API layer, handling client requests and routing them to the appropriate microservices.
  • Database per Service: Each microservice has its own database, ensuring separation of concerns and scalability.
  • Layers: The architecture includes separate layers for the API, microservices, and persistence, allowing for clear separation of responsibilities.
  • Deployment: The project can be deployed using containers, with provided Docker Compose files and Dockerfiles for each project. For production environments, Kubernetes is recommended for deployment.

Summary

The NestJS REST API Gateway + gRPC microservices project is a monorepo that implements a microservice architecture using the NestJS Framework and TypeScript. It includes a REST API gateway and gRPC backend microservices, with each microservice having its own database. The project follows various design patterns to ensure modularity, scalability, and separation of concerns. It also provides Docker Compose files for easy deployment using containers. Overall, this project serves as a great learning and trial tool for those interested in building scalable microservices architectures.