# apollo478/internship architecture

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

- Interactive diagram: https://gitdiagram.com/apollo478/internship
- Repository: https://github.com/apollo478/internship

## Overview

This is a remote site monitoring and management system with web and .NET MAUI clients, HTTP APIs, and shared domain services. The main workflow is users authenticate, select monitored enterprises/sites/assets, and retrieve tag or alarm history and KPI/report results; administrators also maintain users, permissions, configuration, and monitoring definitions. The tree documents reporting, scheduling, caching, and OPC/MQTT/SQL archiving capabilities. The README is empty, and sampled source is partial, so links for unsampled feature modules are limited to evident API and service boundaries.

Main entry points: [`RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs`](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs) (Historian context), [`RemoteManagementSystemDBWebAPI/Controllers`](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemDBWebAPI/Controllers) (Data API), [`RemoteManagementSystemApp/Controllers`](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemApp/Controllers) (Management API), [`RemoteManagementSystem.Web/Program.cs`](https://github.com/apollo478/internship/blob/main/RemoteManagementSystem.Web/Program.cs) (Web client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_web["Web client<br/>[Program.cs]"]
  node_shared["Shared UI services<br/>[Services]"]
  node_maui["MAUI host<br/>[MauiProgram.cs]"]
end

subgraph group_api["HTTP APIs"]
  node_appapi["Management API"]
  node_dbapi["Data API"]
end

subgraph group_domain["Monitoring domain"]
  node_users["User administration<br/>[UsersController.cs]"]
  node_alarms["Alarm history"]
  node_assets["Site and equipment"]
  node_definitions["Tags and definitions"]
  node_kpi["KPI history"]
  node_reports["Reports"]
  node_schedule["Report scheduling"]
  node_settings["Database settings"]
end

subgraph group_runtime["Shared services"]
  node_dbclient["API client"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_context["Historian context"]
  node_database[("Historian database")]
  node_archiver["Data archivers"]
  node_opc["OPC monitoring<br/>[OPCDAServer.cs]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_web
node_operator -->|"uses"| node_maui
node_web -->|"hosts"| node_shared
node_shared -->|"authenticates"| node_auth
node_auth -->|"verifies user"| node_dbclient
node_web -->|"requests data"| node_dbclient
node_dbclient -->|"HTTP requests"| node_dbapi
node_dbapi -->|"dispatches"| node_alarms
node_dbapi -->|"dispatches"| node_assets
node_dbapi -->|"dispatches"| node_definitions
node_dbapi -->|"dispatches"| node_kpi
node_dbapi -->|"dispatches"| node_users
node_appapi -->|"dispatches"| node_reports
node_appapi -->|"dispatches"| node_schedule
node_appapi -->|"dispatches"| node_users
node_users -->|"queries and saves"| node_context
node_alarms -->|"queries and saves"| node_context
node_assets -->|"queries and saves"| node_context
node_definitions -->|"queries and saves"| node_context
node_kpi -->|"queries and saves"| node_context
node_reports -->|"queries and saves"| node_context
node_schedule -->|"queries and saves"| node_context
node_settings -->|"configures access"| node_context
node_context -->|"reads and writes"| node_database
node_archiver -->|"archives data"| node_database
node_opc -->|"supplies events"| node_archiver

click node_web "https://github.com/apollo478/internship/blob/main/RemoteManagementSystem.Web/Program.cs"
click node_shared "https://github.com/apollo478/internship/tree/main/RemoteManagementSystem.Shared/Services"
click node_maui "https://github.com/apollo478/internship/blob/main/RemoteManagementSystem/MauiProgram.cs"
click node_dbclient "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/WebServiceClient/DBApiClientService.cs"
click node_auth "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Services/AuthService.cs"
click node_appapi "https://github.com/apollo478/internship/tree/main/RemoteManagementSystemApp/Controllers"
click node_dbapi "https://github.com/apollo478/internship/tree/main/RemoteManagementSystemDBWebAPI/Controllers"
click node_users "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/UsersController.cs"
click node_alarms "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/TagAlarmHistoriesController.cs"
click node_assets "https://github.com/apollo478/internship/tree/main/RemoteManagementSystemDBWebAPI/Controllers"
click node_definitions "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/TagDefinitionsController.cs"
click node_kpi "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/KpihistoriesController.cs"
click node_reports "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/ReportController.cs"
click node_schedule "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/ReportScheduleController.cs"
click node_context "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs"
click node_database "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs"
click node_archiver "https://github.com/apollo478/internship/tree/main/RemoteManagementSystemLibraryCore/Archiver"
click node_opc "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/OPCDAServer.cs"
click node_settings "https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/DatabaseSettingsController.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_web,node_shared,node_maui toneBlue
class node_appapi,node_dbapi toneAmber
class node_users,node_alarms,node_assets,node_definitions,node_kpi,node_reports,node_schedule,node_settings toneMint
class node_dbclient,node_auth,node_context,node_database,node_archiver,node_opc toneRose
class node_operator toneIndigo
```

## Components

### Client applications

- [Web client](https://github.com/apollo478/internship/blob/main/RemoteManagementSystem.Web/Program.cs): `RemoteManagementSystem.Web/Program.cs`
- [Shared UI services](https://github.com/apollo478/internship/tree/main/RemoteManagementSystem.Shared/Services): `RemoteManagementSystem.Shared/Services`
- [MAUI host](https://github.com/apollo478/internship/blob/main/RemoteManagementSystem/MauiProgram.cs): `RemoteManagementSystem/MauiProgram.cs`

### HTTP APIs

- [Management API](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemApp/Controllers): `RemoteManagementSystemApp/Controllers`
- [Data API](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemDBWebAPI/Controllers): `RemoteManagementSystemDBWebAPI/Controllers`

### Monitoring domain

- [User administration](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/UsersController.cs): `RemoteManagementSystemApp/Controllers/UsersController.cs`
- [Alarm history](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/TagAlarmHistoriesController.cs): `RemoteManagementSystemDBWebAPI/Controllers/TagAlarmHistoriesController.cs`
- [Site and equipment](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemDBWebAPI/Controllers): `RemoteManagementSystemDBWebAPI/Controllers`
- [Tags and definitions](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/TagDefinitionsController.cs): `RemoteManagementSystemDBWebAPI/Controllers/TagDefinitionsController.cs`
- [KPI history](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/KpihistoriesController.cs): `RemoteManagementSystemDBWebAPI/Controllers/KpihistoriesController.cs`
- [Reports](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/ReportController.cs): `RemoteManagementSystemApp/Controllers/ReportController.cs`
- [Report scheduling](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemApp/Controllers/ReportScheduleController.cs): `RemoteManagementSystemApp/Controllers/ReportScheduleController.cs`
- [Database settings](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemDBWebAPI/Controllers/DatabaseSettingsController.cs): `RemoteManagementSystemDBWebAPI/Controllers/DatabaseSettingsController.cs`

### Shared services

- [API client](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/WebServiceClient/DBApiClientService.cs): `RemoteManagementSystemLibraryCore/WebServiceClient/DBApiClientService.cs`
- [Authentication](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Services/AuthService.cs): `RemoteManagementSystemLibraryCore/Services/AuthService.cs`
- [Historian context](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs): `RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs`
- [Historian database](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs): `RemoteManagementSystemLibraryCore/Models/HistorianDbContext.cs`
- [Data archivers](https://github.com/apollo478/internship/tree/main/RemoteManagementSystemLibraryCore/Archiver): `RemoteManagementSystemLibraryCore/Archiver`
- [OPC monitoring](https://github.com/apollo478/internship/blob/main/RemoteManagementSystemLibraryCore/OPCDAServer.cs): `RemoteManagementSystemLibraryCore/OPCDAServer.cs`

### Other components

- **Operator**

## Connections

- Operator → Web client: uses
- Operator → MAUI host: uses
- Web client → Shared UI services: hosts
- Shared UI services → Authentication: authenticates
- Authentication → API client: verifies user
- Web client → API client: requests data
- API client → Data API: HTTP requests
- Data API → Alarm history: dispatches
- Data API → Site and equipment: dispatches
- Data API → Tags and definitions: dispatches
- Data API → KPI history: dispatches
- Data API → User administration: dispatches
- Management API → Reports: dispatches
- Management API → Report scheduling: dispatches
- Management API → User administration: dispatches
- User administration → Historian context: queries and saves
- Alarm history → Historian context: queries and saves
- Site and equipment → Historian context: queries and saves
- Tags and definitions → Historian context: queries and saves
- KPI history → Historian context: queries and saves
- Reports → Historian context: queries and saves
- Report scheduling → Historian context: queries and saves
- Database settings → Historian context: configures access
- Historian context → Historian database: reads and writes
- Data archivers → Historian database: archives data
- OPC monitoring → Data archivers: supplies events
