
Clean Architecture in Kotlin: No Exceptions, No Magic, No Compromise
How 5 Gradle modules, Arrow-kt Either, and explicit DI keep your Spring Boot codebase actually maintainable. Your Spring Boot app is more coupled than you think Six months into most Spring Boot projects, something quietly breaks down. Your @Service starts importing JPA annotations. Your domain objects grow HTTP-specific fields. Writing a unit test requires spinning up an entire Spring context. Nothing crashed. No one made a bad decision. The coupling crept in annotation by annotation. Clean Architecture solves this with one rule: inner layers know nothing about outer layers. Your business logic never imports Spring. Your domain never touches PostgreSQL. These aren't conventions — in this implementation, they're enforced at compile time. In this article, I'll walk through a working Kotlin implementation using Arrow-kt Either , @JvmInline value classes, R2DBC with coroutines, and explicit dependency injection. All the patterns that made my production codebase actually maintainable. The p
Continue reading on Dev.to
Opens in a new tab


