# thgossler/aztagger architecture

> Architecture diagram of the GitHub repository thgossler/aztagger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thgossler/aztagger
- Repository: https://github.com/thgossler/aztagger

## Overview

##### Main Components

a. Client-Side Components:
- WinForms UI Layer (MainForm, AzureContextConfigDialog, CustomToolTipForm, InputDialog)
- Model Layer (Resource, Tag, Settings, AzureContext, etc.)
- Service Layer (AzureService, LoggingService, SettingsService, TagTemplatesService)

b. External Services:
- Azure Resource Graph
- Azure Resource Manager
- Azure Identity (Entra ID)
- Azure Portal (for resource linking)

##### Component Relationships

**[User Interface Layer]**
- ↕
**[Service Layer]**
- ↕
**[Model Layer]**
- ↕
**[External Azure Services]**

##### Specific Design Elements

Use these visual elements:
- Blue rectangles for UI components
- Green rectangles for internal services
- Yellow rectangles for models
- Purple rectangles for external Azure services

##### Detailed Component Breakdown

UI Layer (Blue):

- MainForm       |
- Resource Grid
- Search UI   |
- Tag Editor  |

Service Layer (Green):

- AzureService     |
- SettingsService  |
- LoggingService   |
- TagTemplatesService|

Model Layer (Yellow):

- Resource         |
- Tag              |
- Settings         |
- AzureContext     |
- TagTemplate      |

External Services (Purple):

- Azure Resource Graph |
- Azure Resource Manager|
- Azure Identity      |

##### Important Notes

- File storage locations for settings and logs
- Authentication flow with Entra ID
- Async operations with appropriate symbols
- Separation between local and cloud operations

##### Technical Details

- .NET 9 Framework indication
- WinForms UI framework
- SeriLog integration for logging
- Local storage paths for configuration files
- Azure SDK dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px
    classDef model fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% UI Layer
    subgraph UI
        MainForm["MainForm"]
        AzureContextConfig["Azure Context Config"]
        CustomTooltip["Custom Tooltip"]
        InputDialog["Input Dialog"]
    end

    %% Service Layer
    subgraph Services
        AzureService["Azure Service"]
        LoggingService["Logging Service"]
        SettingsService["Settings Service"]
        TagTemplatesService["Tag Templates Service"]
    end

    %% Model Layer
    subgraph Models
        Resource["Resource Model"]
        Tag["Tag Model"]
        Settings["Settings Model"]
        AzureContext["Azure Context Model"]
        TagTemplate["Tag Template Model"]
        RecentSearch["Recent Search Model"]
        SavedSearch["Saved Search Model"]
    end

    %% External Services
    subgraph Azure
        ResourceGraph["Azure Resource Graph"]
        ResourceManager["Azure Resource Manager"]
        Identity["Azure Identity (Entra ID)"]
        Portal["Azure Portal"]
    end

    %% Storage
    LocalStorage[("Local Storage")]
    ErrorLog[("Error Log")]

    %% Relationships
    MainForm --> AzureService
    MainForm --> SettingsService
    MainForm --> LoggingService
    MainForm --> TagTemplatesService

    AzureService --> ResourceGraph
    AzureService --> ResourceManager
    AzureService --> Identity

    LoggingService --> ErrorLog
    SettingsService --> LocalStorage
    TagTemplatesService --> LocalStorage

    AzureService --> Resource
    AzureService --> Tag
    SettingsService --> Settings
    TagTemplatesService --> TagTemplate

    %% Click Events
    click MainForm "https://github.com/thgossler/AzTagger/blob/main/AzTagger/MainForm.cs"
    click AzureContextConfig "https://github.com/thgossler/AzTagger/blob/main/AzTagger/AzureContextConfigDialog.cs"
    click CustomTooltip "https://github.com/thgossler/AzTagger/blob/main/AzTagger/CustomToolTipForm.cs"
    click InputDialog "https://github.com/thgossler/AzTagger/blob/main/AzTagger/InputDialog.cs"
    click Resource "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/Resource.cs"
    click Tag "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/Tag.cs"
    click Settings "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/Settings.cs"
    click AzureContext "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/AzureContext.cs"
    click TagTemplate "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/TagTemplate.cs"
    click RecentSearch "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/RecentSearchItem.cs"
    click SavedSearch "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Models/SavedSearchItem.cs"
    click AzureService "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Services/AzureService.cs"
    click LoggingService "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Services/LoggingService.cs"
    click SettingsService "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Services/SettingsService.cs"
    click TagTemplatesService "https://github.com/thgossler/AzTagger/blob/main/AzTagger/Services/TagTemplatesService.cs"

    %% Style Applications
    class MainForm,AzureContextConfig,CustomTooltip,InputDialog ui
    class AzureService,LoggingService,SettingsService,TagTemplatesService service
    class Resource,Tag,Settings,AzureContext,TagTemplate,RecentSearch,SavedSearch model
    class ResourceGraph,ResourceManager,Identity,Portal external
    class LocalStorage,ErrorLog storage
```
