Skip to content

PetruccioU/nestjs_rabbitmq_microservices_auth_profile

Repository files navigation

Задача:

  • Наш последний учебный проект разбить на микросервисы. Достаточно сделать проект, состоящий только из двух микросервисов - профиль и авториазация. Проект должен:
  • запускаться через docker
  • у каждого микросервиса должна быть своя отдельная база данных (у одного таблица пользователей, у другого таблица профайла)
  • общение микросервисов между собой организовать через rabbitMq

Ход работы:

  • npm i -g @nestjs/cli
  • nest new api
  • cd api
  • nest generate app auth
  • nest generate app profile

Из nest-cli.json: "monorepo": true - позволяет использовать общий код.

  • $ nest g library shared
    • npm i @nestjs/config @nestjs/microservices

    • npm i --save amqplib amqp-connection-manager

    • npm install --save @nestjs/swagger

    • npm install --save @nestjs/sequelize sequelize sequelize-typescript postgresql

    • npm install --save-dev @types/sequelize

    • nest generate app roles

    • nest generate app token

    • nest generate app user

    • npm i --save-dev @types/uuid

    • npm install --save @types/bcryptjs

    • npm cache clean

    • npm install --save-dev @types/sequelize-typescript

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages