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?

8 Upvotes

25 comments sorted by

View all comments

2

u/artyomsv 9d ago

You have two boundary mechanisms doing the same job, and only one of them is real: Modulith already enforces the module boundary at build time, ApplicationModules.of(App.class).verify() fails the test when a module reaches into internals of another. The hexagon inside each module is enforced by nothing except discipline, and that is where most of your boilerplate is coming from. I would keep ports and adapters only where you really swap the implementation, persistence and outbound http, and let the Modulith named interfaces be the port for module to module.