# shivamiri/youtube-linktree-php architecture

> Architecture diagram of the GitHub repository shivamiri/youtube-linktree-php, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shivamiri/youtube-linktree-php
- Repository: https://github.com/shivamiri/youtube-linktree-php

## Overview

YouTube Linktree PHP serves a public creator profile and video-link page, managed through an authenticated admin panel. Visitors see channel details and active videos; administrators sign in to manage video links, reorder or hide them, update channel settings, and change credentials. The README documents automatic YouTube title and logo fetching, manual logo upload or URL fallback, and optional analytics. The graph reflects sampled entry points and helpers; some integrations are documented but their complete implementations were not sampled.

Main entry points: [`admin/setting.php`](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/setting.php) (Channel and Security Settings), [`index.php`](https://github.com/shivamiri/youtube-linktree-php/blob/main/index.php) (Profile and Videos), [`admin/index.php`](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/index.php) (Video Management), [`database.sql`](https://github.com/shivamiri/youtube-linktree-php/blob/main/database.sql) (MySQL Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Link Page"]
  node_public_page["Profile and Videos<br/>[index.php]"]
  node_public_shell["Public Layout<br/>[header.php]"]
  node_public_footer["Public Footer<br/>[bottom.php]"]
end

subgraph group_admin["Admin Panel"]
  node_login["Admin Login<br/>[login.php]"]
  node_video_manager["Video Management<br/>[index.php]"]
  node_settings_manager["Channel and Security Settings<br/>[setting.php]"]
  node_admin_shell["Admin Layout<br/>[header.php]"]
  node_admin_footer["Admin Footer<br/>[bottom.php]"]
end

subgraph group_core["Shared Runtime"]
  node_runtime_helpers["Session and Helpers<br/>[config.sample.php]"]
end

subgraph group_state["Persistent State"]
  node_upload_storage["Uploaded Images<br/>[.htaccess]"]
  node_database[("MySQL Data<br/>[database.sql]")]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))
node_youtube{{"YouTube"}}
node_analytics{{"Google Analytics"}}

node_visitor -->|"opens page"| node_public_page
node_public_page -->|"reads active videos"| node_database
node_public_page -.->|"reads profile"| node_database
node_public_page -->|"includes layout"| node_public_shell
node_public_page -->|"includes footer"| node_public_footer
node_public_page -->|"links videos"| node_youtube
node_public_shell -.->|"loads optionally"| node_analytics
node_administrator -->|"signs in"| node_login
node_login -->|"checks credentials"| node_database
node_login -->|"uses session helpers"| node_runtime_helpers
node_login -->|"includes layout"| node_admin_shell
node_login -->|"includes footer"| node_admin_footer
node_administrator -->|"manages links"| node_video_manager
node_video_manager -->|"manages video rows"| node_database
node_video_manager -.->|"fetches titles"| node_youtube
node_video_manager -->|"uses session helpers"| node_runtime_helpers
node_video_manager -->|"includes layout"| node_admin_shell
node_video_manager -.->|"includes footer"| node_admin_footer
node_administrator -->|"updates settings"| node_settings_manager
node_settings_manager -->|"updates credentials and profile"| node_database
node_settings_manager -->|"uses settings and upload helpers"| node_runtime_helpers
node_settings_manager -.->|"stores logo"| node_upload_storage
node_settings_manager -.->|"fetches channel logo"| node_youtube
node_settings_manager -.->|"includes layout"| node_admin_shell
node_settings_manager -.->|"includes footer"| node_admin_footer
node_runtime_helpers -->|"connects and reads settings"| node_database

