# arshaad-deriv/bumble-bee architecture

> Architecture diagram of the GitHub repository arshaad-deriv/bumble-bee, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arshaad-deriv/bumble-bee
- Repository: https://github.com/arshaad-deriv/bumble-bee

## Overview

##### Project Type and Purpose
- From the presence of app.py, pages/, requirements.txt and no separate “frontend” build, this is a single-process Python web app (e.g., Streamlit).
- The pages folder (1_Static_Components.py, 2_CMS_Collection_Items.py, etc.) suggests a multipage UI.
- The README hints at “translation,” so an external translation API or service is likely involved.

##### Main Components
a. User (Web Browser)
b. Python Web Framework (Streamlit or equivalent)
c. App Controller (app.py)
d. Page Modules (pages/1_… through pages/4_…)
e. Static Components Module (ols_static_comp.py)
f. CMS Collection Script (2_CMS_Collection_Items.py and its old copy)
g. Utility Library (utils.py)
h. External Translation Service (e.g., Google Translate API or similar)
i. Dev Container Configuration (.devcontainer/devcontainer.json)

##### Relationships and Data Flows
- The User interacts via HTTP/HTTPS with the Web Framework.
- The framework invokes app.py as the entrypoint.
- app.py dynamically loads one of the page modules under pages/ based on user selection.
- Each page module may call into ols_static_comp.py (for shared UI components), into CMS scripts (for fetching collection items), or into utils.py (for helper functions such as data transformation or API calls).
- When translation is needed, utils.py or a page module makes REST calls to the external Translation Service.
- Configuration files (requirements.txt, .devcontainer/devcontainer.json) inform developers about environment setup but are not in the runtime data flow.

##### Architectural Patterns and Design Principles
- Modular “controller + view” style: app.py routes to page modules (views).
- Shared “model” or “library” in utils.py and ols_static_comp.py for business logic and UI components.
- Clear separation of concerns: pages focus on layout/content, utils on functionality, external service for translation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Framework
    User["Web Browser"]:::external
    FW["Streamlit Framework"]:::internal

    %% App Controller
    App["App Controller (app.py)"]:::internal

    %% Pages Subgraph
    subgraph "Pages"
        P1["1_Static_Components.py"]:::internal
        P2["2_CMS_Collection_Items.py"]:::internal
        P3["3_Glossary.py"]:::internal
        P4["4_Static_Components_Properties.py"]:::internal
    end

    %% Shared Modules
    Static["ols_static_comp.py"]:::internal
    CMS["2_CMS_Collection_Items copy_old_stable.py"]:::internal
    Utils["utils.py"]:::internal

    %% External Service
    Trans[(Translation Service)]:::external

    %% Configuration
    Config1[".devcontainer/devcontainer.json"]:::config
    Config2["requirements.txt"]:::config
    Config3["README.md"]:::config

    %% Data Flows
    User -->|"HTTP request"| FW
    FW -->|"invoke entrypoint"| App
    App -->|"load page module"| P1
    App -->|"load page module"| P2
    App -->|"load page module"| P3
    App -->|"load page module"| P4
    P1 -->|"use components"| Static
    P2 -->|"use CMS script"| CMS
    P3 -->|"helper functions"| Utils
    P4 -->|"helper functions"| Utils
    P1 -->|"helper functions"| Utils
    P2 -->|"helper functions"| Utils
    Utils -->|"REST API call"| Trans
    Trans -->|"translation response"| Utils

    %% Click Events
    click App "https://github.com/arshaad-deriv/bumble-bee/blob/main/app.py"
    click P1 "https://github.com/arshaad-deriv/bumble-bee/blob/main/pages/1_Static_Components.py"
    click P2 "https://github.com/arshaad-deriv/bumble-bee/blob/main/pages/2_CMS_Collection_Items.py"
    click P3 "https://github.com/arshaad-deriv/bumble-bee/blob/main/pages/3_Glossary.py"
    click P4 "https://github.com/arshaad-deriv/bumble-bee/blob/main/pages/4_Static_Components_Properties.py"
    click Static "https://github.com/arshaad-deriv/bumble-bee/blob/main/ols_static_comp.py"
    click CMS "https://github.com/arshaad-deriv/bumble-bee/blob/main/2_CMS_Collection_Items copy_old_stable.py"
    click Utils "https://github.com/arshaad-deriv/bumble-bee/blob/main/utils.py"
    click Config1 "https://github.com/arshaad-deriv/bumble-bee/blob/main/.devcontainer/devcontainer.json"
    click Config2 "https://github.com/arshaad-deriv/bumble-bee/blob/main/requirements.txt"
    click Config3 "https://github.com/arshaad-deriv/bumble-bee/blob/main/README.md"

    %% Styles
    classDef internal fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
    classDef external fill:#ABEBC6,stroke:#196F3D,color:#1B2631
    classDef config fill:#E5E7E9,stroke:#424949,color:#1B2631
```
