Y
Y
Yourmind2019-09-26 17:54:22
Java
Yourmind, 2019-09-26 17:54:22

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?
5d8cd0ba6a6c3874204896.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IDONTSUDO, 2019-10-29
@IDONTSUDO

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 question

Ask a Question

731 491 924 answers to any question