# dan1k-dev/webmetrosr architecture

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

- Interactive diagram: https://gitdiagram.com/dan1k-dev/webmetrosr
- Repository: https://github.com/dan1k-dev/webmetrosr

## Overview

WebMetroSR is an internal web tool for looking up and administering Windows hosts, users, and printers. Users interact with a static browser UI and API controllers; controllers coordinate directory, device-information, printer, and remote-file operations, returning results to the browser. PowerShell execution and caching support several of these domain services, while MetroScope and SCCM provide separate lookup capabilities. The excerpts establish several controller-to-service and service-to-dependency calls; UI-to-API wiring and some service relationships are not shown, so those links are omitted or marked unverified.

Main entry points: [`WebMetroSR/Controllers/AdController.cs`](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Controllers/AdController.cs) (API controllers), [`WebMetroSR/Services/PowerShellService.cs`](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/PowerShellService.cs) (PowerShell execution), [`WebMetroSR/Services/AdService.cs`](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/AdService.cs) (Directory lookup), [`WebMetroSR/Services/WmiService.cs`](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/WmiService.cs) (Device information)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_browser["Browser UI<br/>[Index.html]"]
  node_client["Browser scripts<br/>[api.js]"]
  node_api["API controllers<br/>[AdController.cs]"]
  node_auth["Login and identity<br/>[AuthController.cs]"]
end

subgraph group_lookup["Host and directory"]
  node_ad["Directory lookup<br/>[AdService.cs]"]
  node_wmi["Device information<br/>[WmiService.cs]"]
  node_metro["MetroScope lookup"]
  node_sccm["SCCM lookup<br/>[SccmService.cs]"]
end

subgraph group_operations["Remote operations"]
  node_printers["Printer management<br/>[PrintersService.cs]"]
  node_files["Remote files and network<br/>[FileService.cs]"]
end

subgraph group_foundation["Shared services"]
  node_powershell["PowerShell execution"]
  node_cache[("Memory cache")]
  node_credentials["User credentials"]
end

node_user(("Administrator"))
node_directory{{"Active Directory"}}
node_host{{"Managed Windows host"}}

node_user -->|"uses"| node_browser
node_browser -.->|"loads"| node_client
node_client -.->|"requests"| node_api
node_api -->|"queries"| node_ad
node_api -->|"queries"| node_wmi
node_api -->|"looks up"| node_metro
node_api -->|"manages"| node_printers
node_api -->|"operates"| node_files
node_ad -->|"searches"| node_directory
node_ad -->|"runs scripts"| node_powershell
node_ad -->|"caches results"| node_cache
node_wmi -->|"runs scripts"| node_powershell
node_printers -->|"runs scripts"| node_powershell
node_files -->|"runs scripts"| node_powershell
node_powershell -->|"uses"| node_cache
node_powershell -->|"uses"| node_credentials
node_wmi -->|"inspects"| node_host
node_printers -->|"configures"| node_host
node_files -->|"accesses"| node_host
node_auth -->|"checks identity"| node_credentials

click node_browser "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/wwwroot/Index.html"
click node_client "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/wwwroot/js/api.js"
click node_api "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Controllers/AdController.cs"
click node_auth "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Controllers/AuthController.cs"
click node_ad "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/AdService.cs"
click node_wmi "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/WmiService.cs"
click node_metro "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/MetroScopeService.cs"
click node_sccm "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/SccmService.cs"
click node_printers "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/PrintersService.cs"
click node_files "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/FileService.cs"
click node_powershell "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/PowerShellService.cs"
click node_cache "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/MemoryCacheService.cs"
click node_credentials "https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/UserCredentialService.cs"

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_browser,node_client,node_api,node_auth toneBlue
class node_ad,node_wmi,node_metro,node_sccm toneAmber
class node_printers,node_files toneMint
class node_powershell,node_cache,node_credentials toneRose
class node_user,node_directory,node_host toneIndigo
```

## Components

### Web application

- [Browser UI](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/wwwroot/Index.html): `WebMetroSR/wwwroot/Index.html`
- [Browser scripts](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/wwwroot/js/api.js): `WebMetroSR/wwwroot/js/api.js`
- [API controllers](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Controllers/AdController.cs): `WebMetroSR/Controllers/AdController.cs`
- [Login and identity](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Controllers/AuthController.cs): `WebMetroSR/Controllers/AuthController.cs`

### Host and directory

- [Directory lookup](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/AdService.cs): `WebMetroSR/Services/AdService.cs`
- [Device information](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/WmiService.cs): `WebMetroSR/Services/WmiService.cs`
- [MetroScope lookup](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/MetroScopeService.cs): `WebMetroSR/Services/MetroScopeService.cs`
- [SCCM lookup](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/SccmService.cs): `WebMetroSR/Services/SccmService.cs`

### Remote operations

- [Printer management](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/PrintersService.cs): `WebMetroSR/Services/PrintersService.cs`
- [Remote files and network](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/FileService.cs): `WebMetroSR/Services/FileService.cs`

### Shared services

- [PowerShell execution](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/PowerShellService.cs): `WebMetroSR/Services/PowerShellService.cs`
- [Memory cache](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/MemoryCacheService.cs): `WebMetroSR/Services/MemoryCacheService.cs`
- [User credentials](https://github.com/dan1k-dev/webmetrosr/blob/master/WebMetroSR/Services/UserCredentialService.cs): `WebMetroSR/Services/UserCredentialService.cs`

### Other components

- **Administrator**
- **Active Directory**
- **Managed Windows host**

## Connections

- Administrator → Browser UI: uses
- Browser UI → Browser scripts: loads
- Browser scripts → API controllers: requests
- API controllers → Directory lookup: queries (evidence: `WebMetroSR/Controllers/AdController.cs`)
- API controllers → Device information: queries (evidence: `WebMetroSR/Controllers/AdController.cs`)
- API controllers → MetroScope lookup: looks up (evidence: `WebMetroSR/Controllers/AdController.cs`)
- API controllers → Printer management: manages (evidence: `WebMetroSR/Controllers/AdController.cs`)
- API controllers → Remote files and network: operates (evidence: `WebMetroSR/Controllers/AdController.cs`)
- Directory lookup → Active Directory: searches (evidence: `WebMetroSR/Services/AdService.cs`)
- Directory lookup → PowerShell execution: runs scripts (evidence: `WebMetroSR/Services/AdService.cs`)
- Directory lookup → Memory cache: caches results (evidence: `WebMetroSR/Services/AdService.cs`)
- Device information → PowerShell execution: runs scripts (evidence: `WebMetroSR/Services/WmiService.cs`)
- Printer management → PowerShell execution: runs scripts (evidence: `WebMetroSR/Services/PrintersService.cs`)
- Remote files and network → PowerShell execution: runs scripts (evidence: `WebMetroSR/Services/FileService.cs`)
- PowerShell execution → Memory cache: uses (evidence: `WebMetroSR/Services/PowerShellService.cs`)
- PowerShell execution → User credentials: uses (evidence: `WebMetroSR/Services/PowerShellService.cs`)
- Device information → Managed Windows host: inspects (evidence: `WebMetroSR/Services/WmiService.cs`)
- Printer management → Managed Windows host: configures (evidence: `WebMetroSR/Services/PrintersService.cs`)
- Remote files and network → Managed Windows host: accesses (evidence: `WebMetroSR/Services/FileService.cs`)
- Login and identity → User credentials: checks identity (evidence: `WebMetroSR/Controllers/AuthController.cs`)
