# tsheylock/awesome-testflight-link architecture

> Architecture diagram of the GitHub repository tsheylock/awesome-testflight-link, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tsheylock/awesome-testflight-link
- Repository: https://github.com/tsheylock/awesome-testflight-link

## Overview

##### Project type and purpose
- This is an open-source data-curation tool that collects and maintains a public TestFlight app URL list in Markdown.
- The repository stores a SQLite database, Python scripts to manipulate that DB, and GitHub Actions workflows that automate adding, deleting, sorting, and updating link status.

##### File structure
- Top‐level “db” folder holds sqlite3.db (the data store).
- “scripts” directory contains Python programs (add_link.py, del_link.py, order_status.py, update_status.py, init_database.py) and a data subfolder for template content.
- “.github/workflows” defines CI pipelines (add_link.yml, del_link.yml, order_status.yml, update_status.yml).
- README.md is the presentation layer (the generated list), while GITHUB_ACTION.md documents the workflows.

##### README for insights
- It describes GitHub Actions usage, available status codes, and the static Markdown lists.
- There is no separate frontend or backend; the Markdown is generated/updated by scripts.

a. Main components
- GitHub Repository (boundary)
- SQLite Database (db/sqlite3.db)
- Python Scripts (scripts/*.py)
- GitHub Actions Service (CI runners)
- Markdown Output (README.md)
- Developer / Issue Creator (GitHub Issues / CLI)
b. Relationships & data flow
- Developer opens an Issue or manually triggers a workflow → GitHub Actions runner spins up.
- Actions run Python scripts against sqlite3.db (e.g., add_link.py writes new entries, update_status.py refreshes availability flags).
- Scripts update the database and regenerate the Markdown table in README.md.
- Workflow commits and pushes updated README.md back to the repository.
c. Architectural patterns & principles
- Event‐driven automation: workflows respond to issue comments or schedule triggers.
- Single source of truth: sqlite3.db stores all link records, while scripts handle transformation.
- Separation of concerns: data storage (DB), processing (scripts), automation/orchestration (GitHub Actions), and presentation (Markdown).
d. Key technologies
- SQLite for lightweight local data store
- Python for business logic
- GitHub Actions for CI/CD orchestration
- Markdown for output

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors
    Dev["Developer / Issue Creator"]:::actor

    %% GitHub Actions
    Dev -->|"triggers"| ActionsCloud["GitHub Actions Runner"]:::actions

    subgraph "GitHub Actions Workflows"
        direction TB
        AddWF["add_link.yml"]:::actions
        DelWF["del_link.yml"]:::actions
        OrderWF["order_status.yml"]:::actions
        UpdateWF["update_status.yml"]:::actions
    end

    ActionsCloud --> AddWF
    ActionsCloud --> DelWF
    ActionsCloud --> OrderWF
    ActionsCloud --> UpdateWF

    %% Python Scripts
    subgraph "Python Scripts"
        direction TB
        InitScript["init_database.py"]:::scripts
        AddScript["add_link.py"]:::scripts
        DelScript["del_link.py"]:::scripts
        OrderScript["order_status.py"]:::scripts
        UpdateScript["update_status.py"]:::scripts
        Requirements["requirements.txt"]:::scripts
    end

    AddWF -->|"runs"| AddScript
    DelWF -->|"runs"| DelScript
    OrderWF -->|"runs"| OrderScript
    UpdateWF -->|"runs"| UpdateScript

    %% Data Templates
    subgraph "Data Templates" 
        direction TB
        Template["README.template"]:::scripts
        IOS["ios.md"]:::scripts
        IOSGame["ios_game.md"]:::scripts
        MacOS["macos.md"]:::scripts
        Chinese["chinese.md"]:::scripts
        Signup["signup.md"]:::scripts
    end

    %% Database and Output
    AddScript -->|"writes/reads"| DB["SQLite DB"]:::db
    DelScript -->|"writes/reads"| DB
    OrderScript -->|"reads/writes"| DB
    UpdateScript -->|"reads/writes"| DB
    InitScript -->|"creates"| DB

    AddScript -->|"generates"| README["README.md"]:::doc
    DelScript -->|"generates"| README
    OrderScript -->|"generates"| README
    UpdateScript -->|"generates"| README

    ActionsCloud -->|"commits & pushes"| README

    %% Documentation
    Doc["GITHUB_ACTION.md"]:::doc

    ActionsCloud -->|"references"| Doc

    %% Click Events
    click DB "https://github.com/tsheylock/awesome-testflight-link/blob/main/db/sqlite3.db"
    click AddScript "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/add_link.py"
    click DelScript "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/del_link.py"
    click InitScript "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/init_database.py"
    click OrderScript "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/order_status.py"
    click UpdateScript "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/update_status.py"
    click Requirements "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/requirements.txt"
    click Template "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/README.template"
    click IOS "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/ios.md"
    click IOSGame "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/ios_game.md"
    click MacOS "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/macos.md"
    click Chinese "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/chinese.md"
    click Signup "https://github.com/tsheylock/awesome-testflight-link/blob/main/scripts/data/signup.md"
    click AddWF "https://github.com/tsheylock/awesome-testflight-link/blob/main/.github/workflows/add_link.yml"
    click DelWF "https://github.com/tsheylock/awesome-testflight-link/blob/main/.github/workflows/del_link.yml"
    click OrderWF "https://github.com/tsheylock/awesome-testflight-link/blob/main/.github/workflows/order_status.yml"
    click UpdateWF "https://github.com/tsheylock/awesome-testflight-link/blob/main/.github/workflows/update_status.yml"
    click Doc "https://github.com/tsheylock/awesome-testflight-link/blob/main/GITHUB_ACTION.md"
    click README "https://github.com/tsheylock/awesome-testflight-link/blob/main/README.md"

    %% Styles
    classDef db fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef scripts fill:#98FB98,stroke:#000,stroke-width:1px
    classDef actions fill:#FFA500,stroke:#000,stroke-width:1px
    classDef doc fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef actor fill:#CCCCCC,stroke:#000,stroke-width:1px
```
