Skip to content

Commit 919b8a7

Browse files
committed
Update diagram
1 parent 4e00928 commit 919b8a7

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
Dew streamlines Go application development by providing a unified interface for handling operations and domain logic. It offers a lightweight command bus with an integrated middleware system, simplifying complex workflows and promoting clean, maintainable code architecture.
1010

11-
<img src="assets/overview.webp" alt="dew overview" />
12-
1311
<h2>Table of Contents</h2>
1412

1513
- [Features](#features)
14+
- [Concept Diagram](#concept-diagram)
1615
- [Motivation](#motivation)
1716
- [Terminology](#terminology)
1817
- [Convention for Actions and Queries](#convention-for-actions-and-queries)
@@ -39,6 +38,41 @@ Dew streamlines Go application development by providing a unified interface for
3938
- **Zero Dependencies**: No external dependencies.
4039
- **Fast**: See [benchmarks](#benchmarks).
4140

41+
## Concept Diagram
42+
43+
The following diagram illustrates the core concepts and flow of Dew:
44+
45+
```mermaid
46+
graph LR
47+
Client[Client Code]
48+
Bus[Dew Bus]
49+
Middleware{Middleware}
50+
ActionHandler[Action Handler]
51+
QueryHandler[Query Handler]
52+
53+
subgraph Dew["Dew Command Bus"]
54+
Bus
55+
Middleware
56+
end
57+
58+
Client -->|1. Dispatch Action| Bus
59+
Client -->|2. Execute Query| Bus
60+
Bus -->|3. Apply| Middleware
61+
Middleware -->|4a. Route Action| ActionHandler
62+
Middleware -->|4b. Route Query| QueryHandler
63+
ActionHandler -->|5a. Handle & Modify State| DB[(Database)]
64+
QueryHandler -->|5b. Fetch Data| DB
65+
ActionHandler & QueryHandler -->|6. Return Result| Client
66+
67+
style Dew fill:#e6f3ff,stroke:#333,stroke-width:2px,color:#000
68+
style Bus fill:#b3e0ff,stroke:#333,stroke-width:2px,color:#000
69+
style Middleware fill:#ffd966,stroke:#333,stroke-width:2px,color:#000
70+
style ActionHandler fill:#d5e8d4,stroke:#333,stroke-width:2px,color:#000
71+
style QueryHandler fill:#d5e8d4,stroke:#333,stroke-width:2px,color:#000
72+
style Client fill:#dae8fc,stroke:#333,stroke-width:2px,color:#000
73+
style DB fill:#f8cecc,stroke:#333,stroke-width:2px,color:#000
74+
```
75+
4276
## Motivation
4377

4478
Working on multiple complex backend applications in Go over the years, I've been seeking ways to enhance code readability, maintainability, and developer enjoyment. The Command Bus architecture emerged as a promising solution to these challenges. However, unable to find a library that met all my requirements, I created Dew.

0 commit comments

Comments
 (0)