-
Notifications
You must be signed in to change notification settings - Fork 0
docs(diagrams): migrate mermaid docs to plantuml and png #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
72a2609
docs(diagrams): migrate mermaid docs to plantuml and png
igorsatsyuk b5291e4
docs(diagrams): address copilot review comments
igorsatsyuk ec697dd
docs(diagrams): fix rendering script and observability flow arrows
igorsatsyuk 7c8a070
docs(diagrams): fix refresh payload and localize plantuml cache
igorsatsyuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Architecture Diagrams | ||
|
|
||
| Diagrams are stored in `docs/diagrams/` as PlantUML source and exported PNG files. | ||
|
|
||
| To regenerate PNG files: | ||
|
|
||
| ```pwsh | ||
| ./docs/diagrams/generate-diagrams.ps1 | ||
| ``` | ||
|
|
||
| ## Sequence: Login flow | ||
|
|
||
|  | ||
|
|
||
| Source: `docs/diagrams/sequence-auth-login.puml` | ||
|
|
||
| ## Sequence: Refresh flow | ||
|
|
||
|  | ||
|
|
||
| Source: `docs/diagrams/sequence-auth-refresh.puml` | ||
|
|
||
| ## Sequence: Logout flow | ||
|
|
||
|  | ||
|
|
||
| Source: `docs/diagrams/sequence-auth-logout.puml` | ||
|
|
||
| ## Sequence: Asynchronous client creation | ||
|
|
||
|  | ||
|
|
||
| Source: `docs/diagrams/sequence-async-client-create.puml` | ||
|
|
||
| ## Sequence: Observability data flow | ||
|
|
||
|  | ||
|
|
||
| Source: `docs/diagrams/sequence-observability-flow.puml` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| param( | ||
| [string]$PlantUmlVersion = "1.2025.3" | ||
| ) | ||
|
|
||
| $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $cacheDir = Join-Path $scriptDir ".plantuml-cache" | ||
| $tempJar = Join-Path $cacheDir "plantuml-$PlantUmlVersion.jar" | ||
| $downloadUrl = "https://github.com/plantuml/plantuml/releases/download/v$PlantUmlVersion/plantuml-$PlantUmlVersion.jar" | ||
|
|
||
| if (-not (Test-Path $cacheDir)) { | ||
| New-Item -ItemType Directory -Path $cacheDir | Out-Null | ||
| } | ||
|
|
||
| if (-not (Test-Path $tempJar)) { | ||
| Invoke-WebRequest -Uri $downloadUrl -OutFile $tempJar -ErrorAction Stop | ||
| } | ||
|
|
||
| $pumlFiles = Get-ChildItem -Path $scriptDir -Filter "*.puml" | Select-Object -ExpandProperty FullName | ||
| if (-not $pumlFiles) { | ||
| throw "No .puml files found in $scriptDir" | ||
| } | ||
|
igorsatsyuk marked this conversation as resolved.
|
||
|
|
||
| java -jar $tempJar -charset UTF-8 -tpng @pumlFiles | ||
|
igorsatsyuk marked this conversation as resolved.
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| @startuml | ||
| title Asynchronous client creation flow | ||
|
|
||
| autonumber | ||
| actor "Caller" as C | ||
| participant "API\nPOST /api/clients" as A | ||
| database "request table\n(PostgreSQL)" as D | ||
| participant "Request Worker" as W | ||
|
|
||
| C -> A: POST /api/clients | ||
| A -> A: Validate payload | ||
| A -> D: INSERT type=CLIENT_CREATE,\nstatus=PENDING | ||
| A --> C: AppResponse(code=0,\ndata={requestId}) | ||
|
|
||
| loop Poll until terminal status | ||
| C -> A: GET /api/requests/{id} | ||
| A -> D: SELECT status by id | ||
| A --> C: status=PENDING|PROCESSING|COMPLETED|FAILED | ||
| end | ||
|
|
||
| W -> D: Reclaim stale PROCESSING rows | ||
| W -> D: Claim PENDING batch\n(FOR UPDATE SKIP LOCKED) | ||
| W -> D: UPDATE status=PROCESSING | ||
|
|
||
| alt Success | ||
| W -> D: UPDATE status=COMPLETED,\nresponse_json | ||
| else Failure | ||
| W -> D: UPDATE status=FAILED,\nerror_json | ||
| end | ||
|
|
||
| @enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| @startuml | ||
| title Login flow | ||
|
|
||
| autonumber | ||
| actor "Client" as C | ||
| participant "jwt-demo-reactive\nAuthController" as S | ||
| participant "Keycloak\nToken endpoint" as K | ||
|
|
||
| C -> S: POST /api/auth/login\n{username, password, clientId, clientSecret} | ||
| S -> K: grant_type=password\nusername, password\nclient_id, client_secret | ||
| K --> S: 200 OK\n{access_token, refresh_token} | ||
| S --> C: AppResponse(code=0, data=tokens) | ||
|
|
||
| @enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| @startuml | ||
| title Logout flow | ||
|
|
||
| autonumber | ||
| actor "Client" as C | ||
| participant "jwt-demo-reactive\nAuthController" as S | ||
| participant "Keycloak\nLogout endpoint" as K | ||
|
|
||
| C -> S: POST /api/auth/logout\n{refreshToken, clientId, clientSecret} | ||
| S -> K: client_id, client_secret\nrefresh_token | ||
| K --> S: 200 OK | ||
|
igorsatsyuk marked this conversation as resolved.
|
||
| S --> C: AppResponse(code=0) | ||
|
|
||
| @enduml | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| @startuml | ||
| title Refresh flow | ||
|
|
||
| autonumber | ||
| actor "Client" as C | ||
| participant "jwt-demo-reactive\nAuthController" as S | ||
| participant "Keycloak\nToken endpoint" as K | ||
|
|
||
| C -> S: POST /api/auth/refresh\n{refreshToken, clientId, clientSecret} | ||
| S -> K: grant_type=refresh_token\nrefresh_token\nclient_id, client_secret | ||
| K --> S: 200 OK\n{access_token, refresh_token} | ||
| S --> C: AppResponse(code=0, data=tokens) | ||
|
igorsatsyuk marked this conversation as resolved.
|
||
|
|
||
| @enduml | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| @startuml | ||
| title Observability data flow (OTLP-first) | ||
|
|
||
| autonumber | ||
| participant "Spring Boot app\njwt-demo-reactive" as App | ||
| participant "Prometheus" as Prom | ||
| participant "OTel Collector" as OTel | ||
| participant "Tempo" as Tempo | ||
| participant "Loki" as Loki | ||
| participant "Grafana" as Grafana | ||
|
|
||
| Prom -> App: pull /actuator/prometheus | ||
| App -> OTel: OTLP traces\nmanagement.otlp.tracing.endpoint | ||
| App -> OTel: OTLP logs\nmanagement.otlp.logging.endpoint | ||
| OTel -> Tempo: export traces | ||
| OTel -> Loki: export logs | ||
| Grafana -> Prom: query metrics datasource | ||
| Grafana -> Tempo: query traces datasource | ||
| Grafana -> Loki: query logs datasource | ||
|
|
||
| @enduml |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.