Clean Architecture Pattern
The hard topic for those days. I was studing, reading documentation and the book of Robert C. Matin, Uncle bob. But is the hard thing to understand.
So will try to show how I will use this pattern like a concept in this example a e-commerce.
First we need to see this picture.
The color and labels explained in the way of the example.
Entitie (yellow) = models and bussines rules. Dont move the core of the e-commer. Maybe a User entity, or Product.
User Cases (red) = CRUD, commands and querys to entities interaction for out side with the entities. Create product, Create user, Select all productos by categorie.
Controller (green) = Apdapter or middleware to conver any request from out side on structures that your uses cases understarnd. Request with a key productID and your use cases understand idProduct you can change it here.
UI (Blue) = Front, web, app, presentation layer. Recive and send information to ther controller (adapter layer).
Some videos to understand a litte bit better this patter.
I like this way to implemente and apply this topic.
More that Hexagonal patter and DDD.
Try to enjoy it.