# ajshooting/vtuber-palette architecture

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

- Interactive diagram: https://gitdiagram.com/ajshooting/vtuber-palette
- Repository: https://github.com/ajshooting/vtuber-palette

## Overview

##### Main Components
- Frontend/UI:
- Assets: index.html, search.html, search.js, app.js.
- Auto-Update Module:
- Contains: Python scripts located in auto-update/ (with subdirectories for “seesaawiki.jp”, “vtuberinfo.net”, “wikiwiki.jp” etc.).
- Data Store:
- Assets: CSV files in “colordict” (each representing different VTuber agencies or groups) and “source.csv”.
- Purpose: Provide the core dataset that is used by the frontend to generate the visuals.
- Deployment & CI/CD:
- Contains: GitHub workflows (in .github/workflows) that may automatically trigger and run the auto-update scripts.
- Purpose: Automate periodic data fetching and ensure updated CSV files are committed/published.

##### Relationships & Interactions
- The auto-update module runs independently (likely on a schedule defined in the GitHub workflows) to scrape external VTuber information and update the CSV data in “colordict” and “source.csv.”
- The CI/CD pipeline (GitHub workflows) coordinates the scraping and updating process so that the front-end displays the latest information.
- Data flows from external websites → auto-update scrapers → CSV Data Store → frontend visualization.

##### Architectural Patterns and Design Principles
- Separation of concerns: The project clearly separates the UI (static assets and JavaScript) from the data acquisition layer (Python-based scrapers).
- Scheduled/automated data ingestion: Use of GitHub workflows to trigger automated tasks.
- Data-driven visualization: The front-end is designed to be data-centric, reading parsed CSV files to produce dynamic representations.
- Modularity: Each scraping script in auto-update is responsible for a particular source, making it easier to maintain or extend if new VTuber sources need to be integrated.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Sources
    EX["External Websites"]:::external

    %% Deployment / CI-CD
    CD["GitHub Workflows"]:::deployment

    %% Auto-Update Module Subgraph
    subgraph "Auto-Update Module"
        direction TB
        AU0["auto-update"]:::autoupdate
        AU0 --> AU1["seesaawiki.jp Scraper"]:::autoupdate
        AU0 --> AU2["vtuberinfo.net Scraper"]:::autoupdate
        AU0 --> AU3["wikiwiki.jp Scraper"]:::autoupdate
        AU0 --> AU4["Memo Script"]:::autoupdate
    end

    %% Data Store Subgraph
    subgraph "Data Store"
        direction TB
        DS1["colordict (CSV Files)"]:::datastore
        DS2["source.csv"]:::datastore
    end

    %% Frontend/UI Subgraph
    subgraph "Frontend/UI"
        direction TB
        FE1["index.html"]:::frontend
        FE2["search.html"]:::frontend
        FE3["app.js"]:::frontend
        FE4["search.js"]:::frontend
    end

    %% Data Flow Connections
    EX -->|"feeds"| AU0
    CD -->|"triggers"| AU0
    AU0 -->|"updates"| DS1
    AU0 -->|"updates"| DS2
    DS1 -->|"readBy"| FE1
    DS1 -->|"readBy"| FE2
    DS1 -->|"readBy"| FE3
    DS1 -->|"readBy"| FE4

    %% Click Events for Frontend/UI
    click FE1 "https://github.com/ajshooting/vtuber-palette/blob/main/index.html"
    click FE2 "https://github.com/ajshooting/vtuber-palette/blob/main/search.html"
    click FE3 "https://github.com/ajshooting/vtuber-palette/blob/main/app.js"
    click FE4 "https://github.com/ajshooting/vtuber-palette/blob/main/search.js"

    %% Click Events for Auto-Update Module
    click AU0 "https://github.com/ajshooting/vtuber-palette/tree/main/auto-update/"
    click AU1 "https://github.com/ajshooting/vtuber-palette/blob/main/auto-update/seesaawiki.jp"
    click AU2 "https://github.com/ajshooting/vtuber-palette/blob/main/auto-update/vtuberinfo.net"
    click AU3 "https://github.com/ajshooting/vtuber-palette/blob/main/auto-update/wikiwiki.jp"
    click AU4 "https://github.com/ajshooting/vtuber-palette/blob/main/auto-update/scraping/memo.py"

    %% Click Events for Data Store
    click DS1 "https://github.com/ajshooting/vtuber-palette/tree/main/colordict/"
    click DS2 "https://github.com/ajshooting/vtuber-palette/blob/main/source.csv"

    %% Click Event for Deployment/CI-CD
    click CD "https://github.com/ajshooting/vtuber-palette/blob/main/.github/workflows/update_csv.yml"

    %% Styles
    classDef external fill:#FFECB3,stroke:#FF9800,stroke-width:2px;
    classDef autoupdate fill:#C8E6C9,stroke:#388E3C,stroke-width:2px;
    classDef datastore fill:#FFE0B2,stroke:#F57C00,stroke-width:2px;
    classDef frontend fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px;
    classDef deployment fill:#E1BEE7,stroke:#8E24AA,stroke-width:2px;
```
