r/SpringBoot • • Sep 01 '26

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?

8 Upvotes

25 comments sorted by

View all comments

Show parent comment

1

u/nullptr_lol Sep 01 '26

I think is fine as it is now. Api -> Application -> Domain -> Infrastructure is the standard folder structure. Sure, rest is the inbound adapter but, it's more confusing.

1

u/Resident-Cow-7626 Sep 01 '26

OP wanted feedback on hexagonal architecture and this kind of design flaw will get bigger, and more of a problem, as the application grows - imagine listeners, web sockets, maybe even a CLI as an entry point to the application… it will be much more difficult to understand where these inbound adapters are. More importantly, separating the domain from these technologies is the core principle of HA.

Getting the foundations right from the start is exactly what I think OP is asking for. If this is a small application with not much of a domain, then hexagonal architecture is the wrong tool to reach for. A traditional, layered architecture would be more suited, but again, OP wanted feedback on this particular architecture.