Hi ONeil!
Thanks a lot for the feedback, I really appreciate it.
Regarding hexagonal architecture: I have a very positive opinion of it. Conceptually, it’s a strong approach that enforces clear boundaries and keeps business logic independent from infrastructure concerns like the database or ORM. What you describe with repository traits, multiple implementations, and use-cases is very much aligned with that philosophy, and it’s something I find very clean and elegant.
In this article, the choice was intentional to keep things simpler. The goal was to provide a first solid mental model for structuring an Actix Web project, especially for people who are new to Rust backend or coming from frameworks that impose conventions by default. Introducing hexagonal architecture from the start can be overwhelming, so I focused on a pragmatic, feature-based structure as a foundation.
That said, I really like your proposal. Abstracting the database behind traits and organizing logic around use-cases is a natural and very appealing next step. This article is meant as a first iteration, not a final destination, and your feedback fits perfectly with how I plan to evolve it.
I’m planning to implement this kind of abstraction in a follow-up, show how to transition toward a more hexagonal approach, and share the results. Thanks again for the thoughtful comment — it’s exactly the kind of discussion I was hoping this article would spark.