# tanmaymundra/nestjs-dependency-analyzer architecture

> Architecture diagram of the GitHub repository tanmaymundra/nestjs-dependency-analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanmaymundra/nestjs-dependency-analyzer
- Repository: https://github.com/tanmaymundra/nestjs-dependency-analyzer

## Overview

##### Component Relationships

- Input → Processing → Output

- Double lines: Two-way communication

##### Specific Components

a. Input Components:
- Command Line Interface (analyze.command.ts)
- File System Reader
- Configuration Parser

b. Core Processing:
- AST Parser (ast.parser.ts)
- Dependency Analyzer (dependency.analyzer.ts)
- Module Type Definitions (modules.types.ts)

c. Output Handlers:
- DOT Visualizer (dot.visualizer.ts)
- JSON Formatter
- Graphviz Integration (external)

##### Additional Details

Annotations for:
- Supported file formats
- Configuration options
- Output format specifications
- External dependencies (Node.js, Graphviz)

##### Process Flow Indicators

Main workflow:
- CLI Input → File Reading → AST Parsing → Dependency Analysis → Visualization Generation → Output

##### Technical Specifications

- Required Node.js version (v14+)
- TypeScript compilation process
- Graphviz integration points
- Supported output formats (DOT, JSON)

##### Integration Points

Highlight:
- NestJS module integration
- TypeScript Compiler API usage
- Graphviz rendering pipeline
- File system interactions

Key Considerations:
- Modular nature of the tool
- Clear separation between analysis and visualization components
- Extension points for future features
- Optional components (like Graphviz integration)
- Error handling flows

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef input fill:#a8d1f0,stroke:#2c3e50
    classDef processing fill:#a8e6cf,stroke:#2c3e50
    classDef output fill:#ffd3b6,stroke:#2c3e50
    classDef external fill:#d3d3d3,stroke:#2c3e50

    %% Input Layer
    subgraph Input
        CLI["CLI Interface"]:::input
        FSR["File System Reader"]:::input
        Config["Configuration Parser"]:::input
        ProjFiles["Project Files Input"]:::input
    end

    %% Processing Layer
    subgraph Processing
        AST["AST Parser"]:::processing
        DA["Dependency Analyzer"]:::processing
        MTD["Module Type Definitions"]:::processing
        MR["Module Resolver"]:::processing
    end

    %% Output Layer
    subgraph Output
        DOT["DOT Visualizer"]:::output
        JSON["JSON Formatter"]:::output
        Graph["Graph Generation"]:::output
        Graphviz["Graphviz Integration"]:::external
    end

    %% Connections
    CLI --> FSR
    CLI --> Config
    FSR --> ProjFiles
    ProjFiles --> AST
    Config --> AST
    AST --> DA
    DA --> MTD
    MTD --> MR
    MR --> DOT
    MR --> JSON
    DOT --> Graphviz
    Graphviz --> Graph
    JSON --> Graph

    %% Click Events
    click CLI "https://github.com/Tanmaymundra/nestjs-dependency-analyzer/blob/main/src/cli/commands/analyze.command.ts"
    click AST "https://github.com/Tanmaymundra/nestjs-dependency-analyzer/blob/main/src/parsers/ast.parser.ts"
    click DA "https://github.com/Tanmaymundra/nestjs-dependency-analyzer/blob/main/src/analyzers/dependency.analyzer.ts"
    click MTD "https://github.com/Tanmaymundra/nestjs-dependency-analyzer/blob/main/src/types/modules.types.ts"
    click DOT "https://github.com/Tanmaymundra/nestjs-dependency-analyzer/blob/main/src/visualizers/dot.visualizer.ts"

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Output Components"]:::output
        L4["External Tools"]:::external
    end
```
