diff --git a/architecture.py b/architecture.py new file mode 100644 index 00000000..883d8900 --- /dev/null +++ b/architecture.py @@ -0,0 +1,117 @@ +from diagrams import Cluster, Diagram,Edge +from diagrams.programming.framework import React,Graphql +from diagrams.programming.language import Rust +from diagrams.onprem.database import Mongodb +from diagrams.onprem.network import Nginx +from diagrams.onprem.vcs import Gitlab +from diagrams.onprem.vcs import Git +from diagrams.k8s.compute import Job +from diagrams.onprem.container import Docker +from diagrams.k8s.network import Ing +from diagrams.k8s.compute import Deploy +from diagrams.k8s.network import SVC +from diagrams.k8s.compute import RS +from diagrams.k8s.compute import Pod +from diagrams.azure.network import LoadBalancers +from diagrams.k8s.podconfig import CM +from diagrams.k8s.controlplane import API + + +## Digishop architecture +with Diagram("digishop specification", show=False,direction="LR"): + nginx = Nginx("Nginx") + with Cluster("DigiShop"): + with Cluster("Mongodb"): + master = Mongodb("Master") + slaves = [Mongodb("Slave-1"),Mongodb("Slave-2")] + master >> Edge(label="pull",style="dashed") >> slaves + + with Cluster("DigiShop Backend"): + gateway=Graphql("Gateway") + backend = [ + Rust("Auth"), + Rust("Menu"), + Rust("Settings"), + Rust("Stats"), + Rust("Order") + ] + gateway >>Edge(style="dotted")>> backend + backend >> master + + with Cluster("DigiShop Frontend"): + frontend =[React("Admin"), + React("Dashboard"), + React("Catalogue")] + nginx >> Edge() << frontend <>gateway + + with Cluster("Client Environment") : + with Cluster("Git repositories"): + clients = [Git("Aziza Repo"), + Git("Bouras Repo"), + Git("Sallon Repo")] + clients << Edge(label="push") << nginx + + with Cluster("Pipeline"): + cicd = Gitlab("Gitlab CI/CD") + cicd <> podaziza + #podaziza[1]<> podaziza2 + #podaziza2[1]<> podaziza3 + #podaziza3[1]<> Edge(label="pull",style="dashed") >> slavesc + podaziza >> masterc + podaziza2 >> masterc + podaziza3 >> masterc + + lb = LoadBalancers("Azure lb") + lb << ingress + slavesc-Edge(color="#cffffd")-api<< Edge(style="bold",color="red")<< deploy + + + + \ No newline at end of file diff --git a/diagrams/programming/framework.py b/diagrams/programming/framework.py index 410a53a2..3d401831 100644 --- a/diagrams/programming/framework.py +++ b/diagrams/programming/framework.py @@ -32,6 +32,10 @@ class Flutter(_Framework): _icon = "flutter.png" +class Graphql(_Framework): + _icon = "graphql.png" + + class Laravel(_Framework): _icon = "laravel.png" diff --git a/digishop_specification.png b/digishop_specification.png new file mode 100644 index 00000000..c50966cd Binary files /dev/null and b/digishop_specification.png differ diff --git a/docs/nodes/programming.md b/docs/nodes/programming.md index 60c8a0e3..fcc53b89 100644 --- a/docs/nodes/programming.md +++ b/docs/nodes/programming.md @@ -13,6 +13,7 @@ Node classes list of programming provider. - **diagrams.programming.framework.Ember** - **diagrams.programming.framework.Flask** - **diagrams.programming.framework.Flutter** +- **diagrams.programming.framework.Graphql** - **diagrams.programming.framework.Laravel** - **diagrams.programming.framework.Rails** - **diagrams.programming.framework.React** diff --git a/resources/programming/framework/graphql.png b/resources/programming/framework/graphql.png new file mode 100644 index 00000000..06e971cf Binary files /dev/null and b/resources/programming/framework/graphql.png differ