# borntoberoot/networkmanager architecture

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

- Interactive diagram: https://gitdiagram.com/borntoberoot/networkmanager
- Repository: https://github.com/borntoberoot/networkmanager

## Overview

##### Main Components
- User Interface (Presentation Layer): Represented by the WPF application in the “Source/NETworkManager” directory that contains Views, XAML, and controls. Also include the custom controls in “Source/NETworkManager.Controls” and the resource (styles, templates) folders.
- MVVM Layer: The “ViewModels” folder components that act as the mediator between the UI and business logic. They implement the Model-View-ViewModel pattern and coordinate with Models.
- Business Logic & Domain Models: All the core functionality is implemented in separate libraries such as “NETworkManager.Models”, “NETworkManager.Profiles”, “NETworkManager.Settings”, “NETworkManager.Converters”, “NETworkManager.Validators”, etc. These are responsible for managing network data, configuration, profiles (encrypted sets of hosts/networks), and interaction with external devices and protocols.
- Utility & Infrastructure: Modules in “NETworkManager.Utilities” provide helper methods (for file operations, encryption, IP handling, etc.) and “NETworkManager.Update”, “NETworkManager.Setup” handle update distribution and installation.
- External Integrations & Services: Identify integrations with remote system connections (Remote Desktop, PuTTY, PowerShell, TigerVNC, AWS Session Manager) and the network analysis functions (IPScanner, Ping Monitor, port scanning, traceroute, DNS lookup, SNMP, etc.). Also include external API interactions (e.g., ip-api.com for geo-IP lookups and GitHub for update checks).
- Website & Documentation: The “Website” directory is a separate component using Docusaurus. It hosts documentation, changelogs, and releases. This can be represented as an independent subsystem that interfaces with the overall project for user documentation and web-based downloads.
- Build & CI/CD Infrastructure: Although not part of runtime, include your continuous integration (AppVeyor workflows, GitHub Actions, dependency management files, scripts for Chocolatey, WinGet, etc.) to illustrate deployment and packaging aspects.

##### Relationships and Data Flow
- That ViewModels invoke functionality from the Models (which encapsulate the business logic for network operations, profiles, and settings).
- That Models and Utility components provide the methods for network scanning, remote connections, and data conversion/validation.
- Installer and updater mechanisms (derived from Setup and Update projects) which pull artifacts from build scripts and CI workflows, and then (via package managers) distribute the signed binaries.
- Website component as a separate block that is linked to the project repository through documentation and release cycles.

##### Architectural Patterns and Design Principles
- Use of the MVVM pattern that separates Views, ViewModels, and Models.
- Modular structure where each major feature (e.g., remote connection, network scanning, settings management) is encapsulated in its own assembly or namespace.
- Dependency injection or service location if applicable (common in large WPF projects) among the various modules.

##### Relevant Technologies and Frameworks
- .NET 8.x and WPF as the primary development framework for the desktop application.
- Use of XAML for UI design, and tools like Visual Studio or Rider for development.
- Integration of third-party libraries/frameworks like Dragablz (for tearable tabs), log4net (logging), MahApps.Metro (UI toolkit), and various converters/validators.
- External packages (Chocolatey, WinGet) and build/CI tools (AppVeyor, GitHub Actions) which support the packaging and distribution.

