Skip to content

Commit 48777b5

Browse files
authoredMar 29, 2024
Change diagram generation strategy (#3)
* Change diagram generation strategy * Diagramas gerados automaticamente para o repositório --------- Co-authored-by: cassiobotaro <cassiobotaro@users.noreply.github.com>
1 parent 32d9921 commit 48777b5

File tree

5 files changed

+347
-12
lines changed

5 files changed

+347
-12
lines changed
 

‎.github/workflows/main.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ on: push
33
jobs:
44
build:
55
runs-on: ubuntu-latest
6-
strategy:
7-
matrix:
8-
repo: [relacionamentos, icones, cms, imersaofc, intencoes, maonamassa, niveis, ]
96
permissions:
107
contents: write
118
container:
@@ -18,7 +15,7 @@ jobs:
1815
- uses: actions/checkout@v4
1916
- name: Generate diagrams
2017
run: |
21-
bash scripts/gerar-diagramas.sh ${{ matrix.repo }}
18+
bash scripts/gerar-diagramas.sh
2219
- name: Commit changes
2320
uses: stefanzweifel/git-auto-commit-action@v5
2421
with:

‎imersaofc/diagramas.md

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
## ContainerDiagram
2+
3+
```mermaid
4+
graph LR
5+
linkStyle default fill:#ffffff
6+
7+
subgraph diagram ["Full Cycle Gateway - Containers"]
8+
style diagram fill:#ffffff,stroke:#ffffff
9+
10+
1("<div style='font-weight: bold'>Cliente</div><div style='font-size: 70%; margin-top: 0px'>[Software System]</div><div style='font-size: 80%; margin-top:10px'>Sistema que solicita o<br />pagamento.</div>")
11+
style 1 fill:#ffffff,stroke:#999999,color:#999999
12+
2["<div style='font-weight: bold'>Administradora</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div><div style='font-size: 80%; margin-top:10px'>Acompanha as transações de<br />pagamento.</div>"]
13+
style 2 fill:#ffffff,stroke:#999999,color:#999999
14+
3["<div style='font-weight: bold'>Administradora da Gateway</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div><div style='font-size: 80%; margin-top:10px'>Acompanha as métricas de<br />transações de pagamento.</div>"]
15+
style 3 fill:#ffffff,stroke:#ffa505,color:#ffa505
16+
17+
subgraph 4 [Full Cycle Gateway]
18+
style 4 fill:#ffffff,stroke:#1168bd,color:#1168bd
19+
20+
11[("<div style='font-weight: bold'>RequisicoesTransacoes</div><div style='font-size: 70%; margin-top: 0px'>[Container: MySQL schema]</div><div style='font-size: 80%; margin-top:10px'>Armazena as requisições de<br />transações de pagamento.</div>")]
21+
style 11 fill:#ffffff,stroke:#438dd5,color:#438dd5
22+
13[("<div style='font-weight: bold'>Transacoes</div><div style='font-size: 70%; margin-top: 0px'>[Container: MySQL schema]</div><div style='font-size: 80%; margin-top:10px'>Armazena as transações de<br />pagamento.</div>")]
23+
style 13 fill:#ffffff,stroke:#438dd5,color:#438dd5
24+
15("<div style='font-weight: bold'>Métricas de pagamento</div><div style='font-size: 70%; margin-top: 0px'>[Container: Prometheus]</div><div style='font-size: 80%; margin-top:10px'>Armazena métricas de<br />pagamento</div>")
25+
style 15 fill:#ffffff,stroke:#438dd5,color:#438dd5
26+
17("<div style='font-weight: bold'>Dashboard de métricas</div><div style='font-size: 70%; margin-top: 0px'>[Container: Grafana]</div><div style='font-size: 80%; margin-top:10px'>Exibe métricas de pagamentos</div>")
27+
style 17 fill:#ffffff,stroke:#438dd5,color:#438dd5
28+
21["<div style='font-weight: bold'>Painel de Controle</div><div style='font-size: 70%; margin-top: 0px'>[Container: Next.js]</div><div style='font-size: 80%; margin-top:10px'>Monitora as transações de<br />pagamento e seus status</div>"]
29+
style 21 fill:#ffffff,stroke:#438dd5,color:#438dd5
30+
5("<div style='font-weight: bold'>Backend</div><div style='font-size: 70%; margin-top: 0px'>[Container: Nest.js]</div><div style='font-size: 80%; margin-top:10px'>Sistema que recebe a<br />solicitação de pagamento</div>")
31+
style 5 fill:#ffffff,stroke:#438dd5,color:#438dd5
32+
8("<div style='font-weight: bold'>Processador de pagamentos</div><div style='font-size: 70%; margin-top: 0px'>[Container: Go]</div><div style='font-size: 80%; margin-top:10px'>Processa pagamento:<br />autorizando ou rejeitando</div>")
33+
style 8 fill:#ffffff,stroke:#438dd5,color:#438dd5
34+
end
35+
36+
8-. "<div>Envia resultado da transação</div><div style='font-size: 70%'>[Através do Kafka pelo tópico transactions_result]</div>" .->5
37+
5-. "<div>Recebe dados do pagamento</div><div style='font-size: 70%'>[MySQL Protocol]</div>" .->11
38+
8-. "<div>Recebe dados do pagamento</div><div style='font-size: 70%'>[MySQL Protocol]</div>" .->13
39+
8-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[HTTP/TXT]</div>" .->15
40+
17-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[PromQL]</div>" .->15
41+
3-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[HTTPS]</div>" .->17
42+
2-. "<div>Solicita dados das transações<br />em</div><div style='font-size: 70%'>[HTTPS]</div>" .->21
43+
21-. "<div>Recupera informações de<br />pagamento</div><div style='font-size: 70%'>[HTTPS/JSON]</div>" .->5
44+
1-. "<div>Solicita pagamento em</div><div style='font-size: 70%'>[HTTP/JSON]</div>" .->5
45+
5-. "<div>Envia dados de pagamento para</div><div style='font-size: 70%'>[Através do Kafka pelo tópico transactions]</div>" .->8
46+
end
47+
```
48+
49+
## ContextDiagram
50+
51+
```mermaid
52+
graph TB
53+
linkStyle default fill:#ffffff
54+
55+
subgraph diagram ["Full Cycle Gateway - System Context"]
56+
style diagram fill:#ffffff,stroke:#ffffff
57+
58+
1("<div style='font-weight: bold'>Cliente</div><div style='font-size: 70%; margin-top: 0px'>[Software System]</div><div style='font-size: 80%; margin-top:10px'>Sistema que solicita o<br />pagamento.</div>")
59+
style 1 fill:#ffffff,stroke:#999999,color:#999999
60+
2["<div style='font-weight: bold'>Administradora</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div><div style='font-size: 80%; margin-top:10px'>Acompanha as transações de<br />pagamento.</div>"]
61+
style 2 fill:#ffffff,stroke:#999999,color:#999999
62+
3["<div style='font-weight: bold'>Administradora da Gateway</div><div style='font-size: 70%; margin-top: 0px'>[Person]</div><div style='font-size: 80%; margin-top:10px'>Acompanha as métricas de<br />transações de pagamento.</div>"]
63+
style 3 fill:#ffffff,stroke:#ffa505,color:#ffa505
64+
4("<div style='font-weight: bold'>Full Cycle Gateway</div><div style='font-size: 70%; margin-top: 0px'>[Software System]</div>")
65+
style 4 fill:#ffffff,stroke:#1168bd,color:#1168bd
66+
67+
3-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[HTTPS]</div>" .->4
68+
2-. "<div>Solicita dados das transações<br />em</div><div style='font-size: 70%'>[HTTPS]</div>" .->4
69+
1-. "<div>Solicita pagamento em</div><div style='font-size: 70%'>[HTTP/JSON]</div>" .->4
70+
end
71+
```
72+
73+
## LiveDeployment
74+
75+
```mermaid
76+
graph LR
77+
linkStyle default fill:#ffffff
78+
79+
subgraph diagram ["Full Cycle Gateway - Deployment - Live"]
80+
style diagram fill:#ffffff,stroke:#ffffff
81+
82+
subgraph 25 [US-East-1]
83+
style 25 fill:#ffffff,stroke:#888888,color:#000000
84+
85+
subgraph 26 [Autoscaling group frontend]
86+
style 26 fill:#ffffff,stroke:#da2e6e,color:#da2e6e
87+
88+
subgraph 27 [Amazon EC2]
89+
style 27 fill:#ffffff,stroke:#e5770d,color:#e5770d
90+
91+
28["<div style='font-weight: bold'>Painel de Controle</div><div style='font-size: 70%; margin-top: 0px'>[Container: Next.js]</div><div style='font-size: 80%; margin-top:10px'>Monitora as transações de<br />pagamento e seus status</div>"]
92+
style 28 fill:#ffffff,stroke:#438dd5,color:#438dd5
93+
end
94+
95+
end
96+
97+
subgraph 29 [Autoscaling group backend]
98+
style 29 fill:#ffffff,stroke:#da2e6e,color:#da2e6e
99+
100+
subgraph 30 [Amazon EC2]
101+
style 30 fill:#ffffff,stroke:#e5770d,color:#e5770d
102+
103+
31("<div style='font-weight: bold'>Backend</div><div style='font-size: 70%; margin-top: 0px'>[Container: Nest.js]</div><div style='font-size: 80%; margin-top:10px'>Sistema que recebe a<br />solicitação de pagamento</div>")
104+
style 31 fill:#ffffff,stroke:#438dd5,color:#438dd5
105+
end
106+
107+
end
108+
109+
subgraph 33 [Amazon EC2 - Processor]
110+
style 33 fill:#ffffff,stroke:#e5770d,color:#e5770d
111+
112+
34("<div style='font-weight: bold'>Processador de pagamentos</div><div style='font-size: 70%; margin-top: 0px'>[Container: Go]</div><div style='font-size: 80%; margin-top:10px'>Processa pagamento:<br />autorizando ou rejeitando</div>")
113+
style 34 fill:#ffffff,stroke:#438dd5,color:#438dd5
114+
end
115+
116+
subgraph 37 [Managed Grafana]
117+
style 37 fill:#ffffff,stroke:#d72b6c,color:#d72b6c
118+
119+
38("<div style='font-weight: bold'>Dashboard de métricas</div><div style='font-size: 70%; margin-top: 0px'>[Container: Grafana]</div><div style='font-size: 80%; margin-top:10px'>Exibe métricas de pagamentos</div>")
120+
style 38 fill:#ffffff,stroke:#438dd5,color:#438dd5
121+
end
122+
123+
subgraph 39 [Managed Prometheus]
124+
style 39 fill:#ffffff,stroke:#da2e6e,color:#da2e6e
125+
126+
40("<div style='font-weight: bold'>Métricas de pagamento</div><div style='font-size: 70%; margin-top: 0px'>[Container: Prometheus]</div><div style='font-size: 80%; margin-top:10px'>Armazena métricas de<br />pagamento</div>")
127+
style 40 fill:#ffffff,stroke:#438dd5,color:#438dd5
128+
end
129+
130+
subgraph 43 [Amazon RDS backend]
131+
style 43 fill:#ffffff,stroke:#3f51d4,color:#3f51d4
132+
133+
subgraph 44 [MySQL]
134+
style 44 fill:#ffffff,stroke:#888888,color:#000000
135+
136+
45[("<div style='font-weight: bold'>RequisicoesTransacoes</div><div style='font-size: 70%; margin-top: 0px'>[Container: MySQL schema]</div><div style='font-size: 80%; margin-top:10px'>Armazena as requisições de<br />transações de pagamento.</div>")]
137+
style 45 fill:#ffffff,stroke:#438dd5,color:#438dd5
138+
end
139+
140+
end
141+
142+
subgraph 47 [Amazon RDS processor]
143+
style 47 fill:#ffffff,stroke:#3f51d4,color:#3f51d4
144+
145+
subgraph 48 [MySQL]
146+
style 48 fill:#ffffff,stroke:#888888,color:#000000
147+
148+
49[("<div style='font-weight: bold'>Transacoes</div><div style='font-size: 70%; margin-top: 0px'>[Container: MySQL schema]</div><div style='font-size: 80%; margin-top:10px'>Armazena as transações de<br />pagamento.</div>")]
149+
style 49 fill:#ffffff,stroke:#438dd5,color:#438dd5
150+
end
151+
152+
end
153+
154+
end
155+
156+
28-. "<div>Recupera informações de<br />pagamento</div><div style='font-size: 70%'>[HTTPS/JSON]</div>" .->31
157+
34-. "<div>Envia resultado da transação</div><div style='font-size: 70%'>[Através do Kafka pelo tópico transactions_result]</div>" .->31
158+
31-. "<div>Envia dados de pagamento para</div><div style='font-size: 70%'>[Através do Kafka pelo tópico transactions]</div>" .->34
159+
34-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[HTTP/TXT]</div>" .->40
160+
38-. "<div>Consume métricas de pagamento<br />em</div><div style='font-size: 70%'>[PromQL]</div>" .->40
161+
31-. "<div>Recebe dados do pagamento</div><div style='font-size: 70%'>[MySQL Protocol]</div>" .->45
162+
34-. "<div>Recebe dados do pagamento</div><div style='font-size: 70%'>[MySQL Protocol]</div>" .->49
163+
end
164+
```
165+

‎intencoes/diagramas.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## IntencoesAntes
2+
3+
```mermaid
4+
graph LR
5+
linkStyle default fill:#ffffff
6+
7+
subgraph diagram ["Intenções Antes"]
8+
style diagram fill:#ffffff,stroke:#ffffff
9+
10+
1("<div style='font-weight: bold'>Container A</div><div style='font-size: 70%; margin-top: 0px'>[Produtor de eventos para a fila.]</div><div style='font-size: 80%; margin-top:10px'>Python</div>")
11+
style 1 fill:#438dd5,stroke:#2e6295,color:#ffffff
12+
2("<div style='font-weight: bold'>Container B</div><div style='font-size: 70%; margin-top: 0px'>[Consumidor de eventos da fila]</div><div style='font-size: 80%; margin-top:10px'>Java</div>")
13+
style 2 fill:#438dd5,stroke:#2e6295,color:#ffffff
14+
3("<div style='font-weight: bold'>Container C</div><div style='font-size: 70%; margin-top: 0px'>[Produtor de eventos para a fila.]</div><div style='font-size: 80%; margin-top:10px'>NodeJS</div>")
15+
style 3 fill:#438dd5,stroke:#2e6295,color:#ffffff
16+
4("<div style='font-weight: bold'>Container D</div><div style='font-size: 70%; margin-top: 0px'>[Consumidor de eventos da fila]</div><div style='font-size: 80%; margin-top:10px'>Go</div>")
17+
style 4 fill:#438dd5,stroke:#2e6295,color:#ffffff
18+
5("<div style='font-weight: bold'>Intermediário</div><div style='font-size: 70%; margin-top: 0px'>[RabbitMQ]</div><div style='font-size: 80%; margin-top:10px'>Envia mensagens para seus<br />respectivos consumidores.</div>")
19+
style 5 fill:#438dd5,stroke:#2e6295,color:#ffffff
20+
21+
1-. "<div>Envia mensagem para</div><div style='font-size: 70%'>[amqp]</div>" .->5
22+
3-. "<div>Envia mensagem para</div><div style='font-size: 70%'>[amqp]</div>" .->5
23+
5-. "<div>Consome mensagem</div><div style='font-size: 70%'>[amqp]</div>" .->2
24+
5-. "<div>Consome mensagem</div><div style='font-size: 70%'>[amqp]</div>" .->4
25+
end
26+
```
27+
28+
## IntencoesDepois
29+
30+
```mermaid
31+
graph LR
32+
linkStyle default fill:#ffffff
33+
34+
subgraph diagram ["Intenções Depois"]
35+
style diagram fill:#ffffff,stroke:#ffffff
36+
37+
1("<div style='font-weight: bold'>Container A</div><div style='font-size: 70%; margin-top: 0px'>[Produtor de eventos para a fila.]</div><div style='font-size: 80%; margin-top:10px'>Python</div>")
38+
style 1 fill:#438dd5,stroke:#2e6295,color:#ffffff
39+
2("<div style='font-weight: bold'>Container B</div><div style='font-size: 70%; margin-top: 0px'>[Consumidor de eventos da fila]</div><div style='font-size: 80%; margin-top:10px'>Java</div>")
40+
style 2 fill:#438dd5,stroke:#2e6295,color:#ffffff
41+
3("<div style='font-weight: bold'>Container C</div><div style='font-size: 70%; margin-top: 0px'>[Produtor de eventos para a fila.]</div><div style='font-size: 80%; margin-top:10px'>NodeJS</div>")
42+
style 3 fill:#438dd5,stroke:#2e6295,color:#ffffff
43+
4("<div style='font-weight: bold'>Container D</div><div style='font-size: 70%; margin-top: 0px'>[Consumidor de eventos da fila]</div><div style='font-size: 80%; margin-top:10px'>Go</div>")
44+
style 4 fill:#438dd5,stroke:#2e6295,color:#ffffff
45+
46+
1-. "<div>Envia mensagem de criação de<br />usuário</div><div style='font-size: 70%'>[via RabbitMQ fila CREATE]</div>" .->2
47+
3-. "<div>Envia mensagem de atualização<br />de usuário</div><div style='font-size: 70%'>[via RabbitMQ fila UPDATE]</div>" .->4
48+
end
49+
```
50+

0 commit comments

Comments
 (0)