docs: rename Clean Architecture → Hexagonal Architecture (ports & adapters)
Le backend suit le pattern ports & adapters (ports dans domain/ports.py, adaptateurs dans infra/), pas Clean Architecture au sens Uncle Bob. Aligne la terminologie dans README, docs/architecture.md, ADR guide, audit master, fiche audit 01, et la nav mkdocs. Les noms de fichiers et la commande /audit:clean-architecture restent stables pour preserver les liens croises et les skills existants.
This commit is contained in:
parent
df786a4ab4
commit
7171488b8b
6 changed files with 10 additions and 10 deletions
|
|
@ -59,7 +59,7 @@ Upload a PDF, configure the extraction pipeline, and visualize the results — t
|
|||
| **frontend** | Vue 3, TypeScript, Vite, Pinia | UI, PDF viewer, results display |
|
||||
| **document-parser** | FastAPI, Docling, SQLite, pdf2image | REST API, document parsing, storage |
|
||||
|
||||
### Backend structure (clean architecture)
|
||||
### Backend structure (hexagonal architecture — ports & adapters)
|
||||
|
||||
```
|
||||
document-parser/
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Two services communicating via REST. The frontend is a Vue 3 SPA served by Nginx
|
|||
|
||||
### Zooming into the backend
|
||||
|
||||
The schema above shows the macro view. Inside the backend, the code follows a **Clean Architecture** with strict layer boundaries:
|
||||
The schema above shows the macro view. Inside the backend, the code follows a **Hexagonal Architecture** (ports & adapters) with strict layer boundaries:
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────┐
|
||||
|
|
@ -34,9 +34,9 @@ The schema above shows the macro view. Inside the backend, the code follows a **
|
|||
|
||||
Dependencies flow **inward**: `api → services → domain`. The domain layer has zero knowledge of HTTP or database.
|
||||
|
||||
## Backend — Clean Architecture
|
||||
## Backend — Hexagonal Architecture (ports & adapters)
|
||||
|
||||
The backend follows a strict layered architecture. Dependencies flow inward: API → Services → Domain. The domain layer has zero knowledge of HTTP or database.
|
||||
The backend follows the hexagonal / ports-and-adapters pattern. The domain layer defines **ports** (abstract protocols in `domain/ports.py`); `infra/` provides **adapters** that implement them. Dependencies flow inward: API → Services → Domain. The domain layer has zero knowledge of HTTP, database, or any framework.
|
||||
|
||||
```
|
||||
document-parser/
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ These decisions were made before the ADR process was introduced. They are docume
|
|||
|
||||
| Decision | Rationale | Date |
|
||||
|----------|-----------|------|
|
||||
| Clean Architecture (hexagonal) for backend | Decouple domain from framework — enable converter swapping (local/remote) | 2025-01 |
|
||||
| Hexagonal Architecture (ports & adapters) for backend | Decouple domain from framework — enable converter swapping (local/remote) via ports | 2025-01 |
|
||||
| FastAPI over Django | Async-first, lightweight, Pydantic-native — better fit for a single-purpose API | 2025-01 |
|
||||
| Vue 3 + Pinia over React | Composition API + built-in reactivity — smaller bundle for this use case | 2025-01 |
|
||||
| SQLite over PostgreSQL | Single-file DB, zero ops — appropriate for a document processing tool | 2025-01 |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Audit 01 — Clean Architecture
|
||||
# Audit 01 — Hexagonal Architecture (ports & adapters)
|
||||
|
||||
**Objectif** : verifier que le backend respecte le flux de dependances strict `api -> services -> domain` et que chaque couche a une responsabilite claire.
|
||||
**Objectif** : verifier que le backend respecte le pattern hexagonal (ports dans `domain/ports.py`, adaptateurs dans `infra/`), le flux de dependances strict `api -> services -> domain`, et que chaque couche a une responsabilite claire.
|
||||
|
||||
**Cible** : `document-parser/` (hors `.venv/`, `__pycache__/`, `tests/`)
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ Les audits sont executes dans l'ordre ci-dessous. Chacun est une fiche autonome
|
|||
|
||||
| # | Audit | Fichier | Focus |
|
||||
|---|-------|---------|-------|
|
||||
| 01 | Clean Architecture | [01-clean-architecture.md](audits/01-clean-architecture.md) | Respect des couches, flux de dependances |
|
||||
| 01 | Hexagonal Architecture | [01-clean-architecture.md](audits/01-clean-architecture.md) | Ports & adapters, respect des couches, flux de dependances |
|
||||
| 02 | DDD | [02-ddd.md](audits/02-ddd.md) | Bounded contexts, entites, value objects, ubiquitous language |
|
||||
| 03 | Clean Code | [03-clean-code.md](audits/03-clean-code.md) | Nommage, taille, lisibilite |
|
||||
| 04 | KISS | [04-kiss.md](audits/04-kiss.md) | Simplicite, pas de sur-ingenierie |
|
||||
|
|
@ -161,7 +161,7 @@ Le fichier `reports/release-X.Y.Z/summary.md` consolide tous les audits :
|
|||
|
||||
| # | Audit | Score | CRIT | MAJ | MIN | INFO | Verdict |
|
||||
|---|-------|-------|------|-----|-----|------|---------|
|
||||
| 01 | Clean Architecture | XX | N | N | N | N | GO |
|
||||
| 01 | Hexagonal Architecture | XX | N | N | N | N | GO |
|
||||
| 02 | DDD | XX | N | N | N | N | GO |
|
||||
| ... | ... | ... | ... | ... | ... | ... | ... |
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ nav:
|
|||
- Audit:
|
||||
- Audit Master: audit/master.md
|
||||
- Audits:
|
||||
- Clean Architecture: audit/audits/01-clean-architecture.md
|
||||
- Hexagonal Architecture: audit/audits/01-clean-architecture.md
|
||||
- DDD: audit/audits/02-ddd.md
|
||||
- Clean Code: audit/audits/03-clean-code.md
|
||||
- KISS: audit/audits/04-kiss.md
|
||||
|
|
|
|||
Loading…
Reference in a new issue