Answer the question
In order to leave comments, you need to log in
How to create a project architecture?
I am writing an online store website. Back-end on spring boot
Since the project is educational, as an understanding of the architecture of microservices, it was decided to divide the back-end into 3 services: api of the project itself, authorization and registration. In the figure, I have attached an approximate architecture of the project. But I don’t understand:
1) In the case of creating a common entry point, all services should communicate through it, or should this only apply to the client (in my picture it’s just like that)?
2) how to make sure that only some pages ask for authorization from us? When I wrote a monolithic application, I explicitly indicated there that with such a request or give, and the pages that do not require authorization were explicitly registered there? Is that possible here? Who should be responsible for this?
Answer the question
In order to leave comments, you need to log in
1) Use JWT
1.1 For example, there is a user, he logs in, receives a JWT in a token, put some unique indicator of it. From the table with users.
1.2. The user sends a request to the 2nd microservice, and there we need to note that this is the user, we take the JWT, decrypt it, we get a unique identifier from there. And that's it.
2) Depends on the session mechanism, as far as I understand you are not familiar with this at all. So for organizing microservices, I advise you to study how JWT is implemented in your stack. And organize sessions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question