# otniel113/vn-producer-influencer architecture

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

- Interactive diagram: https://gitdiagram.com/otniel113/vn-producer-influencer
- Repository: https://github.com/otniel113/vn-producer-influencer

## Overview

##### Project type and purpose
- This is a data‐analysis/research project implemented as a single Jupyter notebook (`VN_Producer_Influencer.ipynb`).

##### File structure
- Top level:
- `README.md` – project description, data source, results, and links
- `VN_Producer_Influencer.ipynb` – the entire data‐processing and visualization pipeline in one notebook
- No separate `src/`, `backend/`, or `frontend/` folders—this is a self‐contained analysis.

##### README for additional insights
- Data flow: SQL query → CSV/DataFrame → networkx graph → centrality metrics → matplotlib/static image and interactive web visualization
- External services: VNDB (data source), GitHub Pages (hosts the interactive viz)

##### Main components and their interactions
a. Data Source
- VNDB query endpoint (external SQL service)
- Outputs raw table of producer relations

b. Data Ingestion & Preprocessing
- Jupyter Notebook using Python libraries (pandas for dataframes)
- Cleans and transforms raw SQL output into edge list

c. Graph Construction & Computation
- networkx builds an undirected, unweighted graph
- Centrality functions compute Degree, Betweenness, Eigenvector

d. Visualization & Reporting
- matplotlib/seaborn (static graphs, tables)
- Exports: PNG plot embedded in notebook and README
- Interactive visualization: JavaScript based graph (e.g., D3.js or vis.js) deployed on GitHub Pages

e. Hosting & Presentation
- GitHub repository (code and README)
- GitHub Pages serves interactive HTML/JS

##### Architectural patterns & design principles
- Single‐source notebook for reproducibility
- Separation of concerns via Python libraries for data vs. graph vs. viz
- Optional deployment of static interactive visualization

## Diagram (Mermaid)

```mermaid
flowchart TD
    VNDB["VNDB (SQL Query Endpoint)"]:::data

    subgraph "Notebook Processing"
        DataIngestion["pandas.read_sql() → DataFrame"]:::processing
        GraphCompute["networkx.Graph() & centrality computations"]:::processing
        StaticViz["matplotlib/seaborn → PNG in Notebook"]:::viz
    end

    InteractiveViz["D3.js/vis.js → HTML on GitHub Pages"]:::viz
    README["README.md (Documentation & PNG links)"]:::doc
    GitHubRepo["GitHub Repository"]:::external
    GitHubPages["GitHub Pages (Interactive Viz Host)"]:::external

    VNDB -->|".sql → table"| DataIngestion
    DataIngestion -->|"edge list"| GraphCompute
    GraphCompute -->|"plots/tables"| StaticViz
    GraphCompute -->|".html export"| InteractiveViz
    StaticViz -->|".png refs"| README
    README -->|"code & docs"| GitHubRepo
    InteractiveViz -->|"hosted output"| GitHubPages

    click DataIngestion "https://github.com/otniel113/vn-producer-influencer/blob/main/VN_Producer_Influencer.ipynb"
    click GraphCompute "https://github.com/otniel113/vn-producer-influencer/blob/main/VN_Producer_Influencer.ipynb"
    click StaticViz "https://github.com/otniel113/vn-producer-influencer/blob/main/VN_Producer_Influencer.ipynb"
    click README "https://github.com/otniel113/vn-producer-influencer/blob/main/README.md"
    click InteractiveViz "https://github.com/otniel113/vn-producer-influencer/blob/main/README.md"

    classDef data fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef processing fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef viz fill:#FFA500,stroke:#333,stroke-width:1px;
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px;
    classDef doc fill:#FFE4B5,stroke:#333,stroke-width:1px;
```
