-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathdiagrams_generator.py
52 lines (47 loc) · 1.72 KB
/
diagrams_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from diagrams import Cluster, Diagram, Edge
from diagrams.onprem.compute import Server
from diagrams.onprem.monitoring import Grafana
from diagrams.aws.iot import IotMqtt
from diagrams.onprem.database import MongoDB
from diagrams.onprem.database import InfluxDB
from diagrams.onprem.network import HAProxy
from diagrams.onprem.inmemory import Redis
with Diagram(
name="Docker Flask MongoDB example",
show=True,
filename="../resources/autogenerated",
direction="LR",
):
with Cluster("Services"):
fulltext_search = Server("Fulltext search")
users = Server("Users")
book_collection = Server("Book collection")
geolocation_search = Server("Geolocation search")
photo_process = Server("Photo process")
random_demo = Server("Random demo")
tic_tac_toe = Server("Tic tac toe")
users_fastapi = Server("Users Fastapi")
webservers = [
fulltext_search,
book_collection,
geolocation_search,
random_demo,
users,
users_fastapi,
]
proxy = HAProxy("Krakend")
mqtt_service = Server("MQTT service")
mongo = MongoDB("MongoDb")
mosquitto = IotMqtt("Mosquitto")
grafana = Grafana("Grafana")
influxdb = InfluxDB("InfluxDB")
redis = Redis("Redis")
webservers >> Edge(color="brown") >> mongo
users >> Edge(color="brows") >> redis
book_collection >> Edge(color="black") >> users
mqtt_service >> Edge(color="brown") >> mosquitto
mqtt_service >> Edge(color="brown") >> mongo
mqtt_service >> Edge(color="brown") >> influxdb
grafana >> Edge(color="brown") >> influxdb
proxy >> Edge(color="black") >> random_demo
proxy >> Edge(color="black") >> users