I'm creating an application which will be connected to microservices (shared inside company).
Attached screen shows a little of planned architecture
App architecture diagram
As you can see API Gateway (created with Ocelot) will provide easy and quick access point for all endpoints
from Microservices and Application API endpoints. Application API will also have FallbackController
which will return a View of builded Angular app. And this Angular app will be using Gateway API endpoints.
Is this a good approach or should I consider a different one?
For ease of use, I'll explain how it's supposed to work during development:
Angular application will be available on: https:localhost:2137
Application API Swagger docs will be available on: https:localhost:2137/swagger/index.html
Whole solution will contain GatewayAPI
, Application API
and Angular app
.
Application API will be responsible for providing endpoints that will allow to build a specific logic of this solution.
Builded Angular app, located inside this project (Gateway API
Application API
Angular app
), will be using Gateway API endpoints to work. Explanation
Angular will create requests to Gateway API to access Application API endpoints and Microservices API endpoints, but in itself it will be available within the Application (from FallbackController
).
I'm trying to get as much experience as I can, so I will be able to change my current job for something better :D Please, tell me whether what I wrote makes sense or not :)
CodePudding user response:
Yea you can do it like this, but I usually separate the Angular App, the Application API and the Gateway API into separate Microservices for better separation of concerns and the other benefits of that pattern.