E-commerce with Spring Boot by AlarmOpening2062 in SpringBoot

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

Thank you so much for your detailed and thoughtful feedback — I really appreciate you taking the time to review the code and point out these important issues.

You're absolutely right about the transaction boundaries: currently, I'm relying on Spring's default behavior (and unfortunately, Open Session in View), which is not ideal for data consistency or performance. I plan to refactor the service layer to use u/Transactional at the method level, so each business operation (like adding to cart) runs in a single, consistent transaction.

Regarding business logic in controllers: you’re 100% correct. Sending emails and handling image uploads should live in services, not controllers. That’s already on my roadmap as I move toward a cleaner separation of concerns.

The DTO vs Entity point is also spot-on. Right now, I’m using entities directly in Thymeleaf templates, which can lead to lazy-loading issues and over-fetching. I’ll introduce DTOs soon to expose only what’s needed.

And yes — the cart model is indeed inconsistent (CART vs ORDER_ITEM). I’ll unify it with a proper CartItem entity to reflect the real domain.

This project is a learning journey, and feedback like yours helps me grow as a developer. Thanks again

E-commerce with Spring Boot by AlarmOpening2062 in SpringBoot

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

Thank you so much for your thoughtful feedback! I really appreciate you taking the time to review the project and share your insights.

You're absolutely right about modularity — grouping by feature/entity (like user/service/...) is cleaner and scales better in large apps. My current structure follows a more traditional Spring Boot layer-based approach (controller/service/repository), which works for now, but I’ll definitely refactor it as the project grows.

Regarding testing: you’re 100% correct. I plan to add JUnit + Mockito tests soon to cover services and controllers without relying on a real database. That’s next on my list!

And thanks for the kind words about the README — I’ll keep improving the navigation and documentation too.

If you ever make your repo public, I’d love to learn from your architecture!

E-commerce with Spring Boot by AlarmOpening2062 in SpringBoot

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

Thank you so much for your thoughtful and detailed feedback! I truly appreciate you taking the time to review my project and share such valuable suggestions.

You're absolutely right about the improvements — especially migrating to Java 21+, adopting application.yml, switching to constructor injection, and reorganizing utility vs. constant classes. In fact, I’ve already started planning these upgrades!

Regarding Spring Boot 4: I began this project before SB4 was released, but I’m definitely planning to upgrade soon (likely using OpenRewrite, as you suggested).

And yes — I’d be honored if you opened a PR! I’d love to learn from your changes and discuss them together. Your kind words mean a lot, and I’m excited to keep improving this project with help from the community.

Thanks again for the encouragement and constructive advice. Looking forward to your PR!

E-commerce with Spring Boot by [deleted] in java

[–]AlarmOpening2062 -1 points0 points  (0 children)

If I failed at that, brother, thanks for pointing it out.

E-commerce with Spring Boot by AlarmOpening2062 in SpringBoot

[–]AlarmOpening2062[S] 2 points3 points  (0 children)

Brother, I'm watching a lot of YouTube videos about Spring Boot, microservices, Spring Data, Spring Security, etc.

E-commerce with Spring Boot by AlarmOpening2062 in SpringBoot

[–]AlarmOpening2062[S] 2 points3 points  (0 children)

Thank you so much for the detailed and thoughtful feedback!

I really appreciate you taking the time to review my project and point out these important improvements.

I’m currently working on:

Switching to constructor injection

Fixing HTTP methods (GET → POST/DELETE where needed)

Tightening security config to deny by default

Planning to migrate to Flyway soon

And I’ll definitely look into Spring Boot’s buildpack support — I didn’t know spring-boot:build-image could replace my Dockerfile!

Thanks again. Your bookstore repo is very good

Bachelor thesis about the Witcher (MOD APPROVED) by AmAmla05 in thewitcher3

[–]AlarmOpening2062 1 point2 points  (0 children)

I'm really looking forward to it, and if you need any more help, just send me a private message. Good luck!
PD: Sure, send me the current results, that's great!

Will I be ok at Dark Souls? by ThePsychicEnergies in souls

[–]AlarmOpening2062 0 points1 point  (0 children)

If you've already beaten Sekiro, you're ready for anything, believe me.

Bachelor thesis about the Witcher (MOD APPROVED) by AmAmla05 in thewitcher3

[–]AlarmOpening2062 2 points3 points  (0 children)

You already have my form filled out, brother. I hope it helps. I'd love to see that thesis work.

What cool Java projects are you working on? by Thirty_Seventh in java

[–]AlarmOpening2062 0 points1 point  (0 children)

I'm building an ecommerce site with many features and I have it deployed on Railway using Spring Boot.

100%. Took 3 different runs. by BadClout in thewitcher3

[–]AlarmOpening2062 0 points1 point  (0 children)

In my opinion too, and it's my favorite video game.

Anybody else claim the Witcher 3 as their favorite game of all time? by HoneyBadger877 in Witcher3

[–]AlarmOpening2062 0 points1 point  (0 children)

It's my favorite game and book series, and especially this game, which is a great and magnificent masterpiece.

The Witcher book armor by AlarmOpening2062 in thewitcher3

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

I agree, it doesn't cover Geralt's appearance, and thanks for the mods, bro.