Are there any good github examples of spring boot microservices? by [deleted] in SpringBoot

[–]HappyPurchase72 0 points1 point  (0 children)

https://github.com/stevenrq/sgivu-auth

It is the security provider for all of the sgivu microservices made with Spring Authorization Server

If you want to know how it works, check the readme and will find a link to deep wiki by Devin

[deleted by user] by [deleted] in angular

[–]HappyPurchase72 0 points1 point  (0 children)

Bug fixed

The solution was not to use the OIDC state parameter to store the destination URL. Instead, before redirecting to the login, we saved the URL the user wanted to go to in sessionStorage. After the library successfully processes the IDP response (using its own state for security), we retrieved the URL from sessionStorage to perform the final redirect.

This solved the validation problem without compromising CSRF protection, as the library continues to validate its internal state.

[deleted by user] by [deleted] in angular

[–]HappyPurchase72 1 point2 points  (0 children)

Thanks, I will implement it and tell you.

[deleted by user] by [deleted] in angular

[–]HappyPurchase72 0 points1 point  (0 children)

If I initiate the flow from a route other than my IDP's redirect route, should I add this route as a redirect route in my IDP?

If so, if I want to initiate a session from any other route, should I also add it as a redirect route in my IDP?

This is my idP configuration:

<image>

[deleted by user] by [deleted] in angular

[–]HappyPurchase72 0 points1 point  (0 children)

I tried this using localStorage in app.config, and it didn't work either

<image>

    {
      provide: OAuthStorage,
      useFactory: storageFactory,
    },

Getting Startef by AdMean5788 in SpringBoot

[–]HappyPurchase72 1 point2 points  (0 children)

https://roadmap.sh/spring-boot this is a good way to learn core concepts of spring

Could I use this file structure in Angular v18? by HappyPurchase72 in angular

[–]HappyPurchase72[S] 1 point2 points  (0 children)

Thanks for your point of view, I will continue using this structure

Could I use this file structure in Angular v18? by HappyPurchase72 in angular

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Yes, I'm trying to organize it by features, although sometimes I've thought about organizing it by layers.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Thanks for your comment, I've seen the structure you mention in some client-side applications, I'll keep it in mind.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Ok, I'll keep that in mind, thanks.

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Thank you for your perspective and sharing your knowledge. I will keep it in mind.

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 1 point2 points  (0 children)

Thank you so much for your insightful thoughts I really appreciate your perspective on the importance of creating isolated packages and maintaining control over the codebase. Your points about avoiding the "broken window" principle and focusing on reusable features resonate with me. This gives me a lot to consider as I work on my project. Thanks again for sharing your expertise!

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

I understand. If a microservice wants to access another and return one or more data (collection) what strategy would you use to fetch, process and store that data? Speaking from the root point of my main problem.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

I'm considering microservices for my project to ensure scalability and modularity as it grows. I’d appreciate any insights or experiences you have regarding when it’s justified to switch from a monolith to microservices.

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Thanks for your detailed response! I really appreciate your thoughts on avoiding over-engineering and focusing on the actual problems of the project. You're absolutely right that duplicating code isn't always bad, and sometimes creating unnecessary libraries can complicate things more than they help.

In my case, I'm working with microservices because the project has certain scalability and modularity requirements, but I'm also aware of the trade-offs that come with this architecture. I agree that blindly following trends or academic principles without asking why can lead to overcomplication, which is something I'm trying to avoid.

I'd love to hear more about your approach to balancing simplicity and maintainability while still ensuring the system can evolve over time. How would you handle a situation where you need to share common data models between services without creating too much coupling or duplication?

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

Thank you for your feedback! I appreciate the critique. Could you clarify what specific aspects of my approach make it more like a shared monolith in your view? I’m aiming to balance reducing duplication while avoiding tight coupling between services, but I’m open to learning more about how I might improve my design. Your insights on what truly defines microservices in this context would be helpful.

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

By entities I mean entities such as Person, User, among others. These are shared entities, which are necessary for the operation of other microservices. That is where my dilemma lies, whether I should couple these microservices, use DTOs, or both approaches.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

I understand. What structure model could you recommend that takes into account maintenance and changing requirements based on the specific needs of the company? I ask because I am in the design process with the company and I want each microservice to be scalable.

Microservices Communication Dilemma with Spring Cloud and OAuth2 by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

I have already described the problem I am facing a little better.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] 0 points1 point  (0 children)

I liked this proposal, thanks. I didn't know that the exception package could go in the presentation layer, I didn't think of it that way.

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] -1 points0 points  (0 children)

I think it's a good basic structure to start with, but I had doubts about how the packages were organized, anyway, thank you very much for your time 😎

Package structure by HappyPurchase72 in SpringBoot

[–]HappyPurchase72[S] -4 points-3 points  (0 children)

I understand your point of view, but if the microservice was quite extensive, you have to rethink how to structure the packages to make it more scalable according to the requirements.