# moh-sagor/github-updater architecture

> Architecture diagram of the GitHub repository moh-sagor/github-updater, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moh-sagor/github-updater
- Repository: https://github.com/moh-sagor/github-updater

## Overview

GithubUpdater is a Laravel package that pulls a configured GitHub repository and then runs configured Artisan tasks, through either a web route or an Artisan command. The web controller streams output to a terminal-style response; the CLI command reports output to the console. Configuration is merged by the service provider and read by both execution paths. The README also describes authentication tokens and chained tasks; source excerpts confirm configuration-driven command execution, but do not establish additional deployment stages beyond those shown.

Main entry points: [`src/Commands/GithubPullCommand.php`](https://github.com/moh-sagor/github-updater/blob/main/src/Commands/GithubPullCommand.php) (Pull command), [`src/Controllers/GithubController.php`](https://github.com/moh-sagor/github-updater/blob/main/src/Controllers/GithubController.php) (Web updater), [`src/Providers/GithubUpdaterServiceProvider.php`](https://github.com/moh-sagor/github-updater/blob/main/src/Providers/GithubUpdaterServiceProvider.php) (Service provider), [`src/Routes/web.php`](https://github.com/moh-sagor/github-updater/blob/main/src/Routes/web.php) (Pull route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Laravel Setup"]
  node_provider["Service provider"]
  node_config["Updater config<br/>[github-updater.php]"]
  node_process["Symfony Process"]
end

subgraph group_webflow["Web Deployment"]
  node_web_route["Pull route<br/>[web.php]"]
  node_web_controller["Web updater"]
  node_web_terminal["Streamed terminal"]
end

subgraph group_cliflow["CLI Deployment"]
  node_cli_command["Pull command"]
  node_cli_output["Console output"]
end

node_web_user(("Web user"))
node_cli_user(("CLI operator"))
node_github(("GitHub repository"))
node_artisan_tasks["Artisan tasks"]

node_provider -->|"merges config"| node_config
node_provider -->|"loads routes"| node_web_route
node_provider -->|"registers command"| node_cli_command
node_web_user -->|"requests pull"| node_web_route
node_web_route -->|"dispatches"| node_web_controller
node_web_controller -->|"reads settings"| node_config
node_web_controller -->|"runs commands"| node_process
node_process -->|"pulls repository"| node_github
node_process -->|"runs tasks"| node_artisan_tasks
node_web_controller -->|"streams output"| node_web_terminal
node_cli_user -->|"invokes command"| node_cli_command
node_cli_command -->|"reads settings"| node_config
node_cli_command -->|"runs commands"| node_process
node_cli_command -->|"reports output"| node_cli_output
node_process -->|"pulls repository"| node_github
node_process -->|"runs tasks"| node_artisan_tasks

click node_provider "https://github.com/moh-sagor/github-updater/blob/main/src/Providers/GithubUpdaterServiceProvider.php"
click node_config "https://github.com/moh-sagor/github-updater/blob/main/config/github-updater.php"
click node_web_route "https://github.com/moh-sagor/github-updater/blob/main/src/Routes/web.php"
click node_web_controller "https://github.com/moh-sagor/github-updater/blob/main/src/Controllers/GithubController.php"
click node_web_terminal "https://github.com/moh-sagor/github-updater/blob/main/src/Controllers/GithubController.php"
click node_cli_command "https://github.com/moh-sagor/github-updater/blob/main/src/Commands/GithubPullCommand.php"
click node_cli_output "https://github.com/moh-sagor/github-updater/blob/main/src/Commands/GithubPullCommand.php"

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_provider,node_config,node_process,node_web_user toneBlue
class node_web_route,node_web_controller,node_web_terminal toneAmber
class node_cli_command,node_cli_output toneMint
class node_cli_user,node_github toneIndigo
class node_artisan_tasks toneRose
```

## Components

### Laravel Setup

- [Service provider](https://github.com/moh-sagor/github-updater/blob/main/src/Providers/GithubUpdaterServiceProvider.php): `src/Providers/GithubUpdaterServiceProvider.php`
- [Updater config](https://github.com/moh-sagor/github-updater/blob/main/config/github-updater.php): `config/github-updater.php`
- **Symfony Process**

### Web Deployment

- [Pull route](https://github.com/moh-sagor/github-updater/blob/main/src/Routes/web.php): `src/Routes/web.php`
- [Web updater](https://github.com/moh-sagor/github-updater/blob/main/src/Controllers/GithubController.php): `src/Controllers/GithubController.php`
- [Streamed terminal](https://github.com/moh-sagor/github-updater/blob/main/src/Controllers/GithubController.php): `src/Controllers/GithubController.php`

### CLI Deployment

- [Pull command](https://github.com/moh-sagor/github-updater/blob/main/src/Commands/GithubPullCommand.php): `src/Commands/GithubPullCommand.php`
- [Console output](https://github.com/moh-sagor/github-updater/blob/main/src/Commands/GithubPullCommand.php): `src/Commands/GithubPullCommand.php`

### Other components

- **Web user**
- **CLI operator**
- **GitHub repository**
- **Artisan tasks**

## Connections

- Service provider → Updater config: merges config
- Service provider → Pull route: loads routes
- Service provider → Pull command: registers command
- Web user → Pull route: requests pull
- Pull route → Web updater: dispatches
- Web updater → Updater config: reads settings
- Web updater → Symfony Process: runs commands
- Symfony Process → GitHub repository: pulls repository
- Symfony Process → Artisan tasks: runs tasks
- Web updater → Streamed terminal: streams output
- CLI operator → Pull command: invokes command
- Pull command → Updater config: reads settings
- Pull command → Symfony Process: runs commands
- Pull command → Console output: reports output
- Symfony Process → GitHub repository: pulls repository
- Symfony Process → Artisan tasks: runs tasks
