# primefaces/primeng architecture

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

- Interactive diagram: https://gitdiagram.com/primefaces/primeng
- Repository: https://github.com/primefaces/primeng

## Overview

Steps:

##### Main Architectural Components
- Library Core: The PrimeNG UI component library (main source in packages/primeng). This houses all the UI widgets, including directives, components, and internal APIs.
- Themes & Styling: Managed in packages/themes to support multiple visual presets.
- Build & Tooling: The configuration files (e.g., tsconfig.json, package.json, angular.json in the showcase) and build scripts (found in scripts/ and the .github workflows) support both development and CI/CD.
- Application: Under apps/showcase, it provides an Angular application that demonstrates and documents each component’s usage and interactive demos.
- Documentation & Demo Content: The detailed “doc” directories inside apps/showcase and corresponding TypeScript source files across pages show step-by-step documentation and example usage.

##### Highlighting pRipple Effect Animation
- pRipple is implemented in the source as part of the “ripple” module (its files are within packages/primeng/src/ripple, including ripple.ts, style definitions in packages/primeng/src/ripple/style, and related public_api.ts).

##### Relationships and Interactions
- Interactions between the theming system (packages/themes) and the UI components layer to emphasize that styles (including those controlling the pRipple’s animation style) are applied via those theme files.

##### Diagrammatic Conventions
- Use clear labels for each layer: “Presentation App”, “Component Library”, “Directives/Utilities”, etc.
- Annotating the pRipple module with notes like “Handles the ripple effect animation – provides visual feedback on touch/click events” and list any design patterns (e.g. Directive pattern, event-driven updates) that are used for its implementation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        Showcase["Showcase Application"]:::app
    end

    %% Component Library Layer
    subgraph "Component Library"
        Core["PrimeNG Library"]:::library
        subgraph "UI Components"
            Button["Button Component"]:::component
            Card["Card Component"]:::component
        end
        Directive["pRipple Module (Handles ripple effect animation)"]:::ripple
    end

    %% Styles and Themes Layer
    subgraph "Styles and Themes"
        Themes["Themes & Styling"]:::theme
    end

    %% Build & Tooling Layer
    subgraph "Build & Tooling"
        Workflows["Workflows (.github)"]:::tool
        Scripts["Build Scripts (scripts)"]:::tool
        PackageJson["package.json"]:::tool
        TSConfig["tsconfig.json"]:::tool
    end

    %% Connections
    Showcase -->|"demonstratesUsage"| Core
    Core -->|"contains"| Button
    Core -->|"contains"| Card
    Button -->|"triggersRipple"| Directive
    Themes -->|"appliesStylesTo"| Core
    Themes -->|"appliesStylesTo"| Directive
    PackageJson -->|"buildsApp"| Showcase
    Scripts -->|"automatesBuild"| Core
    Workflows -->|"CI/CD"| Core
    TSConfig -->|"configures"| Core

    %% Click Events
    click Core "https://github.com/primefaces/primeng/tree/master/packages/primeng"
    click Themes "https://github.com/primefaces/primeng/tree/master/packages/themes"
    click Showcase "https://github.com/primefaces/primeng/tree/master/apps/showcase"
    click Directive "https://github.com/primefaces/primeng/tree/master/packages/primeng/src/ripple"
    click Workflows "https://github.com/primefaces/primeng/tree/master/.github/workflows"
    click Scripts "https://github.com/primefaces/primeng/tree/master/scripts"
    click PackageJson "https://github.com/primefaces/primeng/blob/master/package.json"
    click TSConfig "https://github.com/primefaces/primeng/blob/master/tsconfig.json"

    %% Styles
    classDef app fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef library fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef component fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef ripple fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef theme fill:#DDA0DD,stroke:#333,stroke-width:2px;
    classDef tool fill:#E0FFFF,stroke:#333,stroke-width:2px;
```
