- ABP Framework version: v5.3.1
- UI type: Angular
Hi
we have create a solution based on microservice template, we follow the guide to create a new microservice and add it to the solution.
Which is the best way to add a new gateway and new UI app (angular)?
We copy and paste the folders but need a lot of reworks
10 Answer(s)
-
0
Hi,
We have a document for this: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice
Please let me know if I understand wrong your question.
-
0
Hi
I follow the document and I've create a new solution based on microservice.
I add a new service to my new microservice solution and it works fine, so now I want to add a new application so to do that I think:
- add new service (ok)
- add new gateway, I copy the web gateway in the solution and adjust octleton.json
- add new UI app, a new Angular app. I copy a angular app came from new app template
Point 2 and 3 I'm not sure if it's the best way to do.
-
0
Hi,
I will discuss with ABP team and back to you.
-
0
Hello,
There is no automated way to add gateways and applications for microservice template for now.
I would suggest understanding the architecture for microservice applications in details since they are not the same with the new app template. The back-office and public-web applications are used in different purposes. You need to decide in what context you want to use the application for. To add a new application, you need to create the application manually. Based on your use case, dependencies will be different. Afterwards, you need to register it to the auth-server using
OpenIddict Management UI
or theOpenIddictDataSeeder
located under IdentityService or the DbMigrator (which ever you prefer to use).If you are following backend for frontend gateway approach as in the microservice template; you will need to create it manually as well. You can configure it to use the same
WebGateway_Swagger
client for authorization by checking the other gateway configurations. -
0
Hi @gterdem my goal is add a new app (es. a PWA to B2B on eshop example). This new app ass 2 microservice
- Delivery service
- Logistic service
We need to create a new dedicated gateway with Catalog, Ordering, Logistics and Delivery Service an a dadicated app. So my approch is duplicate the gateway project and adjust Seed/CORS/config to allow conncetion but for a quick start to web pwa app I create a normal APP with cli command line and copy&paste angular folder.
The question is it's the best/only path that I've to do that?
-
0
Hi @gterdem my goal is add a new app (es. a PWA to B2B on eshop example). This new app ass 2 microservice
- Delivery service
- Logistic service
We need to create a new dedicated gateway with Catalog, Ordering, Logistics and Delivery Service an a dadicated app.
So my approch is duplicate the gateway project and adjust Seed/CORS/config to allow conncetion but for a quick start to web pwa app I create a normal APP with cli command line and copy&paste angular folder.The question is it's the best/only path that I've to do that?
If you need to create a gateway, yes duplicating the public gateway and customizing it to your needs is a good start. ABP Framework doesn't provide you with any API to create a custom gateway. So, creating a new gateway is your responsibility and you can check Ocelot's documentation for that purpose.
For the second question, as @gterdem mentioned, you need to create the UI application by yourself. If you want you can create it via Application Startup Template and remove the unnecessary projects/packages, and make the related configurations such as updating the Environment.ts file. At that point, ABP Framework can't do anything because this is a custom requirement and you need to make the related configurations by yourself.
Best regards.
-
0
Hi
I've create a new app via suite and use only the angular folder with my microservice solution. So now I'm a little confuse how can I change my tenant.
I try to explain the scenario:
- App create via suite (no microservice)
- Create 2 tenant
- Open the UI
- go to Saas anche switch to tenant
- App with microservice
- Admin app has tenant adminstration
- Second app (create via suite) use microservice and gateway. All function it works fine.
- Need to change tenant.
- If I add sass UI angular module to this app, configure the route to access to SaasMicroservice
- I don't add SAAS module to change tenant (concretly I remove SAAS angular UI module from second app). I can I change tenant? Only via admin app and open the Url of second app. The tenant propagation work via cookies?
Another confusion is releted to default product Microservice that are autogenerated on solution. Why, in angular app, the microservice is "connected" directly to productMicroservice and not to the gateway?
, ProductService: { url: 'https://localhost:44325', rootNamespace: 'MyMicroMicroservice', },
- App create via suite (no microservice)
-
0
For your second application, you can check the public-web application that whichever references you need. For resolving the tenant, you need to have the
UseMultiTenancy
midware and the related dependency with connection string to Saas Service.Another confusion is releted to default product Microservice that are autogenerated on solution. Why, in angular app, the microservice is "connected" directly to productMicroservice and not to the gateway?
It is redirecting to webgateway,
localhost:44325
is the web gateway address. -
0
Hi @gterdem
Thanks for the clarification about gateway I made an error reading ports (gateway & productServices), so related to this why you specify prodcut service if it's still on the same address?
In this case I can remove it or is it better to specify?
export const environment = { production: false, application: { baseUrl, name: 'prj', }, oAuthConfig, apis: { default: { url: 'https://localhost:44325', rootNamespace: 'prj', }, AbpAccountPublic: { url: oAuthConfig.issuer, rootNamespace: 'AbpAccountPublic', }, ProductService: { url: 'https://localhost:44325', rootNamespace: 'prj.ProductService', },
-
0
Hello,
The rootNamespace property of api configuration used by ABP proxy generation. You can remove the url property.