# maximmolchanov-blip/qr-api-service architecture

> Architecture diagram of the GitHub repository maximmolchanov-blip/qr-api-service, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maximmolchanov-blip/qr-api-service
- Repository: https://github.com/maximmolchanov-blip/qr-api-service

## Overview

This is a Flask QR-code generator offering a browser interface and direct image endpoints. The main workflow is selecting or supplying QR data, optionally choosing appearance settings, generating a PNG, then previewing or downloading it. The README documents social-profile and contact-data types, plus `/qr`, `/view`, and `/download`; sampled code shows rate limiting and QR generation in `app.py`. Several capabilities are documented but their route implementations were not sampled, so the graph avoids guessing their internal calls.

Main entry points: [`app.py`](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py) (QR endpoint), [`keep_alive.py`](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/keep_alive.py) (Keep-alive pinger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web_ui["Web interface<br/>[app.py]"]
  node_type_setup["Type setup<br/>[app.py]"]
  node_preview["QR preview<br/>[app.py]"]
  node_download["PNG download<br/>[app.py]"]
end

subgraph group_service["QR service"]
  node_qr_endpoint["QR endpoint<br/>[app.py]"]
  node_qr_engine["QR image engine<br/>[app.py]"]
  node_appearance["Image options<br/>[app.py]"]
end

subgraph group_protection["Request protection"]
  node_rate_limit["Rate limiter<br/>[app.py]"]
end

subgraph group_runtime["Runtime support"]
  node_keep_alive["Keep-alive pinger<br/>[keep_alive.py]"]
end

node_user(("User"))
node_api_client(("API client"))
node_health_service["Health endpoint"]

node_user -->|"uses"| node_web_ui
node_user -->|"chooses type"| node_type_setup
node_web_ui -->|"requests image"| node_qr_endpoint
node_api_client -->|"requests PNG"| node_qr_endpoint
node_api_client -->|"opens view"| node_preview
node_api_client -->|"requests download"| node_download
node_preview -->|"links image"| node_qr_endpoint
node_qr_endpoint -->|"checks limit"| node_rate_limit
node_qr_endpoint -->|"parses options"| node_appearance
node_qr_endpoint -->|"creates image"| node_qr_engine
node_keep_alive -->|"pings health"| node_health_service

click node_web_ui "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_type_setup "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_preview "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_download "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_qr_endpoint "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_qr_engine "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_appearance "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_rate_limit "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py"
click node_keep_alive "https://github.com/maximmolchanov-blip/qr-api-service/blob/main/keep_alive.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_ui,node_type_setup,node_preview,node_download,node_user,node_api_client toneBlue
class node_qr_endpoint,node_qr_engine,node_appearance toneAmber
class node_rate_limit toneMint
class node_keep_alive toneRose
class node_health_service toneIndigo
```

## Components

### Web experience

- [Web interface](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`
- [Type setup](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`
- [QR preview](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`
- [PNG download](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`

### QR service

- [QR endpoint](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`
- [QR image engine](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`
- [Image options](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`

### Request protection

- [Rate limiter](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/app.py): `app.py`

### Runtime support

- [Keep-alive pinger](https://github.com/maximmolchanov-blip/qr-api-service/blob/main/keep_alive.py): `keep_alive.py`

### Other components

- **User**
- **API client**
- **Health endpoint**

## Connections

- User → Web interface: uses (evidence: `README.md`)
- User → Type setup: chooses type (evidence: `README.md`)
- Web interface → QR endpoint: requests image (evidence: `app.py`)
- API client → QR endpoint: requests PNG (evidence: `README.md`)
- API client → QR preview: opens view (evidence: `README.md`)
- API client → PNG download: requests download (evidence: `README.md`)
- QR preview → QR endpoint: links image (evidence: `app.py`)
- QR endpoint → Rate limiter: checks limit (evidence: `app.py`)
- QR endpoint → Image options: parses options (evidence: `app.py`)
- QR endpoint → QR image engine: creates image (evidence: `app.py`)
- Keep-alive pinger → Health endpoint: pings health (evidence: `keep_alive.py`)
