# bodunch/server-client-bacgroundapp- architecture

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

- Interactive diagram: https://gitdiagram.com/bodunch/server-client-bacgroundapp-
- Repository: https://github.com/bodunch/server-client-bacgroundapp-

## Overview

This repository implements a Windows PC-monitoring system: a background client collects static and changing machine data, sends it to a local HTTP server, and an admin panel browses clients and their reports. The server accepts reports, queues database work, and serves report endpoints; the panel polls those endpoints and presents static details or live-updating dynamic data. The README documents POST/JSON transfer on port 5000. Some collection, sending, and response modules are represented by their exact enclosing directories because their implementation was not excerpted.

Main entry points: [`Server/Server/Controllers/ReportController.cs`](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Controllers/ReportController.cs) (Report API), [`AdminPanel/AdminPanel/ViewModel/MainViewModel.cs`](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/ViewModel/MainViewModel.cs) (Admin view model), [`Server/Server/Data/AppDbContext.cs`](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/AppDbContext.cs) (EF data context), [`Client/Client/Worker.cs`](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Client/Client/Worker.cs) (Client worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Background client"]
  node_client_worker["Client worker<br/>[Worker.cs]"]
  node_pc_collection["PC data collection"]
  node_connection_capture["Connection capture<br/>[ConnectionsInfo.cs]"]
  node_static_senders["Static data senders"]
  node_dynamic_senders["Dynamic data senders"]
end

subgraph group_server["Reporting server"]
  node_report_api["Report API"]
  node_client_registry["Client registry helper<br/>[ClientHelper.cs]"]
  node_db_queue["Database work queue"]
  node_db_worker["Queue worker"]
end

subgraph group_storage["Persistence"]
  node_db_context["EF data context<br/>[AppDbContext.cs]"]
  node_db_entities[("Report entities")]
  node_client_entity["Client records<br/>[ClientsEntity.cs]"]
end

subgraph group_admin["Admin panel"]
  node_admin_window["Admin window<br/>[MainWindow.xaml.cs]"]
  node_admin_vm["Admin view model<br/>[MainViewModel.cs]"]
  node_static_models["Static report models"]
  node_dynamic_views["Dynamic report views"]
  node_text_display["Report display state"]
end

node_operator(("Administrator"))
node_local_http(("Local HTTP service"))

node_client_worker -->|"invokes initial sends"| node_static_senders
node_client_worker -->|"invokes periodic sends"| node_dynamic_senders
node_client_worker -.->|"uses collection modules"| node_pc_collection
node_dynamic_senders -->|"sends captured connections"| node_connection_capture
node_static_senders -->|"POSTs JSON reports"| node_report_api
node_dynamic_senders -->|"POSTs JSON reports"| node_report_api
node_local_http -->|"accepts requests"| node_report_api
node_report_api -->|"queues database work"| node_db_queue
node_report_api -->|"resolves client identity"| node_client_registry
node_report_api -->|"queries and saves"| node_db_context
node_db_worker -->|"reads queued work"| node_db_queue
node_db_worker -->|"executes work"| node_db_context
node_db_context -->|"maps report tables"| node_db_entities
node_db_context -->|"maps client records"| node_client_entity
node_operator -.->|"uses panel"| node_admin_window
node_admin_window -->|"sets view model"| node_admin_vm
node_admin_vm -->|"polls and requests reports"| node_local_http
node_admin_vm -->|"deserializes static data"| node_static_models
node_admin_vm -->|"dispatches data requests"| node_dynamic_views
node_dynamic_views -->|"fetches dynamic reports"| node_local_http
node_dynamic_views -->|"updates report display"| node_text_display

click node_client_worker "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Client/Client/Worker.cs"
click node_pc_collection "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/PCInfo"
click node_connection_capture "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Client/Client/Modules/PCInfo/ConnectionsInfo.cs"
click node_static_senders "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/ServerSend/StaticData"
click node_dynamic_senders "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/ServerSend/DynamicData"
click node_report_api "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Controllers/ReportController.cs"
click node_client_registry "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/ClientHelper.cs"
click node_db_queue "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/DbQueue/DatabaseQueueService.cs"
click node_db_worker "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/DbQueue/DatabaseQueueWorker.cs"
click node_db_context "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/AppDbContext.cs"
click node_db_entities "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Server/Server/Data/Entities"
click node_client_entity "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/Entities/ClientsEntity.cs"
click node_admin_window "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/MainWindow.xaml.cs"
click node_admin_vm "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/ViewModel/MainViewModel.cs"
click node_static_models "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/AdminPanel/AdminPanel/Model"
click node_dynamic_views "https://github.com/bodunch/server-client-bacgroundapp-/tree/main/AdminPanel/AdminPanel/ViewModel/DnmDataFromServer"
click node_text_display "https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/ViewModel/StaticInfoTextBox.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_client_worker,node_pc_collection,node_connection_capture,node_static_senders,node_dynamic_senders toneBlue
class node_report_api,node_client_registry,node_db_queue,node_db_worker toneAmber
class node_db_context,node_db_entities,node_client_entity toneMint
class node_admin_window,node_admin_vm,node_static_models,node_dynamic_views,node_text_display toneRose
class node_operator,node_local_http toneIndigo
```

## Components

### Background client

- [Client worker](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Client/Client/Worker.cs): `Client/Client/Worker.cs`
- [PC data collection](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/PCInfo): `Client/Client/Modules/PCInfo`
- [Connection capture](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Client/Client/Modules/PCInfo/ConnectionsInfo.cs): `Client/Client/Modules/PCInfo/ConnectionsInfo.cs`
- [Static data senders](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/ServerSend/StaticData): `Client/Client/Modules/ServerSend/StaticData`
- [Dynamic data senders](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Client/Client/Modules/ServerSend/DynamicData): `Client/Client/Modules/ServerSend/DynamicData`

### Reporting server

- [Report API](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Controllers/ReportController.cs): `Server/Server/Controllers/ReportController.cs`
- [Client registry helper](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/ClientHelper.cs): `Server/Server/Data/ClientHelper.cs`
- [Database work queue](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/DbQueue/DatabaseQueueService.cs): `Server/Server/Data/DbQueue/DatabaseQueueService.cs`
- [Queue worker](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/DbQueue/DatabaseQueueWorker.cs): `Server/Server/Data/DbQueue/DatabaseQueueWorker.cs`

### Persistence

- [EF data context](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/AppDbContext.cs): `Server/Server/Data/AppDbContext.cs`
- [Report entities](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/Server/Server/Data/Entities): `Server/Server/Data/Entities`
- [Client records](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/Server/Server/Data/Entities/ClientsEntity.cs): `Server/Server/Data/Entities/ClientsEntity.cs`

### Admin panel

- [Admin window](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/MainWindow.xaml.cs): `AdminPanel/AdminPanel/MainWindow.xaml.cs`
- [Admin view model](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/ViewModel/MainViewModel.cs): `AdminPanel/AdminPanel/ViewModel/MainViewModel.cs`
- [Static report models](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/AdminPanel/AdminPanel/Model): `AdminPanel/AdminPanel/Model`
- [Dynamic report views](https://github.com/bodunch/server-client-bacgroundapp-/tree/main/AdminPanel/AdminPanel/ViewModel/DnmDataFromServer): `AdminPanel/AdminPanel/ViewModel/DnmDataFromServer`
- [Report display state](https://github.com/bodunch/server-client-bacgroundapp-/blob/main/AdminPanel/AdminPanel/ViewModel/StaticInfoTextBox.cs): `AdminPanel/AdminPanel/ViewModel/StaticInfoTextBox.cs`

### Other components

- **Administrator**
- **Local HTTP service**

## Connections

- Client worker → Static data senders: invokes initial sends (evidence: `Client/Client/Worker.cs`)
- Client worker → Dynamic data senders: invokes periodic sends (evidence: `Client/Client/Worker.cs`)
- Client worker → PC data collection: uses collection modules
- Dynamic data senders → Connection capture: sends captured connections (evidence: `Client/Client/Modules/ServerSend/DynamicData/SendConnectionInfoToServer.cs`)
- Static data senders → Report API: POSTs JSON reports
- Dynamic data senders → Report API: POSTs JSON reports
- Local HTTP service → Report API: accepts requests
- Report API → Database work queue: queues database work (evidence: `Server/Server/Controllers/ReportController.cs`)
- Report API → Client registry helper: resolves client identity (evidence: `Server/Server/Controllers/ReportController.cs`)
- Report API → EF data context: queries and saves (evidence: `Server/Server/Controllers/ReportController.cs`)
- Queue worker → Database work queue: reads queued work (evidence: `Server/Server/Data/DbQueue/DatabaseQueueWorker.cs`)
- Queue worker → EF data context: executes work (evidence: `Server/Server/Data/DbQueue/DatabaseQueueWorker.cs`)
- EF data context → Report entities: maps report tables (evidence: `Server/Server/Data/AppDbContext.cs`)
- EF data context → Client records: maps client records (evidence: `Server/Server/Data/AppDbContext.cs`)
- Administrator → Admin window: uses panel
- Admin window → Admin view model: sets view model (evidence: `AdminPanel/AdminPanel/MainWindow.xaml.cs`)
- Admin view model → Local HTTP service: polls and requests reports (evidence: `AdminPanel/AdminPanel/ViewModel/MainViewModel.cs`)
- Admin view model → Static report models: deserializes static data (evidence: `AdminPanel/AdminPanel/ViewModel/MainViewModel.cs`)
- Admin view model → Dynamic report views: dispatches data requests (evidence: `AdminPanel/AdminPanel/ViewModel/MainViewModel.cs`)
- Dynamic report views → Local HTTP service: fetches dynamic reports (evidence: `AdminPanel/AdminPanel/ViewModel/DnmDataFromServer/DnmCpuInfoResp.cs`)
- Dynamic report views → Report display state: updates report display (evidence: `AdminPanel/AdminPanel/ViewModel/DnmDataFromServer/DnmCpuInfoResp.cs`)
