# dayanch96/ytlite architecture

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

- Interactive diagram: https://gitdiagram.com/dayanch96/ytlite
- Repository: https://github.com/dayanch96/ytlite

## Overview

##### Project Overview and Purpose
- This project is an iOS application tweak that enhances the YouTube app with customizable options (e.g., video/audio downloads, interface tweaks, custom player settings, SponsorBlock, and more).
- It integrates with several external tweaks like YouPiP, YTUHD, Return YouTube Dislikes, YouQuality, and DontEatMyContent to extend native functionalities.
- The project is organized as a source code repository with CI/CD (via GitHub Actions), build configuration files (Makefile, Xcode project files such as *.x, *.plist), resource bundles (images and localization files), and packaged outputs (.deb files).

##### Analyzing the File Structure to Identify Key Components
- .github Directory: Contains workflow configurations (GitHub Actions) that trigger build processes for both regular and beta builds. This is the CI/CD branch of the architecture.
- Makefile and Xcode Project Files (e.g., YTLite.x, Sideloading.x, YTNativeShare.x): Represent the build and project configuration layer that orchestrates how source code is compiled and packaged.
- Utils Directory: Contains utility classes (NSBundle+YTLite, Reachability, YTLUserDefaults) that provide core functionality used across the application.
- layout Directory: Holds the bundled resources for the application including localization files (various Localizable.strings for multiple languages) and asset bundles; these files are essential for the UI and in-app customizations.
- Resources Directory: Provides images (screenshots) used in the application’s documentation and likely within the app itself.
- packages Directory: Contains the final output packages (.deb files) for different architectures and versions which are the deliverables for installation on iOS devices.

##### Components and Their Relationships
- Source Code and Build Configuration: Xcode projects, Makefile, and project configuration files such as YTLite.plist and YTLite.x form the core codebase. They also integrate with Helpers found in Utils.
- CI/CD Pipelines: GitHub Actions workflows manage the build process. They receive triggers when code is pushed or when a manual build is initiated. Two main workflows exist: one for the standard app build and one for beta testing that allows tweak integration from an external source (via IPA file upload and tweak URL input).
- Packaging Process: The CI/CD system uses the build configuration to produce .deb packages, which are stored in the packages directory ready for deployment.
- Resources and Localization: The layout folder’s Application Support bundle and nested localizations provide UI/UX elements that help in customizing the app interface. This is directly utilized by the iOS runtime.
- Tweak Integration: The README details several tweak integration points (YouPiP, YTUHD, etc.) which are conceptually separate modules. They are integrated during the build process based on user selections in the workflow, influencing build parameters (e.g., bundle IDs, display names) and including/excluding respective feature modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI/CD Pipeline
    ci_cd["CI/CD Pipeline"]:::cicd

    %% Build & Project Configuration Subgraph
    subgraph "Build & Project Configuration"
      direction TB
      a1["Makefile"]:::core
      a2["YTLite.x"]:::core
      a3["Sideloading.x"]:::core
      a4["YTNativeShare.x"]:::core
      a5["YTLite.plist"]:::core
    end

    %% Utilities Layer
    utils["Utilities Layer"]:::utils

    %% Resource Bundles & Localization
    resources["Resource Bundles & Localization"]:::resources

    %% Tweak Integration Modules
    tweaks["Tweak Integration Modules"]:::tweaks

    %% Package Output
    packages["Package Output"]:::packages

    %% External Tweak Integrations Subgraph
    subgraph "Tweak Integrations (External)"
      direction TB
      e1["YouPiP"]:::external
      e2["YTUHD"]:::external
      e3["Return_YouTube_Dislikes"]:::external
      e4["YouQuality"]:::external
      e5["DontEatMyContent"]:::external
    end

    %% Relationships
    ci_cd -->|"triggers_build"| a1
    resources -->|"supplies_resources"| a1
    tweaks -->|"integrates_optional"| a1
    a1 -->|"produces_package"| packages
    a2 -->|"includes_utilities"| utils

    %% External tweaks integration into Tweak Integration Modules
    e1 --> tweaks
    e2 --> tweaks
    e3 --> tweaks
    e4 --> tweaks
    e5 --> tweaks

    %% Click Events
    click ci_cd "https://github.com/dayanch96/ytlite/tree/main/.github/workflows"
    click a1 "https://github.com/dayanch96/ytlite/tree/main/Makefile"
    click a2 "https://github.com/dayanch96/ytlite/blob/main/YTLite.x"
    click a3 "https://github.com/dayanch96/ytlite/blob/main/Sideloading.x"
    click a4 "https://github.com/dayanch96/ytlite/blob/main/YTNativeShare.x"
    click a5 "https://github.com/dayanch96/ytlite/blob/main/YTLite.plist"
    click utils "https://github.com/dayanch96/ytlite/tree/main/Utils"
    click resources "https://github.com/dayanch96/ytlite/blob/main/layout/Library/Application Support/YTLite.bundle"
    click packages "https://github.com/dayanch96/ytlite/tree/main/packages"

    %% Styles
    classDef core fill:#aec6cf,stroke:#000,stroke-width:1px;
    classDef resources fill:#90ee90,stroke:#000,stroke-width:1px;
    classDef utils fill:#ffa500,stroke:#000,stroke-width:1px;
    classDef cicd fill:#ffff99,stroke:#000,stroke-width:1px;
    classDef packages fill:#ffff99,stroke:#000,stroke-width:1px;
    classDef tweaks fill:#ffccff,stroke:#000,stroke-width:1px;
    classDef external fill:#d3d3d3,stroke:#000,stroke-width:1px;
```
