Swagger-like to Nestjs Microservices - microservices

Is there any swagger-like to nestjs microservices?
The #nestjs/swagger lib only accepts normal nestjs applications, not microservices.

OpenAPI (aka Swagger) is specifically made for REST applications. If you're looking for documenting your Microservices, you can use something like Async API. There's a community package for NestJS as well that's currently in the works. You can watch the project for updates.

Related

Presenting Serverless Microservices

I've used microservice architecture for years. I've also used serverless functions for years. But I've never found a neat was to present groups of serverless functions as microservices.
Server based approach
I'm a big fan of presenting HTTP APIs (internal and external) using OpenAPI specs. It enables a self-updating UI (Swagger) as well as the ability to generate SDKs.
In a server based architecture, each microservice would have its own OpenAPI spec (generated using something like Springfox, Swashbuckle etc). Then the overall system's public API Gateway would have its own spec, exposing the relevant internal calls.
Serverless equivalent?
I'm aiming to implement a serverless-microservice architecture on AWS. Replacing webserver-based logic with collections of Lambda functions isn't an issue. My question is: How do you present a collection of related Lambda functions as a microservice?
Are private gateways the right tool for the job?
I've considered using private API Gateways to present groups of Lambda functions. This would mean having a public API Gateway, pointing to multiple private Gateways. I've not seen this approach used before (which is why I question it being the optimal answer). I'd welcome any criticism of it as well as alternative ways to achieve the same thing.
My phone buzzed this morning and this Medium article popped up.
Seems to validate the private Gateway approach. Credit to Mehmet Ozkaya.

Microservices architecture and tools to use with SpringBoot

I have been researching and working on a personal project using Java SpringBoot in a Microservices architecture, but I have seen many different tutorials using many different tools.
I have seen most tutorials use Zuul Proxy and routing, Eureka, Feign, Ribbon, etc. So my question is, what each of those components is responsible for, when, why, and how I should implement those components in my project?

GraphQL with API Gateway

Team,
I was an evaluating architecture and it seems that the architecture plans to have a BFF like GraphQL sitting before API Gateway like APIGEE. Just to add, the backend microservices are written in Spring Boot.
Does it make sense to have both BFF and APIGEE? Is there anything that can't be handled via GraphQL which has to be taken care of by the API Gateway?
Thanks
Ashish
In case you missed that API Gateway is now available: https://cloud.google.com/api-gateway/docs/about-api-gateway
I am also currently running a Cloud Run service (kotlin/spring-boot) with a GraphQL endpoint and will try to bring it together with the API Gateway (beta)

What is the purpose of generating an Entity into the Jhipster Gateway?

I saw in many tutorials that we need to go back to gateway and generate an entity after generating a microservice application with the same entity.
Can someone explain me, the architectural benefits of doing so?
What is the goal of generating those entities again in Gateway?
One of the points of doing that is to implement the Backend for Frontend pattern.
Basically you proxy all calls from your front-end to your microservices through the gateway. For convenience reasons the frontend is packaged together with the gateway.
JHipster just adapted the exisiting entity generators from monoliths to let users generate the backend and front-end of an entity separately on microservices and gateways respectively. Of course this is an optional feature and you are free to use it the way you want.
You can use different ways for different purposes to reach the service a microservice is offering to you. As mentioned here you don't have to use AngularJS or Angular, but you can also use React and/or Ionic.
In general you can use more than one gateway to all or only a choice of microservices per gateway (a very good example implementing different gateways is shown here).

Nested GraphQL servers / microservices

I would like to replace all my REST APIs with GraphQL (apollo-server preferred). It's clear to me how to use GraphQL in monolithic apps but it's not clear how to do it for microservices.
The main API server consists of multiple microservices where each microservice exposes its own REST API through which the central API server communicates with it. I would like to replace all these REST APIs with GraphQL thus I would get microservices as nested GraphQL servers communicating with each other through GraphQL instead of REST.
The problem that I'm facing is how to easily build a GraphQL query string for microservices based on the received attributes in the resolver of the main GraphQL server. There is no way to tell GraphQL to return all the fields for microservice. The best way would be to simple forward just a part of a the main query further to a microservice.
Any ideas? Do you think that REST is still more appropriate for microservices then GraphQL?
I can suggest you to use WAMP protocol and then build a network of all of your functionality.
Finally serve it under 1 GraphQL server

Resources