当前位置: 首页 > 软件库 > 云计算 > >

nestjs-microservices-example

授权协议 Readme
开发语言 Java
所属分类 云计算
软件类型 开源软件
地区 不详
投 递 者 袁永贞
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

This repository shows how you can build API with microservice architecture using nestjs

Features of this example

This example is basically an API for some task manager application. It provides a possibility to perform sign up users, confirm user's emails, manage user's tasks.

Running the example with docker-compose

Execute docker network create infrastructure && cp .env.example .env && docker-compose up -d from the root of the repository

Accessing the API itself and swagger docs for the API

  • Once you launch the API it will be accessible on port 8000.
  • Swagger docs for the API will be accessible locally via URI "http://localhost:8000/api"

Launch services for integration testing (using docker-compose)

  • Execute sudo vim /etc/hosts and add line 127.0.0.1 db to it. This is a temporary step, it will not be required since new update.
  • Execute cp .env.example .env && cp .env.test.example .env.test
  • Execute docker-compose -f ./docker-compose.test.yml up -d from the root of the repository
  • Run cd ./gateway && npm install && npm run test from the root of this repo

Brief architecture overview

This API showcase consists of the following parts:

  • API gateway
  • Token service - responsible for creating, decoding, destroying JWT tokens for users
  • User service - responsible for CRUD operations on users
  • Mailer service - responsible for sending out emails (confirm sign up)
  • Permission service - responsible for verifying permissions for logged in users.
  • Tasks service - responsible for CRUD operations on users tasks records
  • The service interact via TCP sockets

This example uses a SINGLE database (MongoDB) instance for all microservices. This is not a correct point, the correct way is to use a separate DB instance for every microservice. I used one DB instance for all microservices to simplify this example.

 相关资料
  • 我正在构建一个应用程序,其中微服务通过RabbitMQ(请求-响应模式)进行通信 一切正常,但我仍然有一个错误“远程服务中没有定义匹配的消息处理程序。”- 当我向客户端应用程序发送帖子时,它只需通过客户端(ClientProxy)发送包含数据的消息,消费者应用程序就会响应。此功能实际上可以工作,但始终只能第二次使用。我知道这听起来很奇怪,但在我的第一个POST请求中,总是有来自客户的错误,我的每一

  • Vert.x Service Discovery Vert.x Circuit Breaker Vert.x Config

  • Microservices infrastructure 是一个为快速部署全球分布式服务的现代平台。 基础平台包括可以用来管理集群和资源节点数量的控制节点。容器可以自动在 DNS 上注册,从而使其他服务能够定位到它们 一旦 WAN 配置好了,每个集群可以通过 DNS 或者 Consul API 在其他数据中心定位服务。 平台架构: 单数据中心: 多数据中心: 控制节点: 资源节点: Core Co

  • CoolStore Web Application - �� Modern Application on Dapr and Tye ⛵ CoolStore Website is a containerised microservices application consisting of services based on .NET Core running on Dapr. It demonst

  • Sock Shop : A Microservice Demo Application The application is the user-facing part of an online shop that sells socks. It is intended to aid the demonstration and testing of microservice and cloud na

  • zlt-microservices-platform 如果您觉得有帮助,请点右上角 "Star" 支持一下谢谢   1. 总体架构图   2. 功能介绍   3. 项目介绍 技术交流群 交流三群 详细在线文档 :https://www.kancloud.cn/zlt2000/microservices-platform/919418 项目更新日志 文档更新日志 演示环境地址: http://zlt