Nestjs Microservices Example

screenshot of Nestjs Microservices Example
nestjs

A working example of microservice architecture implementation using nestjs framework.

Overview

Creating a robust API using microservice architecture can be a daunting task, but this example harnesses NestJS to demonstrate a straightforward approach. It serves as an API for a task manager application, enabling functionalities such as user sign-up, email confirmation, and task management. With its well-structured microservices, this implementation showcases how to effectively build and manage an API while maintaining simplicity.

In addition to its functionality, the setup process is made seamless with Docker Compose. This allows users to easily spin up the entire environment for both local development and testing, making it highly accessible for developers seeking to understand and implement microservices with NestJS.

Features

  • User Management: Allows users to sign up and confirm their email addresses seamlessly, ensuring secure access to the application.
  • Task Management: Enables users to create, read, update, and delete their tasks efficiently, streamlining personal productivity.
  • API Gateway: Serves as a central entry point for API requests, managing incoming traffic and directing it to appropriate services.
  • Token Service: Provides functionality for creating, decoding, and destroying JWT tokens, enhancing user authentication and security.
  • Mailer Service: Handles all email communications, specifically for sign-up confirmations, improving user experience from the start.
  • Permission Service: Verifies user permissions for various operations, ensuring that sensitive actions are protected.
  • Microservice Communication: Utilizes TCP sockets for inter-service communication, promoting performance and efficiency.
  • Single Database Instance: While using a single MongoDB instance simplifies deployment, it serves as a convenient starting point for those new to microservice architecture.
nestjs
Nest

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

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.