# heiswayi/archmap architecture

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

- Interactive diagram: https://gitdiagram.com/heiswayi/archmap
- Repository: https://github.com/heiswayi/archmap

## Overview

archmap is a Python CLI that turns a project’s source tree into a standalone interactive architecture-map HTML. The workflow scans eligible files, extracts language-aware metadata, classifies files into layers, resolves internal dependencies, builds a project model, and renders the report. The README documents report views whose implementation is in the HTML template; source excerpts do not show their internal wiring, so those capabilities are represented without guessed interactions.

Main entry points: [`src/archmap/analyzer.py`](https://github.com/heiswayi/archmap/blob/main/src/archmap/analyzer.py) (Map Builder), [`src/archmap/cli.py`](https://github.com/heiswayi/archmap/blob/main/src/archmap/cli.py) (Command Line), [`src/archmap/languages/__init__.py`](https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/__init__.py) (Language Dispatch), [`src/archmap/renderer.py`](https://github.com/heiswayi/archmap/blob/main/src/archmap/renderer.py) (HTML Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and Output"]
  node_cli["Command Line<br/>[cli.py]"]
end

subgraph group_analysis["Source Analysis"]
  node_scanner["Source Scanner<br/>[scanner.py]"]
  node_orchestrator["Map Builder<br/>[analyzer.py]"]
  node_language_registry["Language Dispatch<br/>[__init__.py]"]
  node_analyzer_types["Analyzer Types<br/>[base.py]"]
  node_python_analysis["Python AST Analysis<br/>[python_analyzer.py]"]
  node_generic_analysis["Generic Analysis<br/>[generic.py]"]
end

subgraph group_model["Architecture Model"]
  node_layer_classifier["Layer Classification<br/>[layers.py]"]
  node_dependency_linker["Dependency Resolution<br/>[analyzer.py]"]
  node_project_model["Project Map Model<br/>[model.py]"]
end

subgraph group_report["Interactive Report"]
  node_renderer["HTML Renderer<br/>[renderer.py]"]
  node_template["Interactive Report Views<br/>[template.html]"]
end

node_developer(("Project Developer"))
node_browser(("Web Browser"))

node_developer -->|"runs"| node_cli
node_cli -->|"builds map"| node_orchestrator
node_orchestrator -->|"scans files"| node_scanner
node_orchestrator -->|"analyzes files"| node_language_registry
node_language_registry -->|"dispatches Python"| node_python_analysis
node_language_registry -->|"dispatches others"| node_generic_analysis
node_python_analysis -->|"implements interface"| node_analyzer_types
node_generic_analysis -->|"implements interface"| node_analyzer_types
node_orchestrator -->|"classifies files"| node_layer_classifier
node_orchestrator -->|"resolves imports"| node_dependency_linker
node_orchestrator -->|"assembles map"| node_project_model
node_cli -->|"writes report"| node_renderer
node_renderer -->|"serializes map"| node_project_model
node_renderer -->|"fills template"| node_template
node_cli -->|"opens report"| node_browser
node_template -->|"displays report"| node_browser

click node_cli "https://github.com/heiswayi/archmap/blob/main/src/archmap/cli.py"
click node_scanner "https://github.com/heiswayi/archmap/blob/main/src/archmap/scanner.py"
click node_orchestrator "https://github.com/heiswayi/archmap/blob/main/src/archmap/analyzer.py"
click node_language_registry "https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/__init__.py"
click node_analyzer_types "https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/base.py"
click node_python_analysis "https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/python_analyzer.py"
click node_generic_analysis "https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/generic.py"
click node_layer_classifier "https://github.com/heiswayi/archmap/blob/main/src/archmap/layers.py"
click node_dependency_linker "https://github.com/heiswayi/archmap/blob/main/src/archmap/analyzer.py"
click node_project_model "https://github.com/heiswayi/archmap/blob/main/src/archmap/model.py"
click node_renderer "https://github.com/heiswayi/archmap/blob/main/src/archmap/renderer.py"
click node_template "https://github.com/heiswayi/archmap/blob/main/src/archmap/templates/template.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_browser toneBlue
class node_scanner,node_orchestrator,node_language_registry,node_analyzer_types,node_python_analysis,node_generic_analysis toneAmber
class node_layer_classifier,node_dependency_linker,node_project_model toneMint
class node_renderer,node_template toneRose
class node_developer toneIndigo
```

## Components

### CLI and Output

- [Command Line](https://github.com/heiswayi/archmap/blob/main/src/archmap/cli.py): `src/archmap/cli.py`

### Source Analysis

- [Source Scanner](https://github.com/heiswayi/archmap/blob/main/src/archmap/scanner.py): `src/archmap/scanner.py`
- [Map Builder](https://github.com/heiswayi/archmap/blob/main/src/archmap/analyzer.py): `src/archmap/analyzer.py`
- [Language Dispatch](https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/__init__.py): `src/archmap/languages/__init__.py`
- [Analyzer Types](https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/base.py): `src/archmap/languages/base.py`
- [Python AST Analysis](https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/python_analyzer.py): `src/archmap/languages/python_analyzer.py`
- [Generic Analysis](https://github.com/heiswayi/archmap/blob/main/src/archmap/languages/generic.py): `src/archmap/languages/generic.py`

### Architecture Model

- [Layer Classification](https://github.com/heiswayi/archmap/blob/main/src/archmap/layers.py): `src/archmap/layers.py`
- [Dependency Resolution](https://github.com/heiswayi/archmap/blob/main/src/archmap/analyzer.py): `src/archmap/analyzer.py`
- [Project Map Model](https://github.com/heiswayi/archmap/blob/main/src/archmap/model.py): `src/archmap/model.py`

### Interactive Report

- [HTML Renderer](https://github.com/heiswayi/archmap/blob/main/src/archmap/renderer.py): `src/archmap/renderer.py`
- [Interactive Report Views](https://github.com/heiswayi/archmap/blob/main/src/archmap/templates/template.html): `src/archmap/templates/template.html`

### Other components

- **Project Developer**
- **Web Browser**

## Connections

- Project Developer → Command Line: runs (evidence: `README.md`)
- Command Line → Map Builder: builds map (evidence: `src/archmap/cli.py`)
- Map Builder → Source Scanner: scans files (evidence: `src/archmap/analyzer.py`)
- Map Builder → Language Dispatch: analyzes files (evidence: `src/archmap/analyzer.py`)
- Language Dispatch → Python AST Analysis: dispatches Python (evidence: `src/archmap/languages/__init__.py`)
- Language Dispatch → Generic Analysis: dispatches others (evidence: `src/archmap/languages/__init__.py`)
- Python AST Analysis → Analyzer Types: implements interface (evidence: `src/archmap/languages/python_analyzer.py`)
- Generic Analysis → Analyzer Types: implements interface (evidence: `src/archmap/languages/generic.py`)
- Map Builder → Layer Classification: classifies files (evidence: `src/archmap/analyzer.py`)
- Map Builder → Dependency Resolution: resolves imports (evidence: `src/archmap/analyzer.py`)
- Map Builder → Project Map Model: assembles map (evidence: `src/archmap/analyzer.py`)
- Command Line → HTML Renderer: writes report (evidence: `src/archmap/cli.py`)
- HTML Renderer → Project Map Model: serializes map (evidence: `src/archmap/renderer.py`)
- HTML Renderer → Interactive Report Views: fills template (evidence: `src/archmap/renderer.py`)
- Command Line → Web Browser: opens report (evidence: `src/archmap/cli.py`)
- Interactive Report Views → Web Browser: displays report (evidence: `README.md`)
