damienbeaufils / nestjs-clean-architecture-demo

An example of clean architecture implementation with NestJS
190 stars 27 forks source link

The example provided in this repository does not correspond to a clean hexagonal architecture. #26

Open vtochenyy opened 5 months ago

vtochenyy commented 5 months ago

The example provided in this repository does not correspond to a clean hexagonal architecture for several reasons:

  1. You designed the folder structure absolutely incorrectly from the point of view of hexagonal architecture, which makes it impossible to navigate in the repository itself.
  2. You are using DI incorrectly in the context of this architecture. You use DI through the types of the classes themselves that you describe.
  3. For some reason, you introduced ProxyServicesDynamicModule, instances of which you describe in this module and then inject into others. This is completely complete nonsense...
  4. Where is the adapter layer???
  5. You placed the web adapter (or controller) in the infrastructure folder, although by pure hexagonal architecture the infrastructure folder only contains configs for your application.

I don't want to offend you, and if I offended you, I apologize. But when you write that you have a pure hexagonal architecture, this really should be the case.

vtochenyy commented 5 months ago

I recommend you to read the article - https://blog.octo.com/hexagonal-architecture-three-principles-and-an-implementation-example.