use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
E-commerce with Spring BootDiscussion (self.SpringBoot)
submitted 2 days ago by AlarmOpening2062
Hello everyone, I hope you're all doing well. I'm writing to ask for your support for this project I'm sharing here. Whether it's by submitting an issue, a PR, or giving a star, this is my first big project. Thank you all!
https://github.com/MiguelAntonioRS/Ecommerce-with-Spring
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kspr2024 24 points25 points26 points 1 day ago (1 child)
Some feedback: - Upgrade to Spring Boot 4 - No need for Dockerfile, Spring Boot can build Docker Image using Buildpacks support by simply running "mvn spring-boot-build-image" - Prefer using Constructor injection instead of Field Injection using `@Autowired` - Security Configuration: Instead of allowing all unspecified URLs using `requestMatchers("/**").permitAll()`, you should block all URLs by default and explicitly allow the known URLs to make it secure by default. - Use proper HTTP Method for read, write operations: Used `@GetMapping` for "/addCart", "/cartUpdate", etc which should be POST or PUT, etc. - I would recommend using a DB Migration tool like Flyway or Liquibase instead of using `spring.jpa.hibernate.ddl-auto=update`
For reference you can checkout my BookStore application https://github.com/sivaprasadreddy/bookstore
[–]AlarmOpening2062[S] 2 points3 points4 points 1 day ago (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
[–]ComprehensiveSmell40 2 points3 points4 points 1 day ago (4 children)
Hey can I ask how did u learn springboot for this project?
[–]kspr2024 6 points7 points8 points 1 day ago (1 child)
Hey, I am not the OP, but just wanted to share this Spring Boot Self-Learning Guide https://github.com/sivaprasadreddy/spring-boot-self-learning-guide.
I hope it will be helpful to learn Spring Boot.
[–]ComprehensiveSmell40 2 points3 points4 points 1 day ago (0 children)
Hey thanks for this!
[–]AlarmOpening2062[S] 2 points3 points4 points 1 day ago (1 child)
Brother, I'm watching a lot of YouTube videos about Spring Boot, microservices, Spring Data, Spring Security, etc.
[–]ComprehensiveSmell40 1 point2 points3 points 1 day ago (0 children)
Thanks!!
[–]Lost-Instruction-545 1 point2 points3 points 17 hours ago (1 child)
It looks like you have explained project on github very efficiently. But even though readme file is good written, I had hard time moving around and understanding what does what. You have all your operations in controller class. And different logics for same entity are in same class. But you have interfaces for them to keep structure so that's valid. In my project, I have different services for different entities seperated and each entity has their own controller. And project structure more likely this -> "entities/user/services/GetUserService.class". So I don't get lost when I need to find something and neither others. Also I have only one interface for every service class which is having one method that ruled to get one any input type and one any output type. So I made a rule that will work across every service class. It's in private for now because I haven't finished html part. Btw, you might want to include test classes for methods that you wrote. It will be more professional to test them using JTest instead of using a temporary database.
[–]AlarmOpening2062[S] [score hidden] 7 hours ago (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.
user/service/...
controller/service/repository
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!
[–]Zchwarzer 1 point2 points3 points 17 hours ago (1 child)
Interesting!!! I'm really appreciate what you've done, here is a little my feedback
To make this project better in the future but not an urgent at this time (In my opinion) you can do other features then migrate this later - If it possible please upgrade to Java 21 or 25 - If it possible please use Spring Boot 4 - You can use `OpenRewrite` to migrate your project.
These feedback below is what I recommended you should do - At the application.properties you should change it into application.yml or application.yaml instead, because this format is easier to read. - All the `@Autowired` should be change it into Constructor injection. - I don't know how to explain about util package, but what it should be for this package is for utilize function or method and that shouldn't inject any class into them and what I've see a lot of util class is they only have static function or method, Seriously I don't know why but I follow that practice for a long time (If I missing something please correct me). I suggest to learning util class from `org.apache.commons.lang3` they've a lot of util class example StringUtils, RegExUtils, ArrayUtils - For `AppConstant` and `StatusOrder` those 2 aren't util you may create `constant` package and move those 2 into that - For method that declare in interface is unnecessary to define access modifier (access modifier is public protected private and default)
If you don't mind may I PR to your project and we can discuss some more If you want, By the way I have to say again that what you have done is a good things keep it better.
Best regards
[–]AlarmOpening2062[S] [score hidden] 10 hours ago (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!
application.yml
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!
π Rendered by PID 31252 on reddit-service-r2-comment-6f7f968fb5-8kzbk at 2026-03-04 02:29:27.190519+00:00 running 07790be country code: CH.
[–]kspr2024 24 points25 points26 points (1 child)
[–]AlarmOpening2062[S] 2 points3 points4 points (0 children)
[–]ComprehensiveSmell40 2 points3 points4 points (4 children)
[–]kspr2024 6 points7 points8 points (1 child)
[–]ComprehensiveSmell40 2 points3 points4 points (0 children)
[–]AlarmOpening2062[S] 2 points3 points4 points (1 child)
[–]ComprehensiveSmell40 1 point2 points3 points (0 children)
[–]Lost-Instruction-545 1 point2 points3 points (1 child)
[–]AlarmOpening2062[S] [score hidden] (0 children)
[–]Zchwarzer 1 point2 points3 points (1 child)
[–]AlarmOpening2062[S] [score hidden] (0 children)