nw-fp-hexagonal-architecture
FeaturedHexagonal architecture patterns with pure core and side-effect shell for functional codebases
AI & Automation 636 stars
68 forks Updated today MIT
Install
Quality Score: 98/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# FP Hexagonal Architecture
Ports and adapters in functional programming. Structure applications with a pure core and side-effect shell.
Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [fp-usable-design](../nw-fp-usable-design/SKILL.md)
---
## 1. The Natural Fit
[STARTER]
Functional architecture naturally implements ports and adapters. The paradigm's separation of pure functions from side effects IS the hexagonal boundary.
| OOP Concept | FP Equivalent | Why |
|---|---|---|
| Port (interface) | Function type signature / type alias | Port defines contract; function signature IS that contract |
| Adapter (class) | Concrete function implementation | Adapter fulfills contract; matching function does same |
| DI container | Function parameters / partial application | Dependencies passed as arguments, no container needed |
| Domain service class | Module of pure functions | Related pure functions replace stateful service object |
| Entity with behavior | Immutable data + functions operating on it | Data and behavior separated; functions transform immutable values |
---
## 2. Pure Core / Side-Effect Shell
[STARTER]
All business logic is pure; all side effects live at the system's edges.
**The Sandwich Pattern**: Read (impure) -> Decide (pure) -> Write (impure)
```
+--------------------------------------------------+
| Side-Effect Shell (thin) |
| - HTTP handlers, CLI, me...
Details
- Author
- nWave-ai
- Repository
- nWave-ai/nWave
- Created
- 9 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Code & Development Listed
hexagonal-architecture
Ports + adapters. Domain owns interfaces, adapters at the edge, function-parameter injection only, no DI / CQRS / mediator. Use when placing code or crossing module boundaries.
0 Updated 5 days ago
voidcorp-core DevOps & Infrastructure Featured
nw-fp-principles
Core functional programming thinking patterns and type system foundations, language-agnostic
636 Updated today
nWave-ai Code & Development Listed
hexagonal-architecture
Hexagonal architecture (ports and adapters) — dependencies point inward; the domain declares ports, adapters implement them, no framework or database inside. Use when designing service structure or judging seams.
4 Updated yesterday
ralvarez-ai