# fingerprintjs/fingerprint-pro-akamai-proxy-integration architecture

> Architecture diagram of the GitHub repository fingerprintjs/fingerprint-pro-akamai-proxy-integration, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration
- Repository: https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration

## Overview

##### Project Type and Purpose
- This is an open-source integration tool (“Fingerprint Pro Akamai Proxy Integration”) written in TypeScript/Node.js that generates Akamai Property Manager rules and patch payloads.
- It helps enterprise customers proxy identification and agent-download requests from their website through Akamai to Fingerprint’s APIs, via Terraform or the Akamai Property Manager API.

##### File Structure Analysis
- Top-level config: .eslintrc.json, tsconfig.json, .prettierrc, .releaserc.json, package.json, pnpm-lock.yaml.
- Source code:
- generators/ — TS modules to programmatically build Terraform rules or patch bodies.
- scripts/ — utility scripts to build, test, and apply rules (e.g., deployRules.ts, createProperty.ts, clearProperties.ts).
- assets/ — JSON templates (rulesTemplate.json, variables.json, patch bodies) for merging with generated output.
- build.ts — orchestrates local builds (dist/terraform/json, dist/patch-body).
- Tests: test/e2e, playwright.config.ts, scripts/mockTests.ts — E2E and mock tests against a local Akamai‐like environment.
- CI/CD: .github/workflows/* (lint, tests, release), husky hooks, commitlint.
- README.md + examples.tf — user‐facing documentation and code snippets for Terraform integration.

##### README Insights
- Two installation mechanisms: Terraform template integration and Akamai Property Manager API patch.
- Emphasis on generating JSON artifacts that the customer’s IaC or API tooling consumes.
- Build commands (`pnpm build --type terraform` or `--type patchBody`) produce distributable JSON and example.tf.

##### Detail
- Configuration parameters: integration-path, agent-path, result-path, proxy-secret.
- CI steps: lint → test → build → release.
- Versioning flow: tag → build → release → consumer pin version.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Internal Tooling
    subgraph "Internal Tooling"
        direction TB
        sourceRepo["GitHub Repository"]:::blue
        ciWorkflow["CI/CD Workflows"]:::blue
        hookPre[".husky/pre-commit"]:::blue
        hookMsg[".husky/commit-msg"]:::blue
        commitlintCfg["commitlint.config.js"]:::blue
        configTS["tsconfig.json"]:::blue
        configES[".eslintrc.json"]:::blue
        configPretti[".prettierrc"]:::blue
        configRelease[".releaserc.json"]:::blue
        pkg["package.json"]:::blue
        readme["README.md"]:::blue
        buildTs["Build Orchestrator\n(build.ts)"]:::blue
        genTerraform["Generator Modules\n(generateTerraformPropertyRules.ts)"]:::blue
        genPatch["Generator Modules\n(generatePatchBody.ts)"]:::blue
        assetsRules["Template Assets\n(rulesTemplate.json)"]:::blue
        assetsVars["Template Assets\n(variables.json)"]:::blue
        assetsPatchRule["Patch-Body Template\n(patchBodyAddRule.json)"]:::blue
        assetsPatchVar["Patch-Body Template\n(patchBodyAddVariable.json)"]:::blue
        deployCreate["createProperty.ts"]:::blue
        deployRules["deployRules.ts"]:::blue
        deployClear["clearProperties.ts"]:::blue
        testE2E["E2E Tests\n(test/e2e/)"]:::blue
        mockTests["Mock Tests\n(scripts/mockTests.ts)"]:::blue
        playwright["playwright.config.ts"]:::blue
    end

    %% Distributed Artifacts
    subgraph "Distributed Artifacts"
        direction TB
        distFolder["Dist Artifacts\n(dist/)"]:::green
        gitRelease["GitHub Releases"]:::green
        exampleTF["Example Terraform Snippet\n(example.tf)"]:::green
    end

    %% Consumer Integrations
    subgraph "Consumer Integrations"
        direction TB
        terraformConsumer["Terraform Integration"]:::orange
        apiClient["API Client"]:::orange
    end

    %% Runtime Proxy Path
    subgraph "Runtime Proxy Path"
        direction TB
        Browser["End-User Browser"]:::purple
        akamaiEdge["Akamai Edge"]:::purple
        fpAPI["FingerprintJS APIs"]:::purple
    end

    %% External Services
    akamaiPM["Akamai Property Manager"]:::purple

    %% Connections
    sourceRepo --> ciWorkflow
    sourceRepo --> hookPre
    sourceRepo --> hookMsg
    sourceRepo --> commitlintCfg
    sourceRepo --> configTS
    sourceRepo --> configES
    sourceRepo --> configPretti
    sourceRepo --> configRelease
    sourceRepo --> pkg
    sourceRepo --> readme

    ciWorkflow --> testE2E
    ciWorkflow --> mockTests
    ciWorkflow --> playwright
    ciWorkflow --> buildTs

    buildTs --> genTerraform
    buildTs --> genPatch
    buildTs --> assetsRules
    buildTs --> assetsVars
    buildTs --> assetsPatchRule
    buildTs --> assetsPatchVar
    buildTs --> distFolder

    distFolder --> gitRelease
    ciWorkflow --> gitRelease

    distFolder --> exampleTF
    distFolder --> terraformConsumer
    distFolder --> apiClient

    terraformConsumer --> akamaiPM
    apiClient --> akamaiPM

    Browser --> akamaiEdge --> fpAPI

    %% Click Events
    click genTerraform "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/generators/generateTerraformPropertyRules.ts"
    click genPatch "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/generators/generatePatchBody.ts"
    click assetsRules "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/assets/rulesTemplate.json"
    click assetsVars "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/assets/variables.json"
    click assetsPatchRule "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/assets/patch-body/patchBodyAddRule.json"
    click assetsPatchVar "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/assets/patch-body/patchBodyAddVariable.json"
    click exampleTF "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/assets/example.tf"
    click buildTs "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/build.ts"
    click deployCreate "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/scripts/createProperty.ts"
    click deployRules "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/scripts/deployRules.ts"
    click deployClear "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/scripts/clearProperties.ts"
    click testE2E "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/tree/main/test/e2e/"
    click mockTests "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/scripts/mockTests.ts"
    click playwright "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/playwright.config.ts"
    click ciWorkflow "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/.github/workflows/ci.yml"
    click hookPre "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/tree/main/.husky/pre-commit"
    click hookMsg "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/tree/main/.husky/commit-msg"
    click commitlintCfg "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/commitlint.config.js"
    click configTS "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/tsconfig.json"
    click configES "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/.eslintrc.json"
    click configPretti "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/.prettierrc"
    click configRelease "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/.releaserc.json"
    click pkg "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/package.json"
    click readme "https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration/blob/main/README.md"

    %% Styles
    classDef blue fill:#cfe2f3,stroke:#084c8d,color:#084c8d;
    classDef green fill:#d9ead3,stroke:#27632a,color:#27632a;
    classDef orange fill:#fce5cd,stroke:#a64d14,color:#a64d14;
    classDef purple fill:#ead1dc,stroke:#741b47,color:#741b47;
```
