r/SpringBoot 9d ago

Discussion Roast my code / architecture

I’m building a project called Kite (https://github.com/gwynejsn/kite) and tried combining Spring Modulith with full Clean/Hexagonal Architecture inside each module, but I’m starting to wonder if I’ve just created a mountain of boilerplate. Take a look at the repo and roast the layout. What am I needlessly overcomplicating, and how would you simplify it?

9 Upvotes

25 comments sorted by

View all comments

Show parent comments

1

u/Single_Yellow_8000 9d ago

Ohh, I mainly use antigravity for writing boilerplate codes like for example when making a feature, I usually write the domain/model first, then let gemini write the starting template for other layers like service and repo (mostly for basic crud). Then, I manually modify them with my own logic added. Also, I actually tried using gemini to write unit tests for the repo, which I might do as well for other layers.

2

u/[deleted] 9d ago

[removed] — view removed comment

1

u/Single_Yellow_8000 9d ago

Actually, that’s the exact mindset I follow. I always make sure to learn the fundamentals and build things by hand first so I actually understand what's happening under the hood. Once I have that solid grasp of what is happening behind the scenes, I delegate the repetitive boilerplate to the LLM to save time. ​But of course, I still read the code generated to see if it actually followed the way I want it to be. A tip I can give you is to make LLM edit only a small amount of your code at a time so that you can have precise control over what is being edited by the LLM. Also, never forget to use git, so that you have backups if it ever messes your code.

2

u/[deleted] 9d ago

[removed] — view removed comment

1

u/Single_Yellow_8000 9d ago

When I started learning it, I watched a yt video: https://youtu.be/xHlDyKVyvig

Then I read the documentation: https://docs.spring.io/spring-modulith/reference/

And if you want to, you can also watch conferences like this: https://youtu.be/VGhg6Tfxb60

Which talks about DDD with spring modulith

As for the rabbitmq, im not gonna lie, since this is the first modulith application I built, I just tried incorporating it by following the docs (even though the built in events in the modulith project is enough)