# gangaiamaran/laracon-schedule architecture

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

- Interactive diagram: https://gitdiagram.com/gangaiamaran/laracon-schedule
- Repository: https://github.com/gangaiamaran/laracon-schedule

## Overview

##### File structure
Top-level directories and files:
- app/Commands – contains SchedulingCommand.php and bundled JSON data
- app/Providers – registers the command with the console kernel
- bootstrap/app.php – boots the console application, loads providers
- config/commands.php, config/app.php, config/filesystems.php – runtime configuration
- builds/ – example packaged outputs
- composer.json & composer.lock – external libraries (Laravel console components, timezone helpers)
- tests/ – Pest and PHPUnit tests for command behavior

##### README for additional insights
- Confirms PHP 8.0+ requirement
- Shows this is a globally installed Composer tool (“composer global require …”)
- No external services or databases—everything is self-contained

a. Components
1. CLI Entrypoint (laracon-schedule PHAR or vendor bin stub)
2. Bootstrap Layer (bootstrap/app.php)
3. Service Provider (App\Providers\AppServiceProvider) → registers SchedulingCommand
4. Command Handler (App\Commands\SchedulingCommand)
5. Data Source (app/Commands/data/windowsZones.json)
6. Configuration (config/*.php)
7. Composer Autoloader & Dependencies
9. Tests (tests/ for CI)
b. Interactions & Data Flow
1. User runs “laracon-schedule” → invokes PHAR or bin script → calls bootstrap/app.php
2. bootstrap/app.php loads Composer autoloader, reads config, registers AppServiceProvider
3. AppServiceProvider binds SchedulingCommand into the console kernel
4. Kernel dispatches user input to SchedulingCommand
5. SchedulingCommand loads schedule data JSON, applies timezone offset logic, formats output
6. SchedulingCommand writes formatted schedule to STDOUT
c. Architectural patterns & principles
- CLI Command Pattern (one command class implementing handle() method)
- Service Provider for inversion of control / dependency injection
- Single Responsibility: data file is separate from code, config is externalized
d. Key technologies & frameworks
- PHP 8.0+
- Composer Autoloading
- Laravel Console component (Illuminate\Console\Application)
- Pest & PHPUnit for testing

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Components
    CLI["CLI Entrypoint / PHAR"]:::runtime
    Bootstrap["Bootstrap (bootstrap/app.php)"]:::runtime
    ServiceProvider["Service Provider\n(app/Providers/AppServiceProvider.php)"]:::runtime
    SchedulingCommand["SchedulingCommand\n(app/Commands/SchedulingCommand.php)"]:::runtime
    STDOUT["STDOUT"]:::runtime

    %% Data and Config
    subgraph "Data & Config"
        DataJSON["Data JSON\n(app/Commands/data/windowsZones.json)"]:::data
        configApp["config/app.php"]:::data
        configCommands["config/commands.php"]:::data
        configFilesystems["config/filesystems.php"]:::data
    end

    %% External Dependencies
    subgraph "Dependencies"
        composerJson["composer.json"]:::external
        composerLock["composer.lock"]:::external
        vendor["vendor/"]:::external
    end

    %% Build Components
    subgraph "Build-Time"
        boxJson["box.json"]:::build
        buildOutput["builds/laracon-schedule"]:::build
    end

    %% Tests
    subgraph "Tests"
        InspiringTest["InspiringCommandTest\n(tests/Feature/InspiringCommandTest.php)"]:::external
        ExampleTest["ExampleTest\n(tests/Unit/ExampleTest.php)"]:::external
        TestCase["TestCase\n(tests/TestCase.php)"]:::external
        CreatesApp["CreatesApplication\n(tests/CreatesApplication.php)"]:::external
        PestFile["Pest\n(tests/Pest.php)"]:::external
    end

    %% Runtime Flow
    CLI -->|"invoke"| Bootstrap
    Bootstrap -->|"register provider"| ServiceProvider
    ServiceProvider -->|"dispatch command"| SchedulingCommand
    SchedulingCommand -->|"reads"| DataJSON
    SchedulingCommand -->|"reads"| configApp
    SchedulingCommand -->|"reads"| configCommands
    SchedulingCommand -->|"reads"| configFilesystems
    SchedulingCommand -->|"processes with"| composerJson
    SchedulingCommand -->|"processes with"| composerLock
    SchedulingCommand -->|"uses"| vendor
    SchedulingCommand -->|"outputs"| STDOUT

    %% Config & Autoload Load
    Bootstrap -->|"loads config"| configApp
    Bootstrap -->|"loads config"| configCommands
    Bootstrap -->|"loads config"| configFilesystems
    Bootstrap -->|"loads autoloader"| composerJson
    Bootstrap -->|"loads autoloader"| composerLock
    Bootstrap -->|"loads vendor"| vendor

    %% Build Flow
    boxJson -->|"build PHAR"| buildOutput
    buildOutput -.->|"package becomes"| CLI

    %% Tests Flow
    InspiringTest -->|"tests"| SchedulingCommand
    ExampleTest -->|"tests"| SchedulingCommand
    TestCase -->|"supports"| SchedulingCommand
    CreatesApp -->|"supports"| SchedulingCommand
    PestFile -->|"bootstrap"| SchedulingCommand

    %% Click Events
    click CLI "https://github.com/gangaiamaran/laracon-schedule/tree/master/laracon-schedule"
    click Bootstrap "https://github.com/gangaiamaran/laracon-schedule/blob/master/bootstrap/app.php"
    click ServiceProvider "https://github.com/gangaiamaran/laracon-schedule/blob/master/app/Providers/AppServiceProvider.php"
    click SchedulingCommand "https://github.com/gangaiamaran/laracon-schedule/blob/master/app/Commands/SchedulingCommand.php"
    click DataJSON "https://github.com/gangaiamaran/laracon-schedule/blob/master/app/Commands/data/windowsZones.json"
    click configApp "https://github.com/gangaiamaran/laracon-schedule/blob/master/config/app.php"
    click configCommands "https://github.com/gangaiamaran/laracon-schedule/blob/master/config/commands.php"
    click configFilesystems "https://github.com/gangaiamaran/laracon-schedule/blob/master/config/filesystems.php"
    click composerJson "https://github.com/gangaiamaran/laracon-schedule/blob/master/composer.json"
    click composerLock "https://github.com/gangaiamaran/laracon-schedule/blob/master/composer.lock"
    click vendor "https://github.com/gangaiamaran/laracon-schedule/tree/master/vendor/"
    click boxJson "https://github.com/gangaiamaran/laracon-schedule/blob/master/box.json"
    click buildOutput "https://github.com/gangaiamaran/laracon-schedule/tree/master/builds/laracon-schedule"
    click InspiringTest "https://github.com/gangaiamaran/laracon-schedule/blob/master/tests/Feature/InspiringCommandTest.php"
    click ExampleTest "https://github.com/gangaiamaran/laracon-schedule/blob/master/tests/Unit/ExampleTest.php"
    click TestCase "https://github.com/gangaiamaran/laracon-schedule/blob/master/tests/TestCase.php"
    click CreatesApp "https://github.com/gangaiamaran/laracon-schedule/blob/master/tests/CreatesApplication.php"
    click PestFile "https://github.com/gangaiamaran/laracon-schedule/blob/master/tests/Pest.php"

    %% Styles
    classDef runtime fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef data fill:#E6FFCC,stroke:#35a02c,color:#35a02c;
    classDef build fill:#FFE5CC,stroke:#d97608,color:#d97608;
    classDef external fill:#F0F0F0,stroke:#666666,color:#666666;
```
