nest-clean-architecture
nest-clean-architecture copied to clipboard
Do `ports` really belong to infrastructure or just their `adapters`?
First, π @VincentJouanne this clean architecture template is awesome (and I've checked a few).
Small suggestion, in your example, ports belong to the infrastructure directory:
Whereas I think those interfaces should belong to the domain.
Quoted from this article: https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/
Itβs important to note that the Ports (Interfaces) belong inside the business logic, while the adapters belong outside. For this pattern to work as it should, it is of utmost importance that the Ports are created to fit the Application Core needs and not simply mimic the tools APIs.