Skip to content

Commit 61685ec

Browse files
committed
architecture document with an overview diagram
1 parent 3dfd04f commit 61685ec

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/architecture.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# DevStream Architecture Summary
2+
3+
This document summarizes the main components of DevStream and how data and requests flow between these components.
4+
5+
## DevStream Request Flow
6+
7+
The following diagram shows an approximation of how DevStream executes a user command:
8+
9+
![DevStream Architecture Diagram](./images/architecture-overview.png)
10+
11+
## CLI (The `devstream` Package)
12+
13+
Every time a user runs the `dtm` program, the execution transfers immediately into one of the "command" implementations in the [`devstream`](https://github.com/merico-dev/stream/tree/main/cmd/devstream) package, in which folder all commands' definitions reside. Then, each command calls the corresponding package under [`internal/pkg`](https://github.com/merico-dev/stream/tree/main/internal/pkg).
14+
15+
The flow illustrated above applies to the main DevStream commands like `dtm install`, `dtm uninstall` (_TODO_), and `dtm reinstall` (_TODO_). For these commands, the role of the command is to parse all the config, load each plugin, and call the [predefined interface](https://github.com/merico-dev/stream/blob/main/internal/pkg/plugin/plugin.go#L12).
16+
17+
## Configuration Loader
18+
19+
Model types in package [`config`](https://github.com/merico-dev/stream/blob/main/internal/pkg/config/config.go) represent the top-level configuration structure.
20+
21+
## State Manager
22+
23+
_TODO_
24+
25+
## Plugin Engine
26+
27+
The plugin engine has various responsibilities:
28+
29+
- making sure the required plugins (according to the config) are present (_TODO_)
30+
- generate a plan according to the state (_TODO_)
31+
- execute the plan by loading each plugin and running the desired operation
32+
33+
_Note: there will be a rework of the engine to generate and execute a plan according to the state manager, which hasn't been implemented yet._
34+
35+
## Plugins
36+
37+
A _plugin_ implements the aforementioned predefined interfaces.
38+
39+
It executes operations like install, reinstall (_TODO_), uninstall (_TODO_), and stores state (_TODO_).

docs/images/architecture-overview.png

87.8 KB
Loading

0 commit comments

Comments
 (0)