# ilhamrichie/public-issue-sentiment-dashboard architecture

> Architecture diagram of the GitHub repository ilhamrichie/public-issue-sentiment-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ilhamrichie/public-issue-sentiment-dashboard
- Repository: https://github.com/ilhamrichie/public-issue-sentiment-dashboard

## Overview

##### File structure
Top-level files & folders:
- app.py            – likely the main web/server entry point (Flask/FastAPI)
- checker.py        – sentiment analysis service
- crawler.py        – data ingestion component
- dashboard.py      – UI rendering or charting logic (could be integrated in app.py or separate)
- setup_ttl_index.py– database setup script (e.g., adding TTL indexes for time-based data retention)
- model_terbaik/    – pre-trained sentiment model & tokenizer artifacts
- requirements.txt  – list of Python dependencies
- .github/workflows – GitHub Actions that schedule crawler and checker runs
- .devcontainer      – development container configuration

##### README for additional insights
- The README only repeats the project name—there are no explicit architecture notes, so we must infer from code names, scripts, and CI workflows.

##### Elements
- Scheduler → Crawler
- Crawler → Database
- Scheduler → Checker
- Checker → Database
- Web App → Database
- Users → Web App
- Crawler/Checker → Model Store (read)
- Gray parallelogram for Model artifacts

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Scheduler
    Scheduler["Scheduler (GitHub Actions)"]:::scheduler

    %% External Source
    ExternalAPI["External Issue API"]:::external

    %% Ingestion Layer
    Crawler["Crawler Service\n(crawler.py)"]:::service

    %% Processing Layer
    Checker["Sentiment Checker Service\n(checker.py)"]:::service

    %% Storage Layer
    Database["Database\n(with TTL index)"]:::database

    %% Model Artifacts
    ModelStore["Model Store\n(model_terbaik)"]:::artifact

    %% Presentation Layer
    subgraph "Web Application"
        App["API Entry Point\n(app.py)"]:::service
        Dashboard["Dashboard Logic\n(dashboard.py)"]:::service
    end

    %% Users
    User["Users"]:::user

    %% Config & Dependencies
    DevContainer["Development Container\n(.devcontainer)"]:::config
    Dependencies["Python Dependencies\n(requirements.txt)"]:::config

    %% Data Flows
    Scheduler -->|"trigger crawler"| Crawler
    Crawler -->|"fetch issues"| ExternalAPI
    Crawler -->|"store raw data"| Database

    Scheduler -->|"trigger checker"| Checker
    Checker -->|"load raw issues"| Database
    Checker -->|"store sentiment results"| Database
    Checker -->|"load model artifacts"| ModelStore

    User -->|"view dashboard"| Dashboard
    Dashboard -->|"serve UI data"| Database
    Dashboard -->|"call API"| App
    App -->|"query data"| Database

    %% Click Events
    click Scheduler "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/.github/workflows/schedule_crawler.yml"
    click Scheduler "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/.github/workflows/schedule_checker.yml"
    click Crawler "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/crawler.py"
    click Checker "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/checker.py"
    click App "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/app.py"
    click Dashboard "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/dashboard.py"
    click Database "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/setup_ttl_index.py"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/config.json"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/model.safetensors"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/special_tokens_map.json"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/tokenizer.json"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/tokenizer_config.json"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/training_args.bin"
    click ModelStore "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/model_terbaik/vocab.txt"
    click DevContainer "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/.devcontainer/devcontainer.json"
    click Dependencies "https://github.com/ilhamrichie/public-issue-sentiment-dashboard/blob/main/requirements.txt"

    %% Styling
    classDef service fill:#FFA500,stroke:#333,stroke-width:1px
    classDef database fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef artifact fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef scheduler fill:#D8BFD8,stroke:#333,stroke-width:1px
    classDef user fill:#FFB6C1,stroke:#333,stroke-width:1px
    classDef config fill:#FFFACD,stroke:#333,stroke-width:1px
```
