# angeloszou/graphlint architecture

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

- Interactive diagram: https://gitdiagram.com/angeloszou/graphlint
- Repository: https://github.com/angeloszou/graphlint

## Overview

Graphlint scans a project, parses supported languages into a dependency graph, identifies entry points and unreachable code, then persists an index that users query for dead-code and other warnings. The CLI and Python API are the main entry points; the DSH plugin offers a separate agent-facing query/build/configuration interface. Language-specific parsing is represented by backend nodes. Some relationships and capabilities are based on README documentation and SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`graphlint/api.py`](https://github.com/angeloszou/graphlint/blob/main/graphlint/api.py) (Python API), [`graphlint/analyzer/language/registry.py`](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/registry.py) (Language registry), [`graphlint/analyzer/_types.py`](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/_types.py) (Graph data types), [`graphlint/incremental/indexer.py`](https://github.com/angeloszou/graphlint/blob/main/graphlint/incremental/indexer.py) (Incremental indexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_api["Python API<br/>[api.py]"]
  node_config["Project config<br/>[manager.py]"]
end

subgraph group_analysis["Graph analysis"]
  node_graph_builder["Graph builder<br/>[graph.py]"]
  node_graph_types["Graph data types<br/>[_types.py]"]
  node_reachability["Reachability analysis<br/>[_graph_algo.py]"]
  node_warnings["Warning detection<br/>[warnings.py]"]
end

subgraph group_languages["Language backends"]
  node_registry["Language registry<br/>[registry.py]"]
  node_python["Python analyzer<br/>[parser.py]"]
  node_rust["Rust analyzer<br/>[parser.py]"]
  node_c_family["C/C++ analyzer<br/>[__init__.py]"]
  node_csharp["C&#35; analyzer<br/>[parser.py]"]
  node_typescript["TS/JS analyzer<br/>[parser.py]"]
end

subgraph group_index["Index and queries"]
  node_indexer["Incremental indexer<br/>[indexer.py]"]
  node_db_ops["Index persistence<br/>[_db_ops.py]"]
  node_database[("SQLite index<br/>[db.py]")]
  node_schema["Index schema<br/>[schema.py]"]
  node_hashing["File hashing<br/>[hashing.py]"]
  node_query["Query engine<br/>[engine.py]"]
  node_formatter["Result formatting<br/>[formatter.py]"]
end

subgraph group_agent["Agent integration"]
  node_dsh["DSH tools<br/>[query.ts]"]
end

node_user(("Developer or agent"))

node_user -->|"invokes"| node_cli
node_user -->|"calls"| node_api
node_cli -->|"dispatches"| node_api
node_api -->|"loads config"| node_config
node_api -->|"builds index"| node_indexer
node_api -->|"runs queries"| node_query
node_api -->|"creates registry"| node_registry
node_registry -.->|"selects backend"| node_python
node_registry -.->|"selects backend"| node_rust
node_registry -.->|"selects backend"| node_c_family
node_registry -.->|"selects backend"| node_csharp
node_registry -.->|"selects backend"| node_typescript
node_python -->|"produces parse data"| node_graph_types
node_rust -->|"produces parse data"| node_graph_types
node_c_family -.->|"produces parse data"| node_graph_types
node_csharp -.->|"produces parse data"| node_graph_types
node_typescript -.->|"produces parse data"| node_graph_types
node_indexer -->|"scans files"| node_registry
node_indexer -->|"builds graph"| node_graph_builder
node_graph_builder -->|"uses graph types"| node_graph_types
node_graph_builder -->|"analyzes reachability"| node_reachability
node_graph_builder -->|"collects warnings"| node_warnings
node_indexer -->|"checks file hashes"| node_hashing
node_indexer -->|"persists changes"| node_db_ops
node_db_ops -->|"writes index"| node_database
node_database -->|"initializes schema"| node_schema
node_query -->|"reads index"| node_database
node_api -->|"formats results"| node_formatter
node_formatter -->|"formats query output"| node_query
node_user -->|"uses agent tools"| node_dsh
node_dsh -->|"runs CLI query"| node_cli

click node_cli "https://github.com/angeloszou/graphlint/blob/main/graphlint/cli.py"
click node_api "https://github.com/angeloszou/graphlint/blob/main/graphlint/api.py"
click node_config "https://github.com/angeloszou/graphlint/blob/main/graphlint/config/manager.py"
click node_registry "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/registry.py"
click node_python "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/python/parser.py"
click node_rust "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/rust/parser.py"
click node_c_family "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/cfamily/__init__.py"
click node_csharp "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/csharp/parser.py"
click node_typescript "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/typescript/parser.py"
click node_graph_builder "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/graph.py"
click node_graph_types "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/_types.py"
click node_reachability "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/_graph_algo.py"
click node_warnings "https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/warnings.py"
click node_indexer "https://github.com/angeloszou/graphlint/blob/main/graphlint/incremental/indexer.py"
click node_db_ops "https://github.com/angeloszou/graphlint/blob/main/graphlint/incremental/_db_ops.py"
click node_database "https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/db.py"
click node_schema "https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/schema.py"
click node_hashing "https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/hashing.py"
click node_query "https://github.com/angeloszou/graphlint/blob/main/graphlint/query/engine.py"
click node_formatter "https://github.com/angeloszou/graphlint/blob/main/graphlint/query/formatter.py"
click node_dsh "https://github.com/angeloszou/graphlint/blob/main/integrations/dsh/src/tools/query.ts"

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_api,node_config toneBlue
class node_graph_builder,node_graph_types,node_reachability,node_warnings toneAmber
class node_registry,node_python,node_rust,node_c_family,node_csharp,node_typescript toneMint
class node_indexer,node_db_ops,node_database,node_schema,node_hashing,node_query,node_formatter toneRose
class node_dsh,node_user toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/angeloszou/graphlint/blob/main/graphlint/cli.py): `graphlint/cli.py`
- [Python API](https://github.com/angeloszou/graphlint/blob/main/graphlint/api.py): `graphlint/api.py`
- [Project config](https://github.com/angeloszou/graphlint/blob/main/graphlint/config/manager.py): `graphlint/config/manager.py`

### Graph analysis

- [Graph builder](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/graph.py): `graphlint/analyzer/graph.py`
- [Graph data types](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/_types.py): `graphlint/analyzer/_types.py`
- [Reachability analysis](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/_graph_algo.py): `graphlint/analyzer/_graph_algo.py`
- [Warning detection](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/warnings.py): `graphlint/analyzer/warnings.py`

### Language backends

- [Language registry](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/registry.py): `graphlint/analyzer/language/registry.py`
- [Python analyzer](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/python/parser.py): `graphlint/analyzer/language/python/parser.py`
- [Rust analyzer](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/rust/parser.py): `graphlint/analyzer/language/rust/parser.py`
- [C/C++ analyzer](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/cfamily/__init__.py): `graphlint/analyzer/language/cfamily/__init__.py`
- [C# analyzer](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/csharp/parser.py): `graphlint/analyzer/language/csharp/parser.py`
- [TS/JS analyzer](https://github.com/angeloszou/graphlint/blob/main/graphlint/analyzer/language/typescript/parser.py): `graphlint/analyzer/language/typescript/parser.py`

### Index and queries

- [Incremental indexer](https://github.com/angeloszou/graphlint/blob/main/graphlint/incremental/indexer.py): `graphlint/incremental/indexer.py`
- [Index persistence](https://github.com/angeloszou/graphlint/blob/main/graphlint/incremental/_db_ops.py): `graphlint/incremental/_db_ops.py`
- [SQLite index](https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/db.py): `graphlint/storage/db.py`
- [Index schema](https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/schema.py): `graphlint/storage/schema.py`
- [File hashing](https://github.com/angeloszou/graphlint/blob/main/graphlint/storage/hashing.py): `graphlint/storage/hashing.py`
- [Query engine](https://github.com/angeloszou/graphlint/blob/main/graphlint/query/engine.py): `graphlint/query/engine.py`
- [Result formatting](https://github.com/angeloszou/graphlint/blob/main/graphlint/query/formatter.py): `graphlint/query/formatter.py`

### Agent integration

- [DSH tools](https://github.com/angeloszou/graphlint/blob/main/integrations/dsh/src/tools/query.ts): `integrations/dsh/src/tools/query.ts`

### Other components

- **Developer or agent**

## Connections

- Developer or agent → CLI: invokes (evidence: `graphlint/cli.py`)
- Developer or agent → Python API: calls (evidence: `README.md`)
- CLI → Python API: dispatches (evidence: `graphlint/cli.py`)
- Python API → Project config: loads config (evidence: `graphlint/api.py`)
- Python API → Incremental indexer: builds index (evidence: `graphlint/api.py`)
- Python API → Query engine: runs queries (evidence: `graphlint/api.py`)
- Python API → Language registry: creates registry (evidence: `graphlint/api.py`)
- Language registry → Python analyzer: selects backend
- Language registry → Rust analyzer: selects backend
- Language registry → C/C++ analyzer: selects backend
- Language registry → C# analyzer: selects backend
- Language registry → TS/JS analyzer: selects backend
- Python analyzer → Graph data types: produces parse data (evidence: `graphlint/analyzer/language/python/parser.py`)
- Rust analyzer → Graph data types: produces parse data (evidence: `graphlint/analyzer/language/rust/parser.py`)
- C/C++ analyzer → Graph data types: produces parse data (evidence: `graphlint/analyzer/language/cfamily/__init__.py`)
- C# analyzer → Graph data types: produces parse data (evidence: `graphlint/analyzer/language/csharp/parser.py`)
- TS/JS analyzer → Graph data types: produces parse data (evidence: `graphlint/analyzer/language/typescript/parser.py`)
- Incremental indexer → Language registry: scans files (evidence: `graphlint/incremental/indexer.py`)
- Incremental indexer → Graph builder: builds graph (evidence: `graphlint/incremental/indexer.py`)
- Graph builder → Graph data types: uses graph types (evidence: `graphlint/analyzer/graph.py`)
- Graph builder → Reachability analysis: analyzes reachability (evidence: `graphlint/analyzer/graph.py`)
- Graph builder → Warning detection: collects warnings (evidence: `graphlint/analyzer/graph.py`)
- Incremental indexer → File hashing: checks file hashes (evidence: `graphlint/incremental/indexer.py`)
- Incremental indexer → Index persistence: persists changes (evidence: `graphlint/incremental/indexer.py`)
- Index persistence → SQLite index: writes index (evidence: `graphlint/incremental/_db_ops.py`)
- SQLite index → Index schema: initializes schema (evidence: `graphlint/storage/db.py`)
- Query engine → SQLite index: reads index (evidence: `graphlint/query/engine.py`)
- Python API → Result formatting: formats results (evidence: `graphlint/api.py`)
- Result formatting → Query engine: formats query output (evidence: `graphlint/query/formatter.py`)
- Developer or agent → DSH tools: uses agent tools (evidence: `README.md`)
- DSH tools → CLI: runs CLI query (evidence: `integrations/dsh/src/tools/query.ts`)
