# ianmuchina/hashflagarchive architecture

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

- Interactive diagram: https://gitdiagram.com/ianmuchina/hashflagarchive
- Repository: https://github.com/ianmuchina/hashflagarchive

## Overview

##### Main Components

a) Data Collection Layer
- GitHub Actions Workflow (Primary automation engine)
- Download Script Component
- Commit Script Component

b) Data Storage Layer
- JSON Data Storage
- Campaigns Storage
- Hashtags Storage
- Hashflags Storage
- Media Storage
- Video Assets (.mp4)
- JSON Assets (sakura files)

c) Version Control & CI/CD
- GitHub Repository
- GitHub Actions Integration

**┌─────────────────────────────────────────────┐**
- GitHub Actions                 │
- (Automated Data Collection)          │
- ┬─────────────────────────────┘

- ┌───────▼──────┐
- Scripts     │
- download.sh  │
- commit.sh   │
- ┬──────┘

- ┌───────▼──────────────────┐
- Data Storage         │
- ┌───┴────┐          ┌─────────┴───┐
- JSON  │          │   Media      │
- Files │          │   Assets     │
- ┘          └─────────────┘

##### Important Elements to Highlight

a) Automation Flow:
- How GitHub Actions triggers the workflow
- Execution path of download and commit scripts
- Data flow from collection to storage

b) Data Organization:
- Relationship between different JSON files
- How media assets are organized
- Demonstrate the storage hierarchy

##### Technical Details

- File formats: JSON, MP4
- Storage organization: data/ and img/ directories
- Automation schedule or triggers
- Data flow directions
- Script execution paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Automation Layer"
        GHA["GitHub Actions Workflow"]
        DS["Download Script"]
        CS["Commit Script"]
    end

    subgraph "Data Processing"
        MAIN["Main Application"]
        TMP["Temporary Storage"]
    end

    subgraph "Data Storage Layer"
        subgraph "JSON Storage"
            CAMP["Campaigns Data"]
            HASH["Hashtags Data"]
            FLAG["Hashflags Data"]
            UNK["Unknown Data"]
        end

        subgraph "Media Assets"
            VID["Video Assets (.mp4)"]
            SAK["Sakura JSON Files"]
        end
    end

    GHA --> DS
    DS --> MAIN
    MAIN --> TMP
    TMP --> CS
    CS --> |"Store Data"| CAMP
    CS --> |"Store Data"| HASH
    CS --> |"Store Data"| FLAG
    CS --> |"Store Data"| UNK
    CS --> |"Store Media"| VID
    CS --> |"Store Media"| SAK

    %% Click Events
    click GHA "https://github.com/ianmuchina/HashflagArchive/blob/main/.github/workflows/workflow.yml"
    click DS "https://github.com/ianmuchina/HashflagArchive/blob/main/scripts/download.sh"
    click CS "https://github.com/ianmuchina/HashflagArchive/blob/main/scripts/commit.sh"
    click CAMP "https://github.com/ianmuchina/HashflagArchive/blob/main/data/campaigns.json"
    click HASH "https://github.com/ianmuchina/HashflagArchive/blob/main/data/hashtags.json"
    click FLAG "https://github.com/ianmuchina/HashflagArchive/blob/main/data/hashflags.json"
    click UNK "https://github.com/ianmuchina/HashflagArchive/blob/main/data/unknown.json"
    click VID "https://github.com/ianmuchina/HashflagArchive/tree/main/img"
    click SAK "https://github.com/ianmuchina/HashflagArchive/tree/main/img"
    click TMP "https://github.com/ianmuchina/HashflagArchive/tree/main/tmp"
    click MAIN "https://github.com/ianmuchina/HashflagArchive/blob/main/main.ts"

    %% Styling
    classDef automation fill:#b3e0ff,stroke:#0066cc
    classDef script fill:#ffd9b3,stroke:#ff8000
    classDef storage fill:#d9f2d9,stroke:#339933
    classDef temp fill:#f2f2f2,stroke:#808080
    classDef main fill:#ffb3b3,stroke:#cc0000

    class GHA automation
    class DS,CS script
    class CAMP,HASH,FLAG,UNK,VID,SAK storage
    class TMP temp
    class MAIN main
```
