User
∨ ∧
Request \ / Response
\ /
Middleware \ / View
\ /
Controller \ / Controller
\ /
Service \ / Service
\/
Infrastructure
.
├── app
│ ├── Domain
│ │ ├── DataStructure
│ │ │ └── Value
│ │ ├── Error
│ │ ├── Port
│ │ └── Service
│ ├── Infrastructure
│ │ ├── Adapter
│ │ ├── Repository
│ │ └── Source
│ └── Presentation
│ ├── Controller
│ ├── Middleware
│ └── Template
├── config
└── public
└── test
In this folder, we will find the application itself.
Here is the domain you manage.
Entities are the representation of objects inherent to the domain.
Ex. : User, Product, etc.
Value Objects are representations of data typed according to your domain.
Ex. : E-mail, Id, Price, etc.
Errors are the representation of errors.
Ports are the interfaces to which the adapters must be supported.
Services are accessible from outside your domain (your controllers). Each action must represent an action of the domain.
Ex. : register a new user, confirm the order, etc.
Here is what is peripheral to the domain you manage, communication with your dependencies (database, client interface, client API, etc.).
Adapters are the outgoing interfaces of your application.
Ex. : database, APIs consumed, etc.
In this folder, we find all the resources and processing inherent to rendering views (html, xml, etc.)
Controllers are the inbound interfaces of your application.
Ex. : browser, API exposed, CLI, etc.
Middlewares will take care of inbound and outbound access management.
Ex. : access verification, error catching, etc.
Here are the templates used to render the views of your application.
In this folder, we will find the configuration of the application: its parameters, its routes and the call to its dependencies.
In this folder, we will find the index of the app and the front resources accessible from the client. It is also this folder which will be the root of your web server.