Primary/Driving = Presentation Layer [ui,api,cli]
Secondary/Driven = Infrastructure Layer [Data access, email, message queue]
ports (interfaces) | adapters (implementations)


├── app/
│ ├── ports/ # Interfaces for interacting with the core logic
│ ├── adapters/ # Implementations of ports (e.g., database, API adapters)
│ ├── domain/ # Core business logic (data models / classes)
│ ├── src/ # Additional core functionality
https://herbertograca.com/2017/09/21/onion-architecture/
├── src/
│ ├── application/services # Interfaces for interacting with the core logic
│ ├── domain/models # Core business logic (data models / classes)
│ ├── infra/database # Implementations of ports (e.g., database, API adapters)
│ ├── presentation/api # API and UI





Application layer = orchestration, use-cases, workflows.
Infrastructure layer = concrete adapters (DB drivers, API SDKs, HTTP clients, etc.).
persistence = repo implementations