# incredibleasif/codeigniter4-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/incredibleasif/codeigniter4-frontend
- Repository: https://github.com/incredibleasif/codeigniter4-frontend

## Overview

##### Main Components

a. Core Bundle System
- FrontendBundle (central coordinator)
- Individual Bundle implementations (AdminLTE, Bootstrap, DataTables, etc.)
- Publishers (asset deployment mechanism)

b. Integration Layer
- CodeIgniter 4 Framework
- Assets Management System
- Publisher Library

c. External Dependencies
- Frontend Libraries (AdminLTE, Bootstrap, jQuery, etc.)
- Support Libraries (CommonMark, Alerts, Layouts, etc.)

**┌─ Application Layer ─────────────────────┐**
- (Consumer Applications)                 │
- ┬────────────────────┬─┘

**┌─ Frontend Bundle ┴────────────────────┴─┐**
- ┌─ Bundle Management ─┐ ┌─ Publishers ─┐│
- FrontendBundle   │ │ - AdminLTE   ││
- AdminLTEBundle   │ │ - Bootstrap  ││
- BootstrapBundle  │ │ - jQuery     ││
- DataTablesBundle │ │ - FontAwesome││
- ┬─┘ └─────────┬────┘│
- ┬┴─────────────┴──────┘

**┌─ Integration Layer┴────────────────────┐**
- ┌─ CodeIgniter 4 ─┐ ┌─ Asset System ─┐│
- Publisher Lib │ │ - Asset Filter ││
- Autoloader    │ │ - Route Config ││
- ┬┘ └───────────────┬┘│
- ┴──────────────────┴─┘

##### Key Relationships

a. Bundle Management:
- How FrontendBundle coordinates with individual bundles
- Dependency relationships between bundles (e.g., AdminLTE depends on Bootstrap)

b. Publisher System:
- Demonstrate the flow from Publishers to the final asset locations
- Integration with CodeIgniter's Publisher Library

c. Asset Management:
- How the Assets Filter processes requests
- Route configuration integration

##### Important Notes

- Version compatibility information (v1.x vs v2.x)
- Asset publication flow during the `spark publish` command
- Where configuration happens (Assets.php)
- Test integration points

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Application Layer"
        APP[Consumer Applications]
    end

    subgraph "Frontend Bundle Layer"
        subgraph "Bundle Management"
            FB["FrontendBundle"]:::core
            ALTB["AdminLTEBundle"]:::bundle
            BSB["BootstrapBundle"]:::bundle
            DTB["DataTablesBundle"]:::bundle
            JQB["JQueryBundle"]:::bundle
            FAB["FontAwesomeBundle"]:::bundle
        end

        subgraph "Publishers"
            FP["FrontendPublisher"]:::core
            ALTP["AdminLTEPublisher"]:::publisher
            BSP["BootstrapPublisher"]:::publisher
            DTP["DataTablesPublisher"]:::publisher
            DTSP["DataTablesStylePublisher"]:::publisher
            JQP["JQueryPublisher"]:::publisher
            FAP["FontAwesomePublisher"]:::publisher
        end
    end

    subgraph "Integration Layer"
        subgraph "CodeIgniter 4"
            PL["Publisher Library"]
            AL["Autoloader"]
        end

        subgraph "Asset System"
            AF["Asset Filter"]
            RC["Route Config"]
        end
    end

    subgraph "Testing Framework"
        PTC["Publishers Test Case"]:::test
        BT["Bundle Tests"]:::test
        PT["Publisher Tests"]:::test
        FPT["Frontend Publisher Tests"]:::test
    end

    %% Relationships
    APP --> FB
    FB --> FP
    FB --> |manages| ALTB & BSB & DTB & JQB & FAB
    FP --> |coordinates| ALTP & BSP & DTP & DTSP & JQP & FAP
    ALTP & BSP & DTP & DTSP & JQP & FAP --> PL
    PL --> AF
    AF --> RC

    %% Testing relationships
    PTC --> PT
    PT --> FPT
    BT --> ALTB & BSB & DTB & JQB & FAB

    %% Click events
    click FB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/FrontendBundle.php"
    click FP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/FrontendPublisher.php"
    click ALTB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Bundles/AdminLTEBundle.php"
    click BSB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Bundles/BootstrapBundle.php"
    click DTB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Bundles/DataTablesBundle.php"
    click JQB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Bundles/JQueryBundle.php"
    click FAB "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Bundles/FontAwesomeBundle.php"
    click ALTP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/AdminLTEPublisher.php"
    click BSP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/BootstrapPublisher.php"
    click DTP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/DataTablesPublisher.php"
    click DTSP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/DataTablesStylePublisher.php"
    click JQP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/JQueryPublisher.php"
    click FAP "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Publishers/FontAwesomePublisher.php"
    click PTC "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/src/Test/PublishersTestCase.php"
    click BT "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/tests/BundlesTest.php"
    click PT "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/tests/PublishersTest.php"
    click FPT "https://github.com/incredibleasif/codeigniter4-frontend/blob/main/tests/FrontendPublisherTest.php"

    %% Styling
    classDef core fill:#2374ab
    classDef bundle fill:#48a9a6
    classDef publisher fill:#4ea5d9
    classDef test fill:#e4572e

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Bundles]:::bundle
        L3[Publishers]:::publisher
        L4[Test Components]:::test
    end
```
