Archived
3
0

sketch the news module architecture (#2)

* make rough news module structure prototype

* update generic structure

* remove auth from news module structure
This commit is contained in:
2025-03-12 22:42:06 +01:00
committed by GitHub
parent c342cfd877
commit 975ebedace
6 changed files with 58 additions and 8 deletions

View File

@@ -35,3 +35,7 @@
### Další poznámky
- Uživatel neexistuje (je nejspíš jen jeden globální v obou modulech)
- Zprávy drží portfolio a nakupují/prodávají
## Struktura modulu zprávy
![diagram struktury modulu zprávy](./docs/exports/news_module.svg)

View File

@@ -1,9 +1,11 @@
.PHONY: build
build: dst .WAIT \
dst/system_arch.svg
dst/system_arch.svg \
dst/news_module.svg
export: exports .WAIT \
exports/system_arch.svg
exports/system_arch.svg \
exports/news_module.svg
dst:
mkdir dst

View File

@@ -0,0 +1 @@
<svg height="332pt" viewBox="0 0 513 332" width="513pt" xmlns="http://www.w3.org/2000/svg"><g transform="translate(4 328)"><path d="m-4 4v-332h513v332z" fill="#fff"/><ellipse cx="212.62" cy="-306" fill="none" rx="29.61" ry="18" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="212.62" y="-300.57">User</text><ellipse cx="165.62" cy="-234" fill="none" rx="65.53" ry="18" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="165.62" y="-228.57">Stock module</text><g stroke="#000"><path d="m201.72-288.76c-5.41 8.06-12.1 18.02-18.24 27.16" fill="none"/><path d="m186.45-259.73-8.48 6.35 2.66-10.25z"/><path d="m375.62-180h-150l-4 4v32h150l4-4z" fill="none"/><path d="m371.62-176h-150" fill="none"/><path d="m371.62-176v32" fill="none"/><path d="m371.62-176 4-4" fill="none"/></g><text font-family="arial" font-size="14" text-anchor="middle" x="298.62" y="-156.57">HTTP server (inferium)</text><path d="m222.49-288.71c14.6 24.11 42.14 69.58 59.79 98.72" fill="none" stroke="#000"/><path d="m285.1-192.09 2.19 10.37-8.18-6.74z" stroke="#000"/><path d="m204-180h-150.75l-4 4v32h150.75l4-4z" fill="none" stroke="#000"/><path d="m200-176h-150.75" fill="none" stroke="#000"/><path d="m200-176v32" fill="none" stroke="#000"/><path d="m200-176 4-4" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="126.62" y="-156.57">REST server (inferium)</text><path d="m156.18-216.05c-4.34 7.79-9.6 17.23-14.47 25.97" fill="none" stroke="#000"/><path d="m144.91-188.63-7.92 7.03 1.81-10.44z" stroke="#000"/><path d="m251.75-108h-78.25v36h78.25z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="212.62" y="-84.58">Logic core</text><path d="m277.37-143.7c-10.44 8.5-23.2 18.89-34.63 28.19" fill="none" stroke="#000" stroke-dasharray="5 2"/><path d="m245.08-112.9-9.97 3.6 5.55-9.03z" stroke="#000"/><path d="m147.88-143.7c10.44 8.5 23.2 18.89 34.63 28.19" fill="none" stroke="#000" stroke-dasharray="5 2"/><path d="m184.59-118.33 5.55 9.03-9.97-3.6z" stroke="#000"/><path d="m111.25-36h-111.25v36h111.25z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="55.62" y="-12.57">Database (sled)</text><path d="m173.41-71.52c-20.68 9.23-46.27 20.63-68.3 30.46" fill="none" stroke="#000" stroke-dasharray="5 2"/><path d="m106.55-37.87-10.56.87 7.71-7.27z" stroke="#000"/><ellipse cx="212.62" cy="-18" fill="none" rx="83.5" ry="18" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="212.62" y="-12.57">External news API</text><path d="m212.62-71.7v24.16" fill="none" stroke="#000"/><path d="m216.13-47.62-3.5 10-3.5-10z" stroke="#000"/><path d="m505-36h-190.75v36h190.75z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="409.62" y="-12.57">Sentiment analyzer (VADER)</text><path d="m252.02-75c28.04 9.96 66.23 23.53 97.99 34.82" fill="none" stroke="#000" stroke-dasharray="5 2"/><path d="m350.84-43.6 8.25 6.64-10.6-.05z" stroke="#000"/></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1 +1 @@
<svg height="188pt" viewBox="0 0 141.07 188" width="141pt" xmlns="http://www.w3.org/2000/svg"><g transform="translate(4 184)"><path d="m-4 4v-188h141.07v188z" fill="#fff"/><g fill="none"><path d="m113.16-108h-89.25l-4 4v32h89.25l4-4z" stroke="#000"/><path d="m109.16-104h-89.25" stroke="#000"/><path d="m109.16-104v32" stroke="#000"/><path d="m109.16-104 4-4" stroke="#000"/></g><text font-family="arial" font-size="14" text-anchor="middle" x="66.53" y="-84.58">REST server</text><ellipse cx="66.53" cy="-18" fill="none" rx="66.53" ry="18" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="66.53" y="-12.57">API na zprávy</text><path d="m66.53-71.7v24.16" fill="none" stroke="#000"/><path d="m70.03-47.62-3.5 10-3.5-10z" stroke="#000"/><path d="m110.16-180h-87.25v36h87.25z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="66.53" y="-156.57">REST klient</text><path d="m66.53-143.7v24.16" fill="none" stroke="#000"/><path d="m70.03-119.62-3.5 10-3.5-10z" stroke="#000"/></g></svg>
<svg height="400pt" viewBox="0 0 238.41 400" width="238pt" xmlns="http://www.w3.org/2000/svg"><g transform="translate(4 396)"><path d="m-4 4v-400h238.41v400z" fill="#fff"/><path d="m113.16-200v-184h109.25v184z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-366.7">Modul zprávy</text><path d="m113.16-8v-184h109.25v184z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-174.7">Modul burza</text><path d="m211.41-244h-87.25v36h87.25z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-220.57">REST klient</text><path d="m214.41-106h-89.25l-4 4v32h89.25l4-4z" fill="none" stroke="#000"/><path d="m210.41-102h-89.25" fill="none" stroke="#000"/><path d="m210.41-102v32" fill="none" stroke="#000"/><path d="m210.41-102 4-4" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-82.58">REST server</text><g stroke="#000"><path d="m123.95-210.52c-9.99 5.74-19.27 13.42-24.79 23.52-13.42 24.58-13.42 38.42 0 63 3.14 5.75 7.57 10.61 12.68 14.72" fill="none"/><path d="m113.43-112.43 6.3 8.52-10.23-2.73z"/><path d="m214.41-298h-89.25l-4 4v32h89.25l4-4z" fill="none"/><path d="m210.41-294h-89.25" fill="none"/><path d="m210.41-294v32" fill="none"/><path d="m210.41-294 4-4" fill="none"/></g><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-274.57">REST server</text><path d="m214.04-352h-88.5l-4 4v32h88.5l4-4z" fill="none" stroke="#000"/><path d="m210.04-348h-88.5" fill="none" stroke="#000"/><path d="m210.04-348v32" fill="none" stroke="#000"/><path d="m210.04-348 4-4" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-328.57">HTTP server</text><path d="m211.41-52h-87.25v36h87.25z" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-28.57">REST klient</text><path d="m123.81-47.48c-9.98-5.32-19.23-12.6-24.65-22.52-18.53-33.94-18.53-140.06 0-174 3.14-5.75 7.57-10.61 12.68-14.72" fill="none" stroke="#000"/><path d="m109.5-261.36 10.23-2.73-6.3 8.52z" stroke="#000"/><path d="m214.04-160h-88.5l-4 4v32h88.5l4-4z" fill="none" stroke="#000"/><path d="m210.04-156h-88.5" fill="none" stroke="#000"/><path d="m210.04-156v32" fill="none" stroke="#000"/><path d="m210.04-156 4-4" fill="none" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="167.79" y="-136.57">HTTP server</text><ellipse cx="42.58" cy="-238" fill="none" rx="42.58" ry="18" stroke="#000"/><text font-family="arial" font-size="14" text-anchor="middle" x="42.58" y="-232.57">Uživatel</text><path d="m58.05-255.14c13.26-14.98 33.99-36.66 55.11-51.86 1.32-.95 2.68-1.89 4.07-2.81" fill="none" stroke="#000"/><path d="m115.07-312.58 10.36-2.23-6.71 8.2z" stroke="#000"/><path d="m63.93-222.15c19.22 14.98 48.36 37.69 70.72 55.11" fill="none" stroke="#000"/><path d="m136.54-170.01 5.73 8.91-10.04-3.39z" stroke="#000"/></g></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

23
docs/news_module.dot Normal file
View File

@@ -0,0 +1,23 @@
digraph newsmod {
rankdir=TD;
graph [fontname="arial"];
node [fontname="arial"];
edge [fontname="arial"];
USER [label="User"]
STOCK [label="Stock module"]
HTTP [shape=box3d,label="HTTP server (inferium)"]
REST [shape=box3d,label="REST server (inferium)"]
DB [shape=box,label="Database (sled)"]
CORE [shape=box,label="Logic core"]
NEWS [label="External news API"]
AI [shape=box,label="Sentiment analyzer (VADER)"]
USER -> HTTP
USER -> STOCK
STOCK -> REST
CORE -> DB [style="dashed"]
REST -> CORE [style="dashed"]
HTTP -> CORE [style="dashed"]
CORE -> NEWS
CORE -> AI [style="dashed"]
}

View File

@@ -1,11 +1,31 @@
digraph sysdiag {
rankdir=LR
graph [fontname="arial"];
node [fontname="arial"];
edge [fontname="arial"];
RS [shape=box3d,label="REST server"]
ZA [label="API na zprávy"]
RS -> ZA
RC [shape=box,label="REST klient"]
RC -> RS
subgraph cluster_01 {
label="Modul zprávy"
Z_REST_CLIENT [shape=box,label="REST klient"]
Z_REST_SERVER [shape=box3d,label="REST server"]
Z_HTTP_SERVER [shape=box3d,label="HTTP server"]
}
subgraph cluster_02 {
label="Modul burza"
B_REST_CLIENT [shape=box,label="REST klient"]
B_REST_SERVER [shape=box3d,label="REST server"]
B_HTTP_SERVER [shape=box3d,label="HTTP server"]
}
USER [label="Uživatel"]
Z_REST_CLIENT -> B_REST_SERVER
B_REST_CLIENT -> Z_REST_SERVER
USER -> Z_HTTP_SERVER
USER -> B_HTTP_SERVER
}