# tanveer290/iot_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/tanveer290/iot_management_system
- Repository: https://github.com/tanveer290/iot_management_system

## Overview

This is a .NET console backend for registering devices, recording and querying telemetry, and generating per-device health reports. The principal workflow runs from the console menu through service validation and repository operations to Entity Framework Core and SQL Server; health reporting combines each device with its latest telemetry. The graph preserves the documented device, telemetry, reporting, and logging capabilities. Some repository details are supported by the SOURCE INDEX rather than full excerpts, so only documented or indexed relationships are shown.

Main entry points: [`Program.cs`](https://github.com/tanveer290/iot_management_system/blob/main/Program.cs) (Menu and workflows), [`Services/HealthReportService.cs`](https://github.com/tanveer290/iot_management_system/blob/main/Services/HealthReportService.cs) (Health reports), [`Data/EFCoreDbContext.cs`](https://github.com/tanveer290/iot_management_system/blob/main/Data/EFCoreDbContext.cs) (EF Core context), [`Services/DeviceService.cs`](https://github.com/tanveer290/iot_management_system/blob/main/Services/DeviceService.cs) (Device management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console application"]
  node_console["Menu and workflows<br/>[Program.cs]"]
end

subgraph group_services["Service layer"]
  node_device_service["Device management<br/>[DeviceService.cs]"]
  node_device_contract["Device service contract<br/>[IDeviceService.cs]"]
  node_telemetry_service["Telemetry management"]
  node_telemetry_contract["Telemetry service contract"]
  node_health_service["Health reports"]
  node_health_contract["Health report contract"]
end

subgraph group_persistence["Persistence layer"]
  node_device_repository["Device persistence"]
  node_device_repo_contract["Device repository contract"]
  node_telemetry_repository["Telemetry persistence"]
  node_telemetry_repo_contract["Telemetry repository contract"]
  node_db_context["EF Core context<br/>[EFCoreDbContext.cs]"]
end

subgraph group_domain["Domain and logging"]
  node_device_model["Device model<br/>[Device.cs]"]
  node_telemetry_model["Telemetry model<br/>[Telemetry.cs]"]
  node_health_model["Health report model<br/>[HealthReport.cs]"]
  node_logger["Logger<br/>[Logger.cs]"]
end

node_operator(("Operator"))
node_sql_server[("SQL Server")]

node_operator -->|"uses"| node_console
node_console -->|"dispatches"| node_device_service
node_console -->|"dispatches"| node_telemetry_service
node_console -->|"requests reports"| node_health_service
node_console -->|"creates"| node_device_model
node_console -->|"creates"| node_telemetry_model
node_device_service -->|"calls"| node_device_repo_contract
node_telemetry_service -->|"calls"| node_telemetry_repo_contract
node_telemetry_service -->|"checks device"| node_device_repo_contract
node_health_service -->|"lists devices"| node_device_contract
node_health_service -->|"gets latest"| node_telemetry_contract
node_device_service -->|"implements"| node_device_contract
node_telemetry_service -->|"implements"| node_telemetry_contract
node_health_service -->|"implements"| node_health_contract
node_device_repo_contract -->|"implemented by"| node_device_repository
node_telemetry_repo_contract -->|"implemented by"| node_telemetry_repository
node_device_repository -->|"uses"| node_db_context
node_telemetry_repository -->|"uses"| node_db_context
node_db_context -->|"maps"| node_device_model
node_db_context -->|"maps"| node_telemetry_model
node_db_context -->|"configures"| node_sql_server
node_device_service -->|"logs"| node_logger
node_health_service -->|"logs"| node_logger
node_device_repository -->|"logs errors"| node_logger
node_telemetry_repository -->|"logs errors"| node_logger

click node_console "https://github.com/tanveer290/iot_management_system/blob/main/Program.cs"
click node_device_service "https://github.com/tanveer290/iot_management_system/blob/main/Services/DeviceService.cs"
click node_device_contract "https://github.com/tanveer290/iot_management_system/blob/main/Services/IDeviceService.cs"
click node_telemetry_service "https://github.com/tanveer290/iot_management_system/blob/main/Services/TelemetryService.cs"
click node_telemetry_contract "https://github.com/tanveer290/iot_management_system/blob/main/Services/ITelemetryService.cs"
click node_health_service "https://github.com/tanveer290/iot_management_system/blob/main/Services/HealthReportService.cs"
click node_health_contract "https://github.com/tanveer290/iot_management_system/blob/main/Services/IHealthReportService.cs"
click node_device_repository "https://github.com/tanveer290/iot_management_system/blob/main/Repositories/DeviceRepository.cs"
click node_device_repo_contract "https://github.com/tanveer290/iot_management_system/blob/main/Interfaces/IDeviceRepository.cs"
click node_telemetry_repository "https://github.com/tanveer290/iot_management_system/blob/main/Repositories/TelemetryRepository.cs"
click node_telemetry_repo_contract "https://github.com/tanveer290/iot_management_system/blob/main/Interfaces/ITelemetryRepository.cs"
click node_db_context "https://github.com/tanveer290/iot_management_system/blob/main/Data/EFCoreDbContext.cs"
click node_device_model "https://github.com/tanveer290/iot_management_system/blob/main/Models/Device.cs"
click node_telemetry_model "https://github.com/tanveer290/iot_management_system/blob/main/Models/Telemetry.cs"
click node_health_model "https://github.com/tanveer290/iot_management_system/blob/main/Models/HealthReport.cs"
click node_logger "https://github.com/tanveer290/iot_management_system/blob/main/Logger.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_console toneBlue
class node_device_service,node_device_contract,node_telemetry_service,node_telemetry_contract,node_health_service,node_health_contract,node_sql_server toneAmber
class node_device_repository,node_device_repo_contract,node_telemetry_repository,node_telemetry_repo_contract,node_db_context toneMint
class node_device_model,node_telemetry_model,node_health_model,node_logger toneRose
class node_operator toneIndigo
```

## Components

### Console application

- [Menu and workflows](https://github.com/tanveer290/iot_management_system/blob/main/Program.cs): `Program.cs`

### Service layer

- [Device management](https://github.com/tanveer290/iot_management_system/blob/main/Services/DeviceService.cs): `Services/DeviceService.cs`
- [Device service contract](https://github.com/tanveer290/iot_management_system/blob/main/Services/IDeviceService.cs): `Services/IDeviceService.cs`
- [Telemetry management](https://github.com/tanveer290/iot_management_system/blob/main/Services/TelemetryService.cs): `Services/TelemetryService.cs`
- [Telemetry service contract](https://github.com/tanveer290/iot_management_system/blob/main/Services/ITelemetryService.cs): `Services/ITelemetryService.cs`
- [Health reports](https://github.com/tanveer290/iot_management_system/blob/main/Services/HealthReportService.cs): `Services/HealthReportService.cs`
- [Health report contract](https://github.com/tanveer290/iot_management_system/blob/main/Services/IHealthReportService.cs): `Services/IHealthReportService.cs`

### Persistence layer

- [Device persistence](https://github.com/tanveer290/iot_management_system/blob/main/Repositories/DeviceRepository.cs): `Repositories/DeviceRepository.cs`
- [Device repository contract](https://github.com/tanveer290/iot_management_system/blob/main/Interfaces/IDeviceRepository.cs): `Interfaces/IDeviceRepository.cs`
- [Telemetry persistence](https://github.com/tanveer290/iot_management_system/blob/main/Repositories/TelemetryRepository.cs): `Repositories/TelemetryRepository.cs`
- [Telemetry repository contract](https://github.com/tanveer290/iot_management_system/blob/main/Interfaces/ITelemetryRepository.cs): `Interfaces/ITelemetryRepository.cs`
- [EF Core context](https://github.com/tanveer290/iot_management_system/blob/main/Data/EFCoreDbContext.cs): `Data/EFCoreDbContext.cs`

### Domain and logging

- [Device model](https://github.com/tanveer290/iot_management_system/blob/main/Models/Device.cs): `Models/Device.cs`
- [Telemetry model](https://github.com/tanveer290/iot_management_system/blob/main/Models/Telemetry.cs): `Models/Telemetry.cs`
- [Health report model](https://github.com/tanveer290/iot_management_system/blob/main/Models/HealthReport.cs): `Models/HealthReport.cs`
- [Logger](https://github.com/tanveer290/iot_management_system/blob/main/Logger.cs): `Logger.cs`

### Other components

- **Operator**
- **SQL Server**

## Connections

- Operator → Menu and workflows: uses (evidence: `README.md`)
- Menu and workflows → Device management: dispatches (evidence: `Program.cs`)
- Menu and workflows → Telemetry management: dispatches (evidence: `Program.cs`)
- Menu and workflows → Health reports: requests reports (evidence: `Program.cs`)
- Menu and workflows → Device model: creates (evidence: `Program.cs`)
- Menu and workflows → Telemetry model: creates (evidence: `Program.cs`)
- Device management → Device repository contract: calls (evidence: `Services/DeviceService.cs`)
- Telemetry management → Telemetry repository contract: calls (evidence: `Services/TelemetryService.cs`)
- Telemetry management → Device repository contract: checks device (evidence: `Services/TelemetryService.cs`)
- Health reports → Device service contract: lists devices (evidence: `Services/HealthReportService.cs`)
- Health reports → Telemetry service contract: gets latest (evidence: `Services/HealthReportService.cs`)
- Device management → Device service contract: implements (evidence: `Services/DeviceService.cs`)
- Telemetry management → Telemetry service contract: implements (evidence: `Services/TelemetryService.cs`)
- Health reports → Health report contract: implements (evidence: `Services/HealthReportService.cs`)
- Device repository contract → Device persistence: implemented by (evidence: `Repositories/DeviceRepository.cs`)
- Telemetry repository contract → Telemetry persistence: implemented by (evidence: `Repositories/TelemetryRepository.cs`)
- Device persistence → EF Core context: uses (evidence: `Repositories/DeviceRepository.cs`)
- Telemetry persistence → EF Core context: uses (evidence: `Repositories/TelemetryRepository.cs`)
- EF Core context → Device model: maps (evidence: `Data/EFCoreDbContext.cs`)
- EF Core context → Telemetry model: maps (evidence: `Data/EFCoreDbContext.cs`)
- EF Core context → SQL Server: configures (evidence: `README.md`)
- Device management → Logger: logs (evidence: `Services/DeviceService.cs`)
- Health reports → Logger: logs (evidence: `Services/HealthReportService.cs`)
- Device persistence → Logger: logs errors (evidence: `Repositories/DeviceRepository.cs`)
- Telemetry persistence → Logger: logs errors (evidence: `Repositories/TelemetryRepository.cs`)
