# chrishof/n8n-nodes-liferay architecture

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

- Interactive diagram: https://gitdiagram.com/chrishof/n8n-nodes-liferay
- Repository: https://github.com/chrishof/n8n-nodes-liferay

## Overview

##### Project type and purpose
- This is an open‐source integration node (“n8n Liferay Node”) for the n8n workflow automation platform.
- Its purpose is to let end users build n8n workflows that authenticate (OAuth2 or Basic Auth) against a Liferay instance and invoke any of Liferay’s Headless APIs or Custom Object endpoints, with full metadata and UI autocomplete.

##### File structure
Top level
- index.js         → entry point that registers the node with n8n
- gulpfile.js      → build tasks (TypeScript compilation, bundling)
- tsconfig.json    → TypeScript compiler settings
- eslint.config.*  → linting rules
- package.json, pnpm-lock.yaml
nodes/Liferay
- Liferay.node.json → node description (name, inputs, outputs, credentials UI schema, operations list)
- Liferay.node.ts   → runtime implementation and wiring
- descriptions/     → per‐operation parameter definitions (from OpenAPI)
- functions/        → reusable HTTP request helpers and individual API‐call functions

##### README for additional insights
- Confirms support for OAuth2 and Basic Auth
- All endpoints exposed via dynamic OpenAPI‐driven autocomplete
- Usage pattern: install via n8n’s community‐node mechanism, then configure credentials and endpoints in the UI

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Toolchain
    subgraph "Developer Toolchain"
        direction TB
        IDX["index.js"]:::developer
        GULP["gulpfile.js"]:::developer
        TSCONFIG["tsconfig.json"]:::developer
        ESLINT1["eslint.config.mjs"]:::developer
        ESLINT2["eslint.config.prepublish.mjs"]:::developer
        PKG["package.json"]:::developer
        LOCK["pnpm-lock.yaml"]:::developer
        README["README.md"]:::developer
    end

    %% n8n Runtime
    subgraph "n8n Runtime"
        direction TB
        CORE["Core Workflow Engine"]:::runtime
        CRED["Credentials Store"]:::runtime
        LOADER["Node Loader"]:::runtime
        EXEC["Execution Context"]:::runtime
    end

    %% Liferay Node Package
    subgraph "Liferay Node Package"
        direction TB
        DESC["nodes/Liferay/Liferay.node.json"]:::plugin
        IMPL["nodes/Liferay/Liferay.node.ts"]:::plugin
        HDESC["HeadlessApiDescription.ts"]:::plugin
        ODESC["ObjectDescription.ts"]:::plugin
        GFUNC["GenericFunctions.ts"]:::plugin
        HFUNC["HeadlessApiFunctions.ts"]:::plugin
        OFUNC["ObjectFunctions.ts"]:::plugin
        OTYPES["ObjectTypes.ts"]:::datamodel
        OAPI["OpenApi.ts"]:::datamodel
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        API["Liferay Headless API Server"]:::external
        AUTH["OAuth2 Authorization Server"]:::external
        BASIC["Basic Auth Endpoint"]:::external
    end

    %% Build Relationships
    GULP -->|"compiles TS into JS"| IDX
    GULP -->|"compiles TS into JS"| IMPL

    %% Plugin Loading & UI Rendering
    IDX -->|"registers node"| LOADER
    LOADER -->|"reads JSON schema"| DESC
    LOADER -->|"loads implementation"| IMPL

    %% Workflow Execution
    CORE -->|"trigger execution"| IMPL
    IMPL -->|"get credentials"| CRED
    IMPL -->|"delegates to helpers"| GFUNC
    IMPL -->|"delegates to helpers"| HFUNC
    IMPL -->|"delegates to helpers"| OFUNC
    GFUNC -->|"use models"| OTYPES
    GFUNC -->|"use models"| OAPI
    HFUNC -->|"use models"| OTYPES
    HFUNC -->|"use models"| OAPI
    OFUNC -->|"use models"| OTYPES
    OFUNC -->|"use models"| OAPI

    %% External API Calls
    GFUNC -->|"HTTP request"| API
    HFUNC -->|"HTTP request"| API
    OFUNC -->|"HTTP request"| API
    AUTH -->|"OAuth2 token"| API
    BASIC -->|"Basic Auth"| API

    API -->|"response data"| IMPL
    IMPL -->|"return result"| EXEC

    %% Click Events
    click IDX "https://github.com/chrishof/n8n-nodes-liferay/blob/main/index.js"
    click GULP "https://github.com/chrishof/n8n-nodes-liferay/blob/main/gulpfile.js"
    click TSCONFIG "https://github.com/chrishof/n8n-nodes-liferay/blob/main/tsconfig.json"
    click ESLINT1 "https://github.com/chrishof/n8n-nodes-liferay/blob/main/eslint.config.mjs"
    click ESLINT2 "https://github.com/chrishof/n8n-nodes-liferay/blob/main/eslint.config.prepublish.mjs"
    click PKG "https://github.com/chrishof/n8n-nodes-liferay/blob/main/package.json"
    click LOCK "https://github.com/chrishof/n8n-nodes-liferay/blob/main/pnpm-lock.yaml"
    click README "https://github.com/chrishof/n8n-nodes-liferay/blob/main/README.md"
    click DESC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/Liferay.node.json"
    click IMPL "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/Liferay.node.ts"
    click HDESC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/descriptions/HeadlessApiDescription.ts"
    click ODESC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/descriptions/ObjectDescription.ts"
    click GFUNC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/functions/GenericFunctions.ts"
    click HFUNC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/functions/HeadlessApiFunctions.ts"
    click OFUNC "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/functions/ObjectFunctions.ts"
    click OTYPES "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/types/ObjectTypes.ts"
    click OAPI "https://github.com/chrishof/n8n-nodes-liferay/blob/main/nodes/Liferay/types/OpenApi.ts"

    %% Styles
    classDef developer fill:#DDDDDD,stroke:#888888,color:#333333;
    classDef runtime fill:#AED6F1,stroke:#2E86C1,color:#1B4F72;
    classDef plugin fill:#F9E79F,stroke:#B7950B,color:#6E2C00;
    classDef datamodel fill:#FCF3CF,stroke:#B9770E,color:#784212;
    classDef external fill:#A9DFBF,stroke:#27AE60,color:#145A32;
```
