# jlnetosci/st-social-media-links architecture

> Architecture diagram of the GitHub repository jlnetosci/st-social-media-links, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jlnetosci/st-social-media-links
- Repository: https://github.com/jlnetosci/st-social-media-links

## Overview

##### Project type and purpose
- This is an open-source Python package (a Streamlit “widget” library) called **st-social-media-links**.

##### File structure
- Top-level files:
– **setup.py** (packaging and installation)
– **README.md**, **CHANGELOG.md**, **LICENSE**, **.gitignore** (project metadata)
– **img/** (documentation screenshots)
- Package directory **st_social_media_links/**:
– **__init__.py** (package export)
– **st_social_media_links.py** (main implementation)

There are no separate frontend/backend folders—this is a single library that plugs into Streamlit at runtime.

##### Main components
a. **Client (Streamlit App)**
– User’s Python script or notebook that calls `SocialMediaIcons(...)`.
b. **st-social-media-links Library**
– Entry point: `SocialMediaIcons` class
– Render method that calls Streamlit APIs
c. **Streamlit Runtime**
– Streamlit’s server side (executes Python, serializes front-end commands)
d. **Font Awesome CDN or CSS**
e. **Browser**

##### Relationships and interactions
- **User Code → Library**: imports and instantiates `SocialMediaIcons`.
- **Library → Streamlit Server API**: library calls `st.markdown` or `components` to send HTML/CSS.
- **Streamlit Server → Streamlit Front-End**: transports component spec via WebSocket.
- **Front-End → Font Awesome**: browser fetches CSS/fonts from CDN.

##### Architectural patterns and principles
- **Extensibility**: new platforms can be added to the internal mapping.
- **Minimal Layers**: no database or separate microservice, just a thin integration layer.

##### Technologies and frameworks
- Python 3.x
- setuptools (setup.py)
- Streamlit (st.markdown or st.components API)

##### Essential detail to capture
- The two optional rendering modes (`sidebar`, `justify_content`).
- The fact that **no persistent storage** or backend service exists.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Flow
    UserCode["Client (Python Script)"]:::pythonComp
    SMIcons["SocialMediaIcons Class\n(supports sidebar & justify_content)"]:::pythonComp
    StreamServer["Streamlit Server"]:::runtime
    StreamFrontend["Streamlit Front-end (Browser UI)"]:::runtime
    Browser["Browser UI"]:::external
    FontAwesome["Font Awesome CDN"]:::external

    UserCode -->|"instantiates"| SMIcons
    SMIcons -->|"calls st.markdown / components API"| StreamServer
    StreamServer -->|"WebSocket"| StreamFrontend
    StreamFrontend -->|"renders HTML/CSS"| Browser
    Browser -->|"HTTP GET CSS/fonts"| FontAwesome

    %% Project Files Structure
    subgraph "Project Source Files"
        Setup["setup.py"]:::pythonComp
        Readme["README.md"]:::pythonComp
        Changelog["CHANGELOG.md"]:::pythonComp
        License["LICENSE"]:::pythonComp
        Img["img/"]:::external
        PackageInit["__init__.py"]:::pythonComp
        CoreImpl["st_social_media_links.py"]:::pythonComp
    end

    Setup --> PackageInit
    PackageInit --> CoreImpl

    %% Click Events
    click SMIcons "https://github.com/jlnetosci/st-social-media-links/blob/main/st_social_media_links/st_social_media_links.py"
    click PackageInit "https://github.com/jlnetosci/st-social-media-links/blob/main/st_social_media_links/__init__.py"
    click Setup "https://github.com/jlnetosci/st-social-media-links/blob/main/setup.py"
    click Readme "https://github.com/jlnetosci/st-social-media-links/blob/main/README.md"
    click Changelog "https://github.com/jlnetosci/st-social-media-links/blob/main/CHANGELOG.md"
    click License "https://github.com/jlnetosci/st-social-media-links/tree/main/LICENSE"
    click Img "https://github.com/jlnetosci/st-social-media-links/tree/main/img/"

    %% Styles
    classDef pythonComp fill:#add8e6,stroke:#000,stroke-width:1px
    classDef runtime fill:#fffacd,stroke:#000,stroke-width:1px
    classDef external fill:#98fb98,stroke:#000,stroke-width:1px
```
