From 7733d4272cb014bc83268dd7730e975dec7eb776 Mon Sep 17 00:00:00 2001 From: nobe4 Date: Sat, 18 May 2024 22:31:01 +0200 Subject: [PATCH] docs: add a diagram to explore how the flow could work --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 3adcc52..e8945ec 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,40 @@ GitHub notifications managements, better - [ ] create a simple viewer with github.com/rivo/tview list, open, delete - [ ] Implement a ruleset + +```mermaid + +sequenceDiagram + +participant cli +participant memory +participant rules +participant cache +participant api + +cli ->> memory: start +memory ->> cache: read + +alt cache expired + cache ->> api: GET /notifications + api ->> cache: HTTP 200 +end + +cache ->> memory: parse + +loop each notification + activate rules + memory ->> rules: + rules ->> rules: filter + opt + rules ->> memory: modify + end + opt + rules ->> api: query + end + deactivate rules +end + +memory ->> cache: write +memory ->> cli: print +```