Skip to content

Commit d888c8d

Browse files
committed
much better architecture diagram
thanks @S-poony !!!
1 parent b9bd212 commit d888c8d

File tree

5 files changed

+112
-26
lines changed

5 files changed

+112
-26
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ select
132132

133133
## How it works
134134

135-
![architecture diagram](./docs/architecture.jpg)
135+
![architecture diagram](./docs/sqlpage%20logic.drawio.svg)
136136

137137
SQLPage is a [web server](https://en.wikipedia.org/wiki/Web_server) written in
138138
[rust](https://en.wikipedia.org/wiki/Rust_(programming_language))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
digraph {
2+
rankdir=LR;
3+
node [shape=rectangle, style=rounded, fontname=helvetica];
4+
edge [arrowhead=normal, arrowtail=crow, dir=both];
5+
6+
subgraph cluster_browser {
7+
label = "Web Browser";
8+
style = filled;
9+
color = lightgrey;
10+
node [style=filled, color=white];
11+
browser [label = "<f0>Web Browser|<f1>"];
12+
}
13+
14+
subgraph cluster_sqlpage {
15+
label = "SQLPage";
16+
style = filled;
17+
color = lightblue;
18+
node [style=filled, color=white];
19+
read_file [label = "<f0>Read File|<f1>todos.sql"];
20+
replace_param [label = "<f0>Replace Parameter|<f1>$todo_id with 1"];
21+
format_results [label = "<f0>Format Results|<f1>as HTML"];
22+
}
23+
24+
subgraph cluster_database {
25+
label = "Database";
26+
style = filled;
27+
color = palegreen;
28+
node [style=filled, color=white];
29+
execute_query [label = "<f0>Execute|<f1>Query"];
30+
return_results [label = "<f0>Return|<f1>Results"];
31+
}
32+
33+
browser:f1 -> http_request [label = " HTTP GET Request\n/todos.sql?todo_id=1", lhead=cluster_browser];
34+
http_request -> read_file:f0 [lhead=cluster_sqlpage];
35+
read_file:f1 -> replace_param:f0;
36+
replace_param:f1 -> sql_query [label = " SQL Query\nSELECT * FROM todos\nWHERE id = 1", lhead=cluster_sqlpage];
37+
sql_query -> execute_query:f0 [lhead=cluster_database];
38+
execute_query:f1 -> return_results:f0;
39+
return_results:f1 -> result_stream [label = " Result Stream", lhead=cluster_database];
40+
result_stream -> format_results:f0 [lhead=cluster_sqlpage];
41+
format_results:f1 -> html_response [label = " HTML Response\nwith Formatted Results", ltail=cluster_sqlpage];
42+
html_response -> browser:f0 [label = " Display Results", lhead=cluster_browser];
43+
44+
// Additional Styles
45+
edge [arrowhead=normal, arrowtail=none, dir=both, fontname=helvetica, fontsize=10];
46+
node [fontsize=12];
47+
}

0 commit comments

Comments
 (0)