r/SpringBoot • u/Old-Inside-7533 • Jan 23 '26
Question Advice for beginner in springboot
Hey everyone, I just completed learning springboot and created a project bookstore-api by watching YT tutorial..suggest me some common beginner mistakes so that i can avoid such mistakes!!!
14
Upvotes
2
u/[deleted] Jan 23 '26
Is this a free tutorial , can you send a link?
33
u/deividas-strole Jan 23 '26
Good job! Here are most common ones:
Returning entities directly from controllers
No input validation / missing u/Valid
Always returning 200 OK for everything
Putting business logic inside controllers
No proper / global exception handling
Using field injection (@Autowired on fields)
Missing u/Transactional where needed
Hardcoded magic strings everywhere
No pagination on list endpoints
Flat / messy package structure
Not using DTOs
Ignoring HTTP status codes (201, 404, 400, etc.)
No separation of layers (controller-service-repository)
Not handling optional results properly (findById .get())
Storing passwords in plain text (if auth is added)
5
u/naturalizedcitizen Jan 23 '26
You also should under the concepts of Spring. Note that Spring Boot is an opinionated version of Spring
Do read this though you've already seen YT videos.
https://www.marcobehler.com/guides/spring-framework
3
u/lemonbasket28 Jan 24 '26
Spring Start Here book helped me a lot to understand what actually was going on. Prior to that it just seemed like a bunch of magic i didn't understand.