We usually describe architecture as what a system knows: its layers, its services, its data. I have come to think the opposite is more useful. Architecture is what each part is allowed to forget.
A module is healthy when it can be understood without opening any other file.
A payment service should not know how the invoice is rendered. The renderer should not know which bank processed it. Every boundary is a promise: you will not need to think about that.
Signs that a boundary is leaking
- Changing one feature touches five folders
- Tests need the whole world to start
- Names from one domain appear in another
The goal is not fewer parts. It is fewer things to hold in your head at once.