Skip to content

Commit

Permalink
Merge pull request #11 from Blamer-io/diagrams
Browse files Browse the repository at this point in the history
diagrams import
  • Loading branch information
Aliaksei Bialiauski authored Sep 11, 2023
2 parents 7d4aefc + f12d47f commit aad37e1
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/puml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: puml
on:
push:
paths:
- '**.puml'
branches:
- master
permissions:
contents: write
jobs:
plantuml:
runs-on: ubuntu-20.04
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Generate SVG Diagrams
uses: holowinski/plantuml-github-action@main
with:
args: -v -tsvg diagrams/*.puml
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: h1alexbel
author_email: hialexbel@gmail.com
message: 'diagram generated'
add: 'diagrams/*'
19 changes: 19 additions & 0 deletions diagrams/add-token.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@startuml
title Add Token Success Flow
actor TelegramUser as user
participant Bot as bot
participant Hub as hub
database Database as db
participant Auth as auth
participant GitHub as github

user -> bot : Chat ID, Token, TokenAlias
bot -> hub : Chat ID, Token, TokenAlias
hub -> auth: Validate token
auth -> github: Auth token
github --> auth: Auth response
auth --> hub: Auth response
hub -> db: Chat ID, Token, TokenAlias
hub --> bot: Chat ID, TokenAlias status
bot --> user: Chat ID, TokenAlias status
@enduml
21 changes: 21 additions & 0 deletions diagrams/notifications-read.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@startuml
title Notifications Read Flow
actor TelegramUser as user
participant Bot as bot
participant Hub as hub
queue Broker as broker
database Database as db
participant Notifications as notifications
participant GitHub as github

notifications -> hub
hub -> db: All toggled aliases
db --> hub: Chat ID:Token, TokenAlias
hub --> notifications: Chat ID:Token, TokenAlias
notifications -> github: Polling by token
github --> notifications: Notifications Stream
notifications -> broker: Tuple ID, Notifications Stream
bot -> broker
broker --> bot: Tuple ID, Notifications Stream
bot --> user: Chat ID, TokenAlias:Notifications Stream
@enduml
11 changes: 11 additions & 0 deletions diagrams/register-chat.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@startuml
title Register Chat ID Flow
actor TelegramUser as user
participant Bot as bot
participant Hub as hub
database Database as db

user -> bot: /chat-id
bot -> hub: Chat ID
hub -> db: Chat ID
@enduml
24 changes: 24 additions & 0 deletions diagrams/token-validation.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
title Token Validation Process
actor TelegramUser as user
participant Bot as bot
participant Hub as hub
database Database as db
participant Auth as auth
participant GitHub as github

loop every 30 minutes
auth -> hub
hub -> db: All tokens
db --> hub: Chat ID, Tokens
hub --> auth: Chat ID, Tokens
auth -> github: Validate token
github --> auth: Validation status
alt Token expired
auth -> hub: Chat ID, Token, TokenAlias expired
hub -> db: Chat ID, Token, TokenAlias expired status
auth -> bot: Chat ID, Token expired
bot --> user: Chat ID, Token expired
end
end
@enduml

0 comments on commit aad37e1

Please sign in to comment.