# baobingbo/flower-fastapi architecture

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

- Interactive diagram: https://gitdiagram.com/baobingbo/flower-fastapi
- Repository: https://github.com/baobingbo/flower-fastapi

## Overview

FlowerUI is a FastAPI and Vue-based Celery monitoring and management platform. Users authenticate, inspect workers and tasks, review dashboards and broker queues, and issue task or worker controls; backend services collect events and expose live updates. The graph also preserves documented capabilities for runtime configuration, themes, metrics, and demo mode. Some frontend and service modules were not sampled, so those capability links rely on README documentation; uncertain internal call paths are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/main.py) (App assembly), [`backend/app/services/manager.py`](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/manager.py) (Service manager), [`frontend/src/api`](https://github.com/baobingbo/flower-fastapi/tree/main/frontend/src/api) (HTTP and WS clients), [`backend/app/api/routers/tasks.py`](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/tasks.py) (Task operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend runtime"]
  node_app["App assembly<br/>[main.py]"]
  node_manager["Service manager<br/>[manager.py]"]
  node_celery["Celery connection<br/>[celery_app.py]"]
  node_events["Event collector<br/>[events.py]"]
  node_state[("Cluster state<br/>[state.py]")]
  node_inspector["Worker inspector<br/>[inspector.py]"]
  node_mock["Demo cluster<br/>[mock.py]"]
  node_hub["Event hub<br/>[hub.py]"]
end

subgraph group_api["API surface"]
  node_workers_api["Worker controls<br/>[workers.py]"]
  node_tasks_api["Task operations<br/>[tasks.py]"]
  node_dashboard_api["Dashboard queries<br/>[dashboard.py]"]
  node_ws_api["Live event socket<br/>[ws.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_config_api["Configuration API<br/>[config.py]"]
  node_broker_api["Broker queries<br/>[broker.py]"]
  node_monitor_api["Monitoring endpoints<br/>[monitor.py]"]
  node_themes_api["Theme endpoints<br/>[themes.py]"]
end

subgraph group_frontend["Web application"]
  node_spa["Vue application<br/>[App.vue]"]
  node_views["Monitoring views"]
  node_api_client["HTTP and WS clients"]
  node_app_store["Live app state<br/>[app.js]"]
  node_theme_ui["Theme interface<br/>[ThemeSwitcher.vue]"]
end

subgraph group_ops["Platform capabilities"]
  node_runtime_config["Runtime configuration<br/>[runtime_config.py]"]
  node_metrics["Prometheus metrics<br/>[metrics.py]"]
  node_broker_service["Queue inspection<br/>[broker.py]"]
  node_task_search["Task search<br/>[search.py]"]
  node_task_filter["Task filtering<br/>[task_filter.py]"]
  node_theme_manager["Theme manager<br/>[theme_manager.py]"]
end

node_user(("Operator"))
node_celery_workers{{"Celery workers"}}
node_broker[("Celery broker")]
node_prometheus(("Prometheus scraper"))

node_user -->|"uses"| node_spa
node_spa -->|"routes to"| node_views
node_spa -->|"initializes"| node_app_store
node_views -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_workers_api
node_api_client -.->|"calls API"| node_tasks_api
node_api_client -.->|"calls API"| node_dashboard_api
node_api_client -.->|"opens socket"| node_ws_api
node_user -->|"signs in"| node_auth
node_app -->|"starts"| node_manager
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_workers_api
node_app -->|"registers"| node_tasks_api
node_app -->|"registers"| node_dashboard_api
node_app -->|"registers"| node_ws_api
node_app -->|"registers"| node_config_api
node_app -->|"registers"| node_themes_api
node_workers_api -->|"queries and controls"| node_manager
node_tasks_api -->|"queries and dispatches"| node_manager
node_tasks_api -->|"filters results"| node_task_filter
node_task_filter -->|"uses DSL"| node_task_search
node_manager -->|"uses connection"| node_celery
node_manager -->|"starts collection"| node_events
node_manager -->|"inspects workers"| node_inspector
node_manager -->|"queries queues"| node_broker_service
node_manager -->|"uses demo mode"| node_mock
node_events -->|"updates state"| node_state
node_state -.->|"publishes updates"| node_hub
node_state -.->|"updates metrics"| node_metrics
node_dashboard_api -->|"reads summaries"| node_manager
node_ws_api -->|"subscribes"| node_hub
node_config_api -->|"manages settings"| node_runtime_config
node_app -->|"loads settings"| node_runtime_config
node_themes_api -->|"manages themes"| node_theme_manager
node_theme_manager -->|"broadcasts changes"| node_hub
node_monitor_api -.->|"exposes metrics"| node_metrics
node_prometheus -->|"scrapes"| node_monitor_api
node_celery -->|"connects"| node_broker
node_celery_workers -.->|"communicate through"| node_broker
node_theme_ui -.->|"manages themes"| node_themes_api
node_app_store -.->|"receives events"| node_ws_api

click node_app "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/main.py"
click node_manager "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/manager.py"
click node_celery "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/core/celery_app.py"
click node_events "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/events.py"
click node_state "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/state.py"
click node_inspector "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/inspector.py"
click node_mock "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/mock.py"
click node_hub "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/hub.py"
click node_workers_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/workers.py"
click node_tasks_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/tasks.py"
click node_dashboard_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/dashboard.py"
click node_ws_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/ws.py"
click node_auth "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/auth.py"
click node_config_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/config.py"
click node_broker_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/broker.py"
click node_monitor_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/monitor.py"
click node_themes_api "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/themes.py"
click node_runtime_config "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/runtime_config.py"
click node_metrics "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/metrics.py"
click node_broker_service "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/broker.py"
click node_task_search "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/search.py"
click node_task_filter "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/task_filter.py"
click node_theme_manager "https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/theme_manager.py"
click node_spa "https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/App.vue"
click node_views "https://github.com/baobingbo/flower-fastapi/tree/main/frontend/src/views"
click node_api_client "https://github.com/baobingbo/flower-fastapi/tree/main/frontend/src/api"
click node_app_store "https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/stores/app.js"
click node_theme_ui "https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/components/ThemeSwitcher.vue"

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_app,node_manager,node_celery,node_events,node_state,node_inspector,node_mock,node_hub toneBlue
class node_workers_api,node_tasks_api,node_dashboard_api,node_ws_api,node_auth,node_config_api,node_broker_api,node_monitor_api,node_themes_api,node_broker toneAmber
class node_spa,node_views,node_api_client,node_app_store,node_theme_ui toneMint
class node_runtime_config,node_metrics,node_broker_service,node_task_search,node_task_filter,node_theme_manager,node_celery_workers toneRose
class node_user,node_prometheus toneIndigo
```

## Components

### Backend runtime

- [App assembly](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/main.py): `backend/app/main.py`
- [Service manager](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/manager.py): `backend/app/services/manager.py`
- [Celery connection](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/core/celery_app.py): `backend/app/core/celery_app.py`
- [Event collector](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/events.py): `backend/app/services/events.py`
- [Cluster state](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/state.py): `backend/app/services/state.py`
- [Worker inspector](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/inspector.py): `backend/app/services/inspector.py`
- [Demo cluster](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/mock.py): `backend/app/services/mock.py`
- [Event hub](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/hub.py): `backend/app/services/hub.py`

### API surface

- [Worker controls](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/workers.py): `backend/app/api/routers/workers.py`
- [Task operations](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/tasks.py): `backend/app/api/routers/tasks.py`
- [Dashboard queries](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/dashboard.py): `backend/app/api/routers/dashboard.py`
- [Live event socket](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/ws.py): `backend/app/api/routers/ws.py`
- [Authentication](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/auth.py): `backend/app/api/routers/auth.py`
- [Configuration API](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/config.py): `backend/app/api/routers/config.py`
- [Broker queries](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/broker.py): `backend/app/api/routers/broker.py`
- [Monitoring endpoints](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/monitor.py): `backend/app/api/routers/monitor.py`
- [Theme endpoints](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/api/routers/themes.py): `backend/app/api/routers/themes.py`

### Web application

- [Vue application](https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Monitoring views](https://github.com/baobingbo/flower-fastapi/tree/main/frontend/src/views): `frontend/src/views`
- [HTTP and WS clients](https://github.com/baobingbo/flower-fastapi/tree/main/frontend/src/api): `frontend/src/api`
- [Live app state](https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/stores/app.js): `frontend/src/stores/app.js`
- [Theme interface](https://github.com/baobingbo/flower-fastapi/blob/main/frontend/src/components/ThemeSwitcher.vue): `frontend/src/components/ThemeSwitcher.vue`

### Platform capabilities

- [Runtime configuration](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/runtime_config.py): `backend/app/services/runtime_config.py`
- [Prometheus metrics](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/metrics.py): `backend/app/services/metrics.py`
- [Queue inspection](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/broker.py): `backend/app/services/broker.py`
- [Task search](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/search.py): `backend/app/services/search.py`
- [Task filtering](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/task_filter.py): `backend/app/services/task_filter.py`
- [Theme manager](https://github.com/baobingbo/flower-fastapi/blob/main/backend/app/services/theme_manager.py): `backend/app/services/theme_manager.py`

### Other components

- **Operator**
- **Celery workers**
- **Celery broker**
- **Prometheus scraper**

## Connections

- Operator → Vue application: uses (evidence: `README.md`)
- Vue application → Monitoring views: routes to (evidence: `frontend/src/App.vue`)
- Vue application → Live app state: initializes (evidence: `frontend/src/App.vue`)
- Monitoring views → HTTP and WS clients: requests data (evidence: `README.md`)
- HTTP and WS clients → Worker controls: calls API (evidence: `README.md`)
- HTTP and WS clients → Task operations: calls API (evidence: `README.md`)
- HTTP and WS clients → Dashboard queries: calls API (evidence: `README.md`)
- HTTP and WS clients → Live event socket: opens socket (evidence: `README.md`)
- Operator → Authentication: signs in (evidence: `README.md`)
- App assembly → Service manager: starts (evidence: `backend/app/main.py`)
- App assembly → Authentication: registers (evidence: `backend/app/main.py`)
- App assembly → Worker controls: registers (evidence: `backend/app/main.py`)
- App assembly → Task operations: registers (evidence: `backend/app/main.py`)
- App assembly → Dashboard queries: registers (evidence: `backend/app/main.py`)
- App assembly → Live event socket: registers (evidence: `backend/app/main.py`)
- App assembly → Configuration API: registers (evidence: `backend/app/main.py`)
- App assembly → Theme endpoints: registers (evidence: `backend/app/main.py`)
- Worker controls → Service manager: queries and controls (evidence: `backend/app/api/routers/workers.py`)
- Task operations → Service manager: queries and dispatches (evidence: `backend/app/api/routers/tasks.py`)
- Task operations → Task filtering: filters results (evidence: `backend/app/api/routers/tasks.py`)
- Task filtering → Task search: uses DSL (evidence: `backend/app/services/task_filter.py`)
- Service manager → Celery connection: uses connection (evidence: `backend/app/services/manager.py`)
- Service manager → Event collector: starts collection (evidence: `backend/app/services/manager.py`)
- Service manager → Worker inspector: inspects workers (evidence: `backend/app/services/manager.py`)
- Service manager → Queue inspection: queries queues (evidence: `backend/app/services/manager.py`)
- Service manager → Demo cluster: uses demo mode (evidence: `backend/app/services/manager.py`)
- Event collector → Cluster state: updates state (evidence: `backend/app/services/events.py`)
- Cluster state → Event hub: publishes updates (evidence: `backend/app/services/state.py`)
- Cluster state → Prometheus metrics: updates metrics (evidence: `backend/app/services/state.py`)
- Dashboard queries → Service manager: reads summaries (evidence: `backend/app/api/routers/dashboard.py`)
- Live event socket → Event hub: subscribes (evidence: `backend/app/api/routers/ws.py`)
- Configuration API → Runtime configuration: manages settings (evidence: `backend/app/api/routers/config.py`)
- App assembly → Runtime configuration: loads settings (evidence: `backend/app/main.py`)
- Theme endpoints → Theme manager: manages themes (evidence: `backend/app/api/routers/themes.py`)
- Theme manager → Event hub: broadcasts changes (evidence: `backend/app/services/theme_manager.py`)
- Monitoring endpoints → Prometheus metrics: exposes metrics (evidence: `README.md`)
- Prometheus scraper → Monitoring endpoints: scrapes (evidence: `README.md`)
- Celery connection → Celery broker: connects (evidence: `backend/app/core/celery_app.py`)
- Celery workers → Celery broker: communicate through (evidence: `README.md`)
- Theme interface → Theme endpoints: manages themes (evidence: `README.md`)
- Live app state → Live event socket: receives events (evidence: `README.md`)
