# mayurmhjn/iaclineage architecture

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

- Interactive diagram: https://gitdiagram.com/mayurmhjn/iaclineage
- Repository: https://github.com/mayurmhjn/iaclineage

## Overview

IaCLineage is a local Terraform source explorer. Users scan a checkout, search declarations with `find`, or generate reports; the core workflow indexes `.tf` source, resolves static references across local and installed modules, and exposes declarations, lineage, locations, and diagnostics. The interactive HTML adds field-level upstream/downstream tracing, conditional evidence, filtering, and module connections. Source excerpts establish the CLI-to-index/report flow and parser/model relationships; README documents the browser and static-analysis capabilities, while some implementation details remain unsampled.

Main entry points: [`src/iaclineage/cli.py`](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/cli.py) (CLI commands), [`src/iaclineage/hcl_source.py`](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/hcl_source.py) (Terraform indexer), [`src/iaclineage/report.py`](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py) (Report generation), [`src/iaclineage/model.py`](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/model.py) (Index data model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI workflow"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_analysis["Source analysis"]
  node_discovery["Source discovery<br/>[scan.py]"]
  node_indexer["Terraform indexer<br/>[hcl_source.py]"]
  node_parser["HCL parser<br/>[hcl_source.py]"]
  node_modules["Installed modules"]
  node_model["Index data model<br/>[model.py]"]
  node_diagnostics["Diagnostics<br/>[diagnostics.py]"]
end

subgraph group_outputs["Results and reports"]
  node_search["Declaration search<br/>[cli.py]"]
  node_report_writer["Report generation<br/>[report.py]"]
  node_static_report["Static HTML and JSON<br/>[report.py]"]
  node_interactive_report["Interactive HTML<br/>[report.py]"]
end

subgraph group_interactive["Interactive explorer"]
  node_browser["Lineage workspace<br/>[report.js]"]
  node_report_ui["Report interface assets<br/>[report.html]"]
end

node_user(("Engineer"))
node_terraform["Terraform checkout"]
node_module_cache[("Terraform module cache")]
node_engineer_browser(("Report viewer"))

node_user -->|"runs commands"| node_cli
node_cli -->|"scans files"| node_discovery
node_discovery -->|"finds .tf files"| node_terraform
node_cli -->|"indexes source"| node_indexer
node_indexer -->|"parses declarations"| node_parser
node_indexer -->|"resolves installed modules"| node_modules
node_modules -->|"reads manifest"| node_module_cache
node_indexer -->|"builds index records"| node_model
node_parser -->|"reports parse issues"| node_diagnostics
node_cli -->|"searches declarations"| node_search
node_search -->|"queries index"| node_model
node_cli -->|"writes reports"| node_report_writer
node_report_writer -->|"serializes index"| node_model
node_report_writer -->|"renders static output"| node_static_report
node_report_writer -->|"embeds lineage data"| node_interactive_report
node_interactive_report -->|"loads explorer"| node_browser
node_interactive_report -.->|"embeds interface assets"| node_report_ui
node_engineer_browser -->|"opens locally"| node_interactive_report
node_browser -->|"traces field references"| node_model

click node_cli "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/cli.py"
click node_discovery "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/scan.py"
click node_indexer "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/hcl_source.py"
click node_parser "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/hcl_source.py"
click node_modules "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/installed_modules.py"
click node_model "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/model.py"
click node_diagnostics "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/diagnostics.py"
click node_search "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/cli.py"
click node_report_writer "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py"
click node_static_report "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py"
click node_interactive_report "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py"
click node_browser "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/ui/report.js"
click node_report_ui "https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/ui/report.html"

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_cli,node_engineer_browser toneBlue
class node_discovery,node_indexer,node_parser,node_modules,node_model,node_diagnostics,node_module_cache toneAmber
class node_search,node_report_writer,node_static_report,node_interactive_report toneMint
class node_browser,node_report_ui toneRose
class node_user,node_terraform toneIndigo
```

## Components

### CLI workflow

- [CLI commands](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/cli.py): `src/iaclineage/cli.py`

### Source analysis

- [Source discovery](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/scan.py): `src/iaclineage/scan.py`
- [Terraform indexer](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/hcl_source.py): `src/iaclineage/hcl_source.py`
- [HCL parser](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/hcl_source.py): `src/iaclineage/hcl_source.py`
- [Installed modules](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/installed_modules.py): `src/iaclineage/installed_modules.py`
- [Index data model](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/model.py): `src/iaclineage/model.py`
- [Diagnostics](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/diagnostics.py): `src/iaclineage/diagnostics.py`

### Results and reports

- [Declaration search](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/cli.py): `src/iaclineage/cli.py`
- [Report generation](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py): `src/iaclineage/report.py`
- [Static HTML and JSON](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py): `src/iaclineage/report.py`
- [Interactive HTML](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/report.py): `src/iaclineage/report.py`

### Interactive explorer

- [Lineage workspace](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/ui/report.js): `src/iaclineage/ui/report.js`
- [Report interface assets](https://github.com/mayurmhjn/iaclineage/blob/main/src/iaclineage/ui/report.html): `src/iaclineage/ui/report.html`

### Other components

- **Engineer**
- **Terraform checkout**
- **Terraform module cache**
- **Report viewer**

## Connections

- Engineer → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Source discovery: scans files (evidence: `src/iaclineage/cli.py`)
- Source discovery → Terraform checkout: finds .tf files (evidence: `src/iaclineage/scan.py`)
- CLI commands → Terraform indexer: indexes source (evidence: `src/iaclineage/cli.py`)
- Terraform indexer → HCL parser: parses declarations (evidence: `src/iaclineage/hcl_source.py`)
- Terraform indexer → Installed modules: resolves installed modules (evidence: `src/iaclineage/hcl_source.py`)
- Installed modules → Terraform module cache: reads manifest (evidence: `src/iaclineage/installed_modules.py`)
- Terraform indexer → Index data model: builds index records (evidence: `src/iaclineage/hcl_source.py`)
- HCL parser → Diagnostics: reports parse issues (evidence: `src/iaclineage/hcl_source.py`)
- CLI commands → Declaration search: searches declarations (evidence: `src/iaclineage/cli.py`)
- Declaration search → Index data model: queries index (evidence: `src/iaclineage/cli.py`)
- CLI commands → Report generation: writes reports (evidence: `src/iaclineage/cli.py`)
- Report generation → Index data model: serializes index (evidence: `src/iaclineage/report.py`)
- Report generation → Static HTML and JSON: renders static output (evidence: `README.md`)
- Report generation → Interactive HTML: embeds lineage data (evidence: `src/iaclineage/report.py`)
- Interactive HTML → Lineage workspace: loads explorer (evidence: `README.md`)
- Interactive HTML → Report interface assets: embeds interface assets
- Report viewer → Interactive HTML: opens locally (evidence: `README.md`)
- Lineage workspace → Index data model: traces field references (evidence: `README.md`)
