# bezouwenr/ibmi-scanner architecture

> Architecture diagram of the GitHub repository bezouwenr/ibmi-scanner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bezouwenr/ibmi-scanner
- Repository: https://github.com/bezouwenr/ibmi-scanner

## Overview

IBM i Reference Explorer presents program-to-file references and object metadata through a shared core, with a local web app and a VS Code extension. The principal flow is connect to an IBM i system, scan selected libraries, inspect references and file structure, and optionally open source in VS Code; scans can also be cached or exported/imported as JSON. The web routes and core scan stages are excerpted; the extension workflow and shared UI/core capabilities are documented in the README, so those links use that documentation as evidence.

Main entry points: [`core/index.js`](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/index.js) (Shared core API), [`core/scanner.js`](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js) (Library scan), [`core/connection.js`](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/connection.js) (IBM i connection), [`web/server.js`](https://github.com/bezouwenr/ibmi-scanner/blob/main/web/server.js) (Web API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User interfaces"]
  node_webui["Explorer UI<br/>[index.html]"]
  node_webapp["Web API<br/>[server.js]"]
  node_extension["VS Code extension<br/>[extension.js]"]
end

subgraph group_runtime["Connection runtime"]
  node_core["Shared core API<br/>[index.js]"]
  node_validation["Input validation<br/>[validate.js]"]
  node_connection["IBM i connection<br/>[connection.js]"]
  node_webclient["Web sessions<br/>[ibmiClient.js]"]
  node_mock["Mock IBM i<br/>[mockClient.js]"]
  node_jdbc["JDBC driver<br/>[ibmiClient.js]"]
end

subgraph group_analysis["Reference analysis"]
  node_scanner["Library scan<br/>[scanner.js]"]
  node_programrefs["Program references<br/>[scanner.js]"]
  node_objectmeta["Object metadata<br/>[scanner.js]"]
  node_bindings["Bound services<br/>[scanner.js]"]
  node_dbrelations["PF–LF relations<br/>[scanner.js]"]
  node_cache[("Scan cache<br/>[cache.js]")]
end

subgraph group_detail["Object details"]
  node_inspector["File inspector<br/>[inspector.js]"]
  node_sources["Source lookup<br/>[sources.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

node_user(("Engineer"))
node_ibmi[("IBM i system")]

node_user -->|"uses"| node_webui
node_user -->|"opens"| node_extension
node_webui -.->|"requests"| node_webapp
node_webapp -->|"manages sessions"| node_webclient
node_webapp -->|"scans libraries"| node_core
node_webapp -->|"describes files"| node_inspector
node_webapp -->|"lists modules"| node_sources
node_extension -->|"shares logic"| node_core
node_extension -->|"uses interface"| node_webui
node_webclient -->|"wraps driver"| node_connection
node_webclient -->|"connects through"| node_jdbc
node_webclient -->|"uses in mock mode"| node_mock
node_jdbc -->|"connects"| node_ibmi
node_connection -->|"runs SQL and CL"| node_ibmi
node_core -->|"exports"| node_validation
node_core -->|"exports"| node_connection
node_core -->|"exports"| node_scanner
node_core -->|"exports"| node_inspector
node_core -->|"exports"| node_sources
node_core -->|"exports"| node_translations
node_core -->|"exports"| node_mock
node_scanner -->|"reads"| node_programrefs
node_scanner -->|"reads"| node_objectmeta
node_scanner -->|"reads"| node_bindings
node_scanner -->|"reads"| node_dbrelations
node_scanner -->|"reads and writes"| node_cache
node_scanner -->|"uses connection helpers"| node_connection
node_inspector -->|"queries IBM i"| node_connection
node_inspector -->|"reads file structure"| node_ibmi
node_sources -->|"queries IBM i"| node_connection
node_sources -->|"reads source metadata"| node_ibmi
node_validation -->|"formats errors"| node_translations
node_scanner -->|"formats warnings"| node_translations

click node_webui "https://github.com/bezouwenr/ibmi-scanner/blob/main/ui/index.html"
click node_webapp "https://github.com/bezouwenr/ibmi-scanner/blob/main/web/server.js"
click node_extension "https://github.com/bezouwenr/ibmi-scanner/blob/main/vscode/src/extension.js"
click node_core "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/index.js"
click node_validation "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/validate.js"
click node_connection "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/connection.js"
click node_webclient "https://github.com/bezouwenr/ibmi-scanner/blob/main/web/ibmiClient.js"
click node_mock "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/mockClient.js"
click node_scanner "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js"
click node_programrefs "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js"
click node_objectmeta "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js"
click node_bindings "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js"
click node_dbrelations "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js"
click node_cache "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/cache.js"
click node_inspector "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/inspector.js"
click node_sources "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/sources.js"
click node_translations "https://github.com/bezouwenr/ibmi-scanner/blob/main/core/i18n.js"
click node_jdbc "https://github.com/bezouwenr/ibmi-scanner/blob/main/web/ibmiClient.js"

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_webui,node_webapp,node_extension toneBlue
class node_core,node_validation,node_connection,node_webclient,node_mock,node_jdbc,node_ibmi toneAmber
class node_scanner,node_programrefs,node_objectmeta,node_bindings,node_dbrelations,node_cache toneMint
class node_inspector,node_sources,node_translations toneRose
class node_user toneIndigo
```

## Components

### User interfaces

- [Explorer UI](https://github.com/bezouwenr/ibmi-scanner/blob/main/ui/index.html): `ui/index.html`
- [Web API](https://github.com/bezouwenr/ibmi-scanner/blob/main/web/server.js): `web/server.js`
- [VS Code extension](https://github.com/bezouwenr/ibmi-scanner/blob/main/vscode/src/extension.js): `vscode/src/extension.js`

### Connection runtime

- [Shared core API](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/index.js): `core/index.js`
- [Input validation](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/validate.js): `core/validate.js`
- [IBM i connection](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/connection.js): `core/connection.js`
- [Web sessions](https://github.com/bezouwenr/ibmi-scanner/blob/main/web/ibmiClient.js): `web/ibmiClient.js`
- [Mock IBM i](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/mockClient.js): `core/mockClient.js`
- [JDBC driver](https://github.com/bezouwenr/ibmi-scanner/blob/main/web/ibmiClient.js): `web/ibmiClient.js`

### Reference analysis

- [Library scan](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js): `core/scanner.js`
- [Program references](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js): `core/scanner.js`
- [Object metadata](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js): `core/scanner.js`
- [Bound services](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js): `core/scanner.js`
- [PF–LF relations](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/scanner.js): `core/scanner.js`
- [Scan cache](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/cache.js): `core/cache.js`

### Object details

- [File inspector](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/inspector.js): `core/inspector.js`
- [Source lookup](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/sources.js): `core/sources.js`
- [Translations](https://github.com/bezouwenr/ibmi-scanner/blob/main/core/i18n.js): `core/i18n.js`

### Other components

- **Engineer**
- **IBM i system**

## Connections

- Engineer → Explorer UI: uses (evidence: `README.md`)
- Engineer → VS Code extension: opens (evidence: `README.md`)
- Explorer UI → Web API: requests
- Web API → Web sessions: manages sessions (evidence: `web/server.js`)
- Web API → Shared core API: scans libraries (evidence: `web/server.js`)
- Web API → File inspector: describes files (evidence: `web/server.js`)
- Web API → Source lookup: lists modules (evidence: `web/server.js`)
- VS Code extension → Shared core API: shares logic (evidence: `README.md`)
- VS Code extension → Explorer UI: uses interface (evidence: `README.md`)
- Web sessions → IBM i connection: wraps driver (evidence: `web/ibmiClient.js`)
- Web sessions → JDBC driver: connects through (evidence: `web/ibmiClient.js`)
- Web sessions → Mock IBM i: uses in mock mode (evidence: `web/ibmiClient.js`)
- JDBC driver → IBM i system: connects (evidence: `web/ibmiClient.js`)
- IBM i connection → IBM i system: runs SQL and CL (evidence: `core/connection.js`)
- Shared core API → Input validation: exports (evidence: `core/index.js`)
- Shared core API → IBM i connection: exports (evidence: `core/index.js`)
- Shared core API → Library scan: exports (evidence: `core/index.js`)
- Shared core API → File inspector: exports (evidence: `core/index.js`)
- Shared core API → Source lookup: exports (evidence: `core/index.js`)
- Shared core API → Translations: exports (evidence: `core/index.js`)
- Shared core API → Mock IBM i: exports (evidence: `core/index.js`)
- Library scan → Program references: reads (evidence: `core/scanner.js`)
- Library scan → Object metadata: reads (evidence: `core/scanner.js`)
- Library scan → Bound services: reads (evidence: `core/scanner.js`)
- Library scan → PF–LF relations: reads (evidence: `core/scanner.js`)
- Library scan → Scan cache: reads and writes (evidence: `core/scanner.js`)
- Library scan → IBM i connection: uses connection helpers (evidence: `core/scanner.js`)
- File inspector → IBM i connection: queries IBM i (evidence: `core/inspector.js`)
- File inspector → IBM i system: reads file structure (evidence: `core/inspector.js`)
- Source lookup → IBM i connection: queries IBM i (evidence: `core/sources.js`)
- Source lookup → IBM i system: reads source metadata (evidence: `core/sources.js`)
- Input validation → Translations: formats errors (evidence: `core/validate.js`)
- Library scan → Translations: formats warnings (evidence: `core/scanner.js`)
