# facebook/it-cpe architecture

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

- Interactive diagram: https://gitdiagram.com/facebook/it-cpe
- Repository: https://github.com/facebook/it-cpe

## Overview

##### Main System Components

a) Core Infrastructure
- Chef Server (implied but not visible in code)
- Client Nodes (macOS, Windows, Linux systems being managed)

b) Cookbook Organization
- CPE Cookbooks (cpe_*)
- Facebook Cookbooks (fb_*)
- Legacy Tools
- Pantri System

##### Component Relationships

**[Chef Server] → [Client Nodes]**
- ↓
- [Configuration Management Layer]
- Core Cookbooks
- cpe_init (primary entry point)
- cpe_helpers (utility functions)
- cpe_profiles (system configurations)

- Platform-Specific Cookbooks
- Windows Management (cpe_applocker, cpe_win_telemetry)
- macOS Management (cpe_munki, cpe_profiles)
- Linux Management (cpe_flatpak, cpe_dconf)

- Service Cookbooks
- Browser Management (cpe_chrome)
- Power Management (cpe_powermanagement)
- Remote Management (cpe_remote)

- Support Tools
- Pantri (package management)
- Legacy Tools (adobe_tools, autopkg_tools)

##### Key Architectural Patterns to Highlight

a) Layered Architecture:
- Infrastructure Layer (Chef Server)
- Configuration Layer (Cookbooks)
- Platform Layer (OS-specific implementations)
- Tools Layer (Support utilities)

b) Modular Design:
- How cpe_init serves as the main entry point
- Cookbook dependencies
- Cross-platform support

##### Important Details

- Platform support (Windows/macOS/Linux)
- Configuration flow direction
- Critical components (cpe_init, cpe_helpers)

##### Implementation Notes

- Chef-based configuration management
- Multi-platform support
- Modular cookbook architecture
- Integration with external tools (Munki, AutoPkg)
- Support for legacy systems

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Infrastructure
        CS[Chef Server]:::server
        CN[Client Nodes]:::nodes
    end

    subgraph "Configuration Management"
        subgraph "Core Cookbooks"
            INIT["cpe_init (Entry Point)"]:::core
            HELP["cpe_helpers (Utilities)"]:::core
            PROF["cpe_profiles (Configs)"]:::core
        end

        subgraph "Platform Management"
            subgraph "Windows"
                WIN1["cpe_applocker"]:::windows
                WIN2["cpe_win_telemetry"]:::windows
                WIN3["cpe_windows_update"]:::windows
            end

            subgraph "macOS"
                MAC1["cpe_munki"]:::macos
                MAC2["cpe_profiles"]:::macos
                MAC3["cpe_preferencepanes"]:::macos
            end

            subgraph "Linux"
                LIN1["cpe_flatpak"]:::linux
                LIN2["cpe_dconf"]:::linux
                LIN3["cpe_gnome_software"]:::linux
            end
        end

        subgraph "Service Management"
            SVC1["cpe_chrome"]:::service
            SVC2["cpe_powermanagement"]:::service
            SVC3["cpe_remote"]:::service
        end

        subgraph "Support Tools"
            PANT["Pantri"]:::tools
            subgraph "Legacy"
                LEG1["adobe_tools"]:::legacy
                LEG2["autopkg_tools"]:::legacy
            end
        end
    end

    CS --> CN
    CN --> INIT
    INIT --> HELP
    INIT --> PROF

    INIT --> WIN1
    INIT --> WIN2
    INIT --> WIN3
    INIT --> MAC1
    INIT --> MAC2
    INIT --> MAC3
    INIT --> LIN1
    INIT --> LIN2
    INIT --> LIN3
    INIT --> SVC1
    INIT --> SVC2
    INIT --> SVC3
    INIT --> PANT
    PANT --> LEG1
    PANT --> LEG2

    %% Click events for component mapping
    click INIT "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_init"
    click HELP "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_helpers"
    click PROF "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_profiles"
    click WIN1 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_applocker"
    click WIN2 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_win_telemetry"
    click WIN3 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_windows_update_for_business"
    click MAC1 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_munki"
    click MAC2 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_profiles"
    click MAC3 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_preferencepanes"
    click LIN1 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_flatpak"
    click LIN2 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_dconf"
    click LIN3 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_gnome_software"
    click SVC1 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_chrome"
    click SVC2 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_powermanagement"
    click SVC3 "https://github.com/facebook/IT-CPE/tree/main/itchef/cookbooks/cpe_remote"
    click PANT "https://github.com/facebook/IT-CPE/tree/main/pantri"
    click LEG1 "https://github.com/facebook/IT-CPE/tree/main/legacy/adobe_tools"
    click LEG2 "https://github.com/facebook/IT-CPE/tree/main/legacy/autopkg_tools"

    classDef server fill:#2374AB,stroke:#000,stroke-width:2px
    classDef nodes fill:#2374AB,stroke:#000,stroke-width:2px
    classDef core fill:#45B7D1,stroke:#000,stroke-width:2px
    classDef windows fill:#98C1D9,stroke:#000,stroke-width:2px
    classDef macos fill:#98C1D9,stroke:#000,stroke-width:2px
    classDef linux fill:#98C1D9,stroke:#000,stroke-width:2px
    classDef service fill:#A1C181,stroke:#000,stroke-width:2px
    classDef tools fill:#DACC3E,stroke:#000,stroke-width:2px
    classDef legacy fill:#D7816A,stroke:#000,stroke-width:2px
```
