35 lines
1.4 KiB
Markdown
35 lines
1.4 KiB
Markdown
# Clean Architecture layer contract
|
|
|
|
The import direction is `domain <- application <- presentation`; concrete
|
|
adapters implement application-owned ports and are assembled only in
|
|
`src/bootstrap`.
|
|
|
|
| Layer | Owns | May depend on |
|
|
| --- | --- | --- |
|
|
| `domain` | framework-neutral models and pure policies | domain siblings |
|
|
| `application` | use cases, ports, orchestration, view-models | domain and application siblings |
|
|
| `presentation` | routes, components, user interaction and view state | application public API and shared UI |
|
|
| `adapters` | browser and third-party implementations of application ports | application ports and limited domain values |
|
|
| `bootstrap` | runtime configuration, adapter construction and React mount | all selected runtime modules |
|
|
|
|
The following edges are forbidden:
|
|
|
|
- domain to application, presentation, adapters, bootstrap, React, or browser globals
|
|
- application to presentation, concrete adapters, bootstrap, React, or browser globals
|
|
- presentation to concrete adapters, raw DTO schemas, or storage implementations
|
|
- an adapter to presentation, bootstrap internals, or another concrete adapter
|
|
|
|
`bootstrap` contains composition only. Business rules and page-specific
|
|
orchestration belong to domain/application.
|
|
|
|
Architecture reports use this shape:
|
|
|
|
```json
|
|
{
|
|
"schemaVersion": 1,
|
|
"generatedAt": "ISO-8601",
|
|
"rules": [{ "name": "rule-id", "severity": "error", "violations": 0 }],
|
|
"summary": { "errors": 0, "warnings": 0 }
|
|
}
|
|
```
|