click node_public_page "https://github.com/shivamiri/youtube-linktree-php/blob/main/index.php"
click node_public_shell "https://github.com/shivamiri/youtube-linktree-php/blob/main/common/header.php"
click node_public_footer "https://github.com/shivamiri/youtube-linktree-php/blob/main/common/bottom.php"
click node_login "https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/login.php"
click node_video_manager "https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/index.php"
click node_settings_manager "https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/setting.php"
click node_admin_shell "https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/common/header.php"
click node_admin_footer "https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/common/bottom.php"
click node_runtime_helpers "https://github.com/shivamiri/youtube-linktree-php/blob/main/config.sample.php"
click node_upload_storage "https://github.com/shivamiri/youtube-linktree-php/blob/main/upload/.htaccess"
click node_database "https://github.com/shivamiri/youtube-linktree-php/blob/main/database.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_page,node_public_shell,node_public_footer toneBlue
class node_login,node_video_manager,node_settings_manager,node_admin_shell,node_admin_footer toneAmber
class node_runtime_helpers toneMint
class node_upload_storage,node_database toneRose
class node_visitor,node_administrator,node_youtube,node_analytics toneIndigo
```

## Components

### Public Link Page

- [Profile and Videos](https://github.com/shivamiri/youtube-linktree-php/blob/main/index.php): `index.php`
- [Public Layout](https://github.com/shivamiri/youtube-linktree-php/blob/main/common/header.php): `common/header.php`
- [Public Footer](https://github.com/shivamiri/youtube-linktree-php/blob/main/common/bottom.php): `common/bottom.php`

### Admin Panel

- [Admin Login](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/login.php): `admin/login.php`
- [Video Management](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/index.php): `admin/index.php`
- [Channel and Security Settings](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/setting.php): `admin/setting.php`
- [Admin Layout](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/common/header.php): `admin/common/header.php`
- [Admin Footer](https://github.com/shivamiri/youtube-linktree-php/blob/main/admin/common/bottom.php): `admin/common/bottom.php`

### Shared Runtime

- [Session and Helpers](https://github.com/shivamiri/youtube-linktree-php/blob/main/config.sample.php): `config.sample.php`

### Persistent State

- [Uploaded Images](https://github.com/shivamiri/youtube-linktree-php/blob/main/upload/.htaccess): `upload/.htaccess`
- [MySQL Data](https://github.com/shivamiri/youtube-linktree-php/blob/main/database.sql): `database.sql`

### Other components

- **Visitor**
- **Administrator**
- **YouTube**
- **Google Analytics**

## Connections

- Visitor → Profile and Videos: opens page (evidence: `README.md`)
- Profile and Videos → MySQL Data: reads active videos (evidence: `index.php`)
- Profile and Videos → MySQL Data: reads profile
- Profile and Videos → Public Layout: includes layout (evidence: `index.php`)
- Profile and Videos → Public Footer: includes footer (evidence: `index.php`)
- Profile and Videos → YouTube: links videos (evidence: `index.php`)
- Public Layout → Google Analytics: loads optionally (evidence: `common/header.php`)
- Administrator → Admin Login: signs in (evidence: `README.md`)
- Admin Login → MySQL Data: checks credentials (evidence: `admin/login.php`)
- Admin Login → Session and Helpers: uses session helpers (evidence: `admin/login.php`)
- Admin Login → Admin Layout: includes layout (evidence: `admin/login.php`)
- Admin Login → Admin Footer: includes footer (evidence: `admin/login.php`)
- Administrator → Video Management: manages links (evidence: `README.md`)
- Video Management → MySQL Data: manages video rows (evidence: `admin/index.php`)
- Video Management → YouTube: fetches titles (evidence: `README.md`)
- Video Management → Session and Helpers: uses session helpers (evidence: `admin/index.php`)
- Video Management → Admin Layout: includes layout (evidence: `admin/index.php`)
- Video Management → Admin Footer: includes footer (evidence: `admin/index.php`)
- Administrator → Channel and Security Settings: updates settings (evidence: `README.md`)
- Channel and Security Settings → MySQL Data: updates credentials and profile (evidence: `admin/setting.php`)
- Channel and Security Settings → Session and Helpers: uses settings and upload helpers (evidence: `admin/setting.php`)
- Channel and Security Settings → Uploaded Images: stores logo (evidence: `README.md`)
- Channel and Security Settings → YouTube: fetches channel logo (evidence: `README.md`)
- Channel and Security Settings → Admin Layout: includes layout (evidence: `admin/setting.php`)
- Channel and Security Settings → Admin Footer: includes footer (evidence: `admin/setting.php`)
- Session and Helpers → MySQL Data: connects and reads settings (evidence: `config.sample.php`)
