# dickmans/plm-extensions architecture

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

- Interactive diagram: https://gitdiagram.com/dickmans/plm-extensions
- Repository: https://github.com/dickmans/plm-extensions

## Overview

##### Project type and purpose
- This is a full-stack Node.js/Express web application providing a suite of PLM (Product Lifecycle Management) extensions that integrate with Fusion Manage and Autodesk Platform Services (APS).
- The README calls out features such as Change Impact Analysis, Class Browser, Data Manager, MBOM Editor, etc., all delivered as web “apps” or “portals” using APS authentication (PKCE) and API calls to Fusion Manage.

##### File structure
- Top‐level
- app.js (Express app entry)
- bin/www (HTTP(S) server startup)
- package.json (dependencies, scripts)
- settings.js + settings/ (tenant‐specific config)
- keys/ (TLS certs for HTTPS)
- uploads/ (file store)
- MVC pattern
- routes/ (controllers for landing, pdm, plm, services)
- views/ (Pug templates organized by category: addins, apps, admin, docs, framework, tutorial, dev)
- public/ (static assets: javascripts, stylesheets, images, fonts, service worker)
- No local database—data is fetched from APS/Fusion Manage.
- Deployment/config files: .gitignore, .vscode, manifest.json, sw.js.

##### README
- Confirms PKCE authentication, need for APS “Desktop, Mobile, Single‐Page App” client ID in settings.js.
- Lists all extensions (“apps”) and video links—these map to individual front‐end modules under public/javascripts/apps and views/apps.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Front-end Browser
    Browser["Browser"]:::frontend

    %% Front-end Layer
    subgraph "Front-end Layer"
        StaticServer["Static Asset Server\n(public/)"]:::frontend
        JSModules["JS Modules\n(public/javascripts/)"]:::frontend
        Stylesheets["Stylesheets\n(public/stylesheets/)"]:::frontend
        ImagesFonts["Images & Fonts\n(public/images/, public/fonts/)"]:::frontend
        ServiceWorker["Service Worker\n(public/sw.js)"]:::frontend
    end

    %% Express Server Layer
    subgraph "Express Application Server"
        AppEntry["app.js"]:::backend
        ServerStartup["bin/www"]:::backend
        Controllers["Controllers\n(routes/)"]:::backend
        Views["Views (Pug)\n(views/)"]:::backend
        Uploads["File Upload Storage\n(uploads/)"]:::storage
    end

    %% Configuration & Security
    subgraph "Configuration & Security"
        Settings["Settings\n(settings.js, settings/)"]:::config
        Certs["HTTPS Certificates\n(keys/)"]:::config
    end

    %% External Services
    APSExt["APS & Fusion Manage APIs"]:::external

    %% Connections
    Browser -->|GET pages| Views
    Browser -->|GET assets| StaticServer
    StaticServer --> JSModules
    StaticServer --> Stylesheets
    StaticServer --> ImagesFonts
    Browser -->|Service Worker cache| ServiceWorker

    Browser -->|XHR/fetch| Controllers
    Controllers -->|render| Views
    Controllers -->|uses config| Settings
    Controllers -->|HTTPS certs| Certs
    Controllers -->|file storage| Uploads

    Controllers -->|OAuth PKCE, REST calls| APSExt
    APSExt -->|data| Controllers
    Controllers -->|render data| Views
    Views -->|HTML| Browser

    %% Architectural flow between layers
    Browser --> StaticServer
    Browser --> Controllers
    Controllers --> APSExt

    %% Click Events
    click StaticServer "https://github.com/dickmans/plm-extensions/tree/main/public/"
    click JSModules "https://github.com/dickmans/plm-extensions/tree/main/public/javascripts/"
    click Stylesheets "https://github.com/dickmans/plm-extensions/tree/main/public/stylesheets/"
    click ImagesFonts "https://github.com/dickmans/plm-extensions/tree/main/public/images/"
    click ImagesFonts "https://github.com/dickmans/plm-extensions/tree/main/public/fonts/"
    click ServiceWorker "https://github.com/dickmans/plm-extensions/blob/main/public/sw.js"
    click AppEntry "https://github.com/dickmans/plm-extensions/blob/main/app.js"
    click ServerStartup "https://github.com/dickmans/plm-extensions/tree/main/bin/www"
    click Settings "https://github.com/dickmans/plm-extensions/blob/main/settings.js"
    click Settings "https://github.com/dickmans/plm-extensions/tree/main/settings/"
    click Certs "https://github.com/dickmans/plm-extensions/tree/main/keys/"
    click Uploads "https://github.com/dickmans/plm-extensions/tree/main/uploads/"
    click Controllers "https://github.com/dickmans/plm-extensions/tree/main/routes/"
    click Views "https://github.com/dickmans/plm-extensions/tree/main/views/"
    click Package "https://github.com/dickmans/plm-extensions/blob/main/package.json"
    click Readme "https://github.com/dickmans/plm-extensions/blob/main/README.md"

    %% Additional mappings
    class Package package.json
    class Readme README.md

    %% Styles
    classDef frontend fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef backend fill:#ccddff,stroke:#333,stroke-width:1px
    classDef external fill:#ffe0b3,stroke:#333,stroke-width:1px
    classDef config fill:#ffebcc,stroke-dasharray: 5 5,stroke:#333,stroke-width:1px
    classDef storage fill:#f0f0f0,stroke:#333,stroke-width:1px
```
