431117087f
docs/architecture/c4-component-layers.md — the Level-3 layer dependency graph generated by `deptrac analyse --formatter=mermaidjs` (code-derived, drift-proof). Closes the A6 «C4 drift» gap at the component level. README diagram index + regenerate note updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.7 KiB
1.7 KiB
C4 — Component view: backend layers
The Level-3 (Component) view — the dependency directions between the backend
layers of app/app/ (Controller, Service, Model, Job, …). Unlike the
hand-drawn c4-context.md, this diagram is generated from
code by deptrac, so it cannot drift. See README for the boundary
rule and ADR-005.
flowchart TD;
Console -->|3| Service;
Console -->|3| Model;
Console -->|2| Job;
Controller -->|190| Model;
Controller -->|11| Request;
Controller -->|8| Service;
Controller -->|1| Mail;
Controller -->|5| Job;
Controller -->|6| Resource;
Middleware -->|1| Model;
Resource -->|1| Model;
Job -->|75| Model;
Job -->|28| Service;
Job -->|4| Mail;
Job -->|8| Exception;
Mail -->|17| Model;
Provider -->|2| Service;
Repository -->|3| Model;
Service -->|87| Model;
Service -->|1| Repository;
Service -->|13| Exception;
Service -->|7| Mail;
Service -->|5| Job;
Notes
- Edge labels are dependency counts. Every edge shown is an allowed
direction —
deptrac analysereports 0 violations (481 allowed cross-layer dependencies, 977 uncovered framework/vendor references). The layer model and ruleset live inapp/deptrac.yaml; the conformance gate is lefthook pre-commit job 10. - This is the Component level, derived from code. To regenerate after a change to the layer model:
cd app && php vendor/bin/deptrac analyse --formatter=mermaidjs
- The Context level (c4-context.md — external systems) is
not code-derived and stays hand-maintained with the
mermaidskill.