diff --git a/samples/url-shortener/python/README.md b/samples/url-shortener/python/README.md index 5d6f0bb..78323e7 100644 --- a/samples/url-shortener/python/README.md +++ b/samples/url-shortener/python/README.md @@ -23,32 +23,37 @@ The solution is composed of the following Azure resources: - *QrGenerator* ([Queue Storage trigger](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger)): Requests the QR SVG render for the short link. ```mermaid -flowchart LR +%%{init: {"flowchart": {"nodeSpacing": 60, "rankSpacing": 80}}}%% +flowchart TB user((User)) subgraph webapp["Web App (Flask)"] - shorten["POST /shorten"] follow["GET /l/{code}"] + shorten["POST /shorten"] internal["POST /internal/*
(token-protected)"] end + kv["Key Vault
link-sign-key, pg-conn"] + pg[("PostgreSQL
clicks db")] + sb[["Service Bus
link-events queue"]] + links[("links table
(Storage Account)")] + qrjobs[["qrjobs queue
(Storage Account)"]] + qrcodes[("qrcodes container
(Storage Account, public read)")] + logs["Log Analytics"] + subgraph functions["Function App (worker)"] abuse["AbuseScan
(Service Bus trigger)"] qrgen["QrGenerator
(queue trigger)"] end - subgraph storage["Storage Account"] - links[("links table")] - qrjobs[["qrjobs queue"]] - qrcodes[("qrcodes container
public read")] - end + user -->|"2: follow short link"| follow + user -->|"1: shorten URL"| shorten + user -.->|"3: fetch QR"| qrcodes - kv["Key Vault
link-sign-key, pg-conn"] - sb[["Service Bus
link-events queue"]] - pg[("PostgreSQL
clicks db")] - logs["Log Analytics"] + follow -.->|"read pg-conn"| kv + follow -->|"click row"| pg + follow -->|"hit counter"| links - user -->|"1: shorten URL"| shorten shorten -.->|"read sign key"| kv shorten -->|"write link + sig"| links shorten -->|"link-created event"| sb @@ -61,13 +66,10 @@ flowchart LR internal -->|"scan / qr status"| links internal -->|"QR SVG"| qrcodes - user -->|"2: follow short link"| follow - follow -->|"hit counter"| links - follow -.->|"read pg-conn"| kv - follow -->|"click row"| pg + links -.->|"transaction metrics
(diagnostic settings)"| logs - user -.->|"3: fetch QR"| qrcodes - storage -.->|"transaction metrics"| logs + style webapp fill:#ffffff,stroke:#999999,color:#333333 + style functions fill:#ffffff,stroke:#999999,color:#333333 ``` The flow of a single link: `POST /shorten` → Table Storage + Key Vault + Service Bus + Queue Storage → workers → internal API → Table Storage + Blob Storage → `GET /l/` → PostgreSQL + 302 redirect. The home page renders the link table with hit counts, signatures, scan verdicts and QR links.