- Drill down within each layer: for instance, show that the Presentation layer includes various dialogs, controls, and resource/style files, while the Business Logic layer contains sub-modules for network scanning, remote connectivity, settings and profiles.
- A separate section for the ancillary components (documentation/website, CI/CD, packaging artifacts).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer (UI)
    subgraph "Presentation Layer (UI)"
        UI1["WPF UI (NETworkManager)"]:::ui
        UI2["Custom Controls (NETworkManager.Controls)"]:::ui
    end

    %% MVVM Layer
    subgraph "MVVM Layer"
        MVVM["ViewModels (NETworkManager)"]:::mvvm
    end

    %% Business Logic & Domain Models
    subgraph "Business Logic & Domain Models"
        MODELS["Models (NETworkManager.Models)"]:::business
        PROFILES["Profiles (NETworkManager.Profiles)"]:::business
        SETTINGS["Settings (NETworkManager.Settings)"]:::business
        CONVERTERS["Converters (NETworkManager.Converters)"]:::business
        VALIDATORS["Validators (NETworkManager.Validators)"]:::business
    end

    %% Utility & Infrastructure
    subgraph "Utility & Infrastructure"
        UTIL["Utilities (NETworkManager.Utilities)"]:::infra
        UTILWPF["WPF Utilities (NETworkManager.Utilities.WPF)"]:::infra
        UPDATE["Update Service (NETworkManager.Update)"]:::infra
        SETUP["Setup Installer (NETworkManager.Setup)"]:::infra
    end

    %% External Integrations & Services
    subgraph "External Integrations & Services"
        AWS["AWS (NETworkManager.Models/AWS)"]:::external
        PUTTY["PuTTY (NETworkManager.Models/PuTTY)"]:::external
        RDP["Remote Desktop (NETworkManager.Models/RemoteDesktop)"]:::external
        VNC["TigerVNC (NETworkManager.Models/TigerVNC)"]:::external
    end

    %% Ancillary Components
    subgraph "Ancillary Components"
        subgraph "Website & Documentation"
            WEBSITE["Documentation Website (Website)"]:::doc
            DOC["Documentation Resources (NETworkManager.Documentation)"]:::doc
        end
        subgraph "Build & CI/CD Infrastructure"
            GITHUB["GitHub Actions (.github)"]:::cicd
            APVEY["AppVeyor (appveyor.yml)"]:::cicd
            CHOC["Chocolatey Packaging (Chocolatey)"]:::cicd
            WINGET["WinGet Manifests (WinGet)"]:::cicd
            SCRIPTS["Automation Scripts (Scripts)"]:::cicd
        end
    end

    %% Connections
    UI1 -->|"binds to"| MVVM
    UI2 -->|"binds to"| MVVM

    MVVM -->|"invokes"| MODELS
    MVVM -->|"invokes"| PROFILES
    MVVM -->|"invokes"| SETTINGS
    MVVM -->|"invokes"| CONVERTERS
    MVVM -->|"invokes"| VALIDATORS

    MODELS -->|"integrates with"| AWS
    MODELS -->|"integrates with"| PUTTY
    MODELS -->|"integrates with"| RDP
    MODELS -->|"integrates with"| VNC

    MODELS -->|"uses"| UTIL
    PROFILES -->|"uses"| UTIL
    SETTINGS -->|"uses"| UTIL
    CONVERTERS -->|"uses"| UTIL
    VALIDATORS -->|"uses"| UTIL

    UTILWPF -->|"supports"| UI1

    UTIL -->|"feeds"| UPDATE
    UPDATE -->|"triggers"| SETUP

    UPDATE -->|"notifies"| GITHUB
    UPDATE -->|"notifies"| APVEY
    SETUP -->|"packages via"| CHOC
    SETUP -->|"packages via"| WINGET
    SCRIPTS -->|"automates"| GITHUB
    SCRIPTS -->|"automates"| APVEY
    SCRIPTS -->|"updates"| WEBSITE

    %% Styling
    classDef ui fill:#ADD8E6,stroke:#1E90FF,stroke-width:2px;
    classDef mvvm fill:#FFD700,stroke:#DAA520,stroke-width:2px;
    classDef business fill:#90EE90,stroke:#32CD32,stroke-width:2px;
    classDef infra fill:#FFA07A,stroke:#FF4500,stroke-width:2px;
    classDef external fill:#AFEEEE,stroke:#008B8B,stroke-width:2px;
    classDef doc fill:#E6E6FA,stroke:#9370DB,stroke-width:2px;
    classDef cicd fill:#DDA0DD,stroke:#9932CC,stroke-width:2px;

    %% Click Events
    click UI1 "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager"
    click UI2 "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Controls"
    click MVVM "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager/ViewModels"
    click MODELS "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Models"
    click PROFILES "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Profiles"
    click SETTINGS "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Settings"
    click CONVERTERS "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Converters"
    click VALIDATORS "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Validators"
    click UTIL "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Utilities"
    click UTILWPF "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Utilities.WPF"
    click UPDATE "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Update"
    click SETUP "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Setup"
    click AWS "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager.Models/AWS"
    click PUTTY "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager.Models/PuTTY"
    click RDP "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager.Models/RemoteDesktop"
    click VNC "https://github.com/borntoberoot/networkmanager/tree/main/Source/NETworkManager.Models/TigerVNC"
    click WEBSITE "https://github.com/borntoberoot/networkmanager/tree/main/Website"
    click DOC "https://github.com/borntoberoot/networkmanager/blob/main/Source/NETworkManager.Documentation"
    click GITHUB "https://github.com/borntoberoot/networkmanager/blob/main/.github"
    click APVEY "https://github.com/borntoberoot/networkmanager/blob/main/appveyor.yml"
    click CHOC "https://github.com/borntoberoot/networkmanager/tree/main/Chocolatey"
    click WINGET "https://github.com/borntoberoot/networkmanager/tree/main/WinGet"
    click SCRIPTS "https://github.com/borntoberoot/networkmanager/tree/main/Scripts"
```
