# augustogoncalves/forge-plant-operation architecture

> Architecture diagram of the GitHub repository augustogoncalves/forge-plant-operation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/augustogoncalves/forge-plant-operation
- Repository: https://github.com/augustogoncalves/forge-plant-operation

## Overview

Forge-Plant is a browser-based sample for linking 2D P&ID and 3D plant models by tag. The main workflow loads both Forge Viewer models, indexes 3D component tags, and synchronizes selection across the two viewers; users can also browse tag-associated attachments and use temperature markup or a process-flow animation. The ASP.NET Core app serves the client and attachment listings and provides Forge access tokens. The graph follows relationships visible in the excerpts and README; unshown bucket/object management is not modeled as a backend subsystem.

Main entry points: [`forgeSample/wwwroot/js/forgeViewer.js`](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/forgeViewer.js) (2D/3D viewers), [`forgeSample/wwwroot/index.html`](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/index.html) (Viewer page), [`forgeSample/wwwroot/js/layout.js`](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/layout.js) (Viewer layout), [`forgeSample/wwwroot/js/plant.js`](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/plant.js) (Tag linking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Viewer client"]
  node_page["Viewer page<br/>[index.html]"]
  node_layout["Viewer layout<br/>[layout.js]"]
  node_viewer["2D/3D viewers<br/>[forgeViewer.js]"]
  node_taglink["Tag linking<br/>[plant.js]"]
  node_icons["Icon markup<br/>[iconExtension.js]"]
  node_flow["Process flow"]
  node_panels["Viewer panels"]
  node_attachmentsui["Attachment browser<br/>[plant.js]"]
end

subgraph group_server["Web backend"]
  node_app["ASP.NET app<br/>[Program.cs]"]
  node_startup["HTTP pipeline<br/>[Startup.cs]"]
  node_oauth["Token endpoint<br/>[OAuthController.cs]"]
  node_attachmentapi["Attachment API"]
  node_files["Attachment files"]
end

subgraph group_forge["Forge services"]
  node_autodesk{{"Autodesk Forge"}}
  node_models[("2D/3D models")]
end

node_user(("Plant user"))

node_user -->|"opens"| node_page
node_page -->|"loads"| node_layout
node_layout -->|"loads"| node_panels
node_page -->|"initializes"| node_viewer
node_viewer -->|"loads"| node_models
node_viewer -->|"requests token"| node_oauth
node_oauth -->|"authenticates"| node_autodesk
node_viewer -->|"dispatches events"| node_taglink
node_taglink -->|"searches and selects"| node_viewer
node_viewer -->|"loads extension"| node_icons
node_viewer -->|"loads extension"| node_flow
node_taglink -->|"fetches listings"| node_attachmentapi
node_attachmentapi -->|"reads files"| node_files
node_layout -->|"invokes selection"| node_attachmentsui
node_app -->|"configures host"| node_startup
node_startup -.->|"routes requests"| node_oauth
node_startup -.->|"routes requests"| node_attachmentapi

click node_page "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/index.html"
click node_layout "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/layout.js"
click node_viewer "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/forgeViewer.js"
click node_taglink "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/plant.js"
click node_icons "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/iconExtension.js"
click node_flow "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/processFlowExtension.js"
click node_panels "https://github.com/augustogoncalves/forge-plant-operation/tree/master/forgeSample/wwwroot/panels"
click node_attachmentsui "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/plant.js"
click node_app "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Program.cs"
click node_startup "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Startup.cs"
click node_oauth "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Controllers/OAuthController.cs"
click node_attachmentapi "https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Controllers/AttachmentsController.cs"
click node_files "https://github.com/augustogoncalves/forge-plant-operation/tree/master/forgeSample/wwwroot/attachments"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_page,node_layout,node_viewer,node_taglink,node_icons,node_flow,node_panels,node_attachmentsui,node_user toneBlue
class node_app,node_startup,node_oauth,node_attachmentapi,node_files toneAmber
class node_autodesk,node_models toneMint
```

## Components

### Viewer client

- [Viewer page](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/index.html): `forgeSample/wwwroot/index.html`
- [Viewer layout](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/layout.js): `forgeSample/wwwroot/js/layout.js`
- [2D/3D viewers](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/forgeViewer.js): `forgeSample/wwwroot/js/forgeViewer.js`
- [Tag linking](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/plant.js): `forgeSample/wwwroot/js/plant.js`
- [Icon markup](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/iconExtension.js): `forgeSample/wwwroot/js/iconExtension.js`
- [Process flow](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/processFlowExtension.js): `forgeSample/wwwroot/js/processFlowExtension.js`
- [Viewer panels](https://github.com/augustogoncalves/forge-plant-operation/tree/master/forgeSample/wwwroot/panels): `forgeSample/wwwroot/panels`
- [Attachment browser](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/wwwroot/js/plant.js): `forgeSample/wwwroot/js/plant.js`

### Web backend

- [ASP.NET app](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Program.cs): `forgeSample/Program.cs`
- [HTTP pipeline](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Startup.cs): `forgeSample/Startup.cs`
- [Token endpoint](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Controllers/OAuthController.cs): `forgeSample/Controllers/OAuthController.cs`
- [Attachment API](https://github.com/augustogoncalves/forge-plant-operation/blob/master/forgeSample/Controllers/AttachmentsController.cs): `forgeSample/Controllers/AttachmentsController.cs`
- [Attachment files](https://github.com/augustogoncalves/forge-plant-operation/tree/master/forgeSample/wwwroot/attachments): `forgeSample/wwwroot/attachments`

### Forge services

- **Autodesk Forge**
- **2D/3D models**

### Other components

- **Plant user**

## Connections

- Plant user → Viewer page: opens (evidence: `README.md`)
- Viewer page → Viewer layout: loads (evidence: `forgeSample/wwwroot/js/layout.js`)
- Viewer layout → Viewer panels: loads (evidence: `forgeSample/wwwroot/js/layout.js`)
- Viewer page → 2D/3D viewers: initializes (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- 2D/3D viewers → 2D/3D models: loads (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- 2D/3D viewers → Token endpoint: requests token (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- Token endpoint → Autodesk Forge: authenticates (evidence: `forgeSample/Controllers/OAuthController.cs`)
- 2D/3D viewers → Tag linking: dispatches events (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- Tag linking → 2D/3D viewers: searches and selects (evidence: `forgeSample/wwwroot/js/plant.js`)
- 2D/3D viewers → Icon markup: loads extension (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- 2D/3D viewers → Process flow: loads extension (evidence: `forgeSample/wwwroot/js/forgeViewer.js`)
- Tag linking → Attachment API: fetches listings (evidence: `forgeSample/wwwroot/js/plant.js`)
- Attachment API → Attachment files: reads files (evidence: `forgeSample/Controllers/AttachmentsController.cs`)
- Viewer layout → Attachment browser: invokes selection (evidence: `forgeSample/wwwroot/js/layout.js`)
- ASP.NET app → HTTP pipeline: configures host (evidence: `forgeSample/Program.cs`)
- HTTP pipeline → Token endpoint: routes requests
- HTTP pipeline → Attachment API: routes requests
