Skip to content

An architectural style that structures an application as a collection of services that are Highly maintainable and testable and Loosely coupled

Notifications You must be signed in to change notification settings

alejandro945/ttt-auth-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Auth Microservice ☄️

The Microservice architecture: Is an architectural style that structures an application as a collection of services that are:

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities

Microservices approach is all about handling a complex system, but in order to do so, the approach introduces its own set of complexities and implementation challenges. which we will learn in the next part of this series!

🗺 Roadmap

Resources Description
🧶 Framework New using Nest? Here's everything you need to know!
🧅 Clean Architecture Minimize the human resources required to build and maintain the required system.
🎉 Functional Guide Build production ML pipelines with simple functions.

Nest as Backend Framework 🐱

¿Why Nest?

Nest natively supports the microservice architectural style of development. In Nest, a microservice is fundamentally an application that uses a different transport layer than HTTP. But this does not only stay here Nest supports several built-in transport layer implementations, called transporters, which are responsible for transmitting messages between different microservice instances.

Configuration ⚡️

1-Package Installation

npm i --save @nestjs/microservices

2-Instantiate a Microservice

import { NestFactory } from '@nestjs/core';
import { Transport, MicroserviceOptions } from '@nestjs/microservices';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.createMicroservice<MicroserviceOptions>(
    AppModule,
    {
      transport: Transport.TCP,
    },
  );
  app.listen();
}
bootstrap();

Clean Architecture 🧼

Screenshot This diagram is taken from the official article by Robert C. Martin.

Each circle represents different areas of the software. The outermost layer is the lowest level of the software and as we move in deeper, the level will be higher. In general, as we move in deeper, the layer is less prone to change.

Folder Structure

ttt-auth-microservice
  |- node_modules
  |- src
     |- application
        |- config
            |- environment.ts
        |- app.ts
     |- domain
        |- models
        |- use-cases
           |- impl
     |- infrastructure
        |- driven-adapters
           |- adapters
           |- providers
        |- entry-points
           |- api
     |- index.ts
  |- tests
     |- domain
     |- infrastructure
  .env
  package.json
  READMED.md

About

An architectural style that structures an application as a collection of services that are Highly maintainable and testable and Loosely coupled

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published