# v3ctr0r/sgb-lab-dist architecture

> Architecture diagram of the GitHub repository v3ctr0r/sgb-lab-dist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/v3ctr0r/sgb-lab-dist
- Repository: https://github.com/v3ctr0r/sgb-lab-dist

## Overview

SGB-LAB is a Windows workstation inventory and diagnostics product distributed as compiled server, dashboard, relay, and collector components alongside PowerShell installation and maintenance scripts. The main workflow is administrator-led installation, workstation enrollment, local collection, authenticated transmission, and centralized review. The README documents the product capabilities and high-level relationships; source excerpts were not provided, so the graph does not infer internal calls between scripts or binaries.

Main entry points: [`publicado-v030/Server/SgbServer.exe`](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/SgbServer.exe) (Server API), [`Instalar-SGB-LAB.ps1`](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Instalar-SGB-LAB.ps1) (Package installer), [`scripts/Perfis/Instalar-Servidor.ps1`](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Servidor.ps1) (Server profile), [`scripts/Perfis/Instalar-Laboratorio.ps1`](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Laboratorio.ps1) (Lab profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Deployment and trust"]
  node_install["Package installer"]
  node_server_profile["Server profile"]
  node_lab_profile["Lab profile"]
  node_ti_profile["TI profile<br/>[Instalar-TI.ps1]"]
  node_certificate["Certificate trust"]
end

subgraph group_collection["Workstation collection"]
  node_collector["Diagnostic collector<br/>[SgbService.exe]"]
  node_relay["Diagnostic relay<br/>[SgbRelay.exe]"]
end

subgraph group_central["Central inventory"]
  node_server["Server API<br/>[SgbServer.exe]"]
  node_dashboard["Web dashboard<br/>[index.html]"]
  node_database[("SQLite inventory<br/>[appsettings.json]")]
  node_ad_sync["Active Directory sync<br/>[appsettings.json]"]
end

subgraph group_operations["Maintenance"]
  node_updater["Server updater"]
  node_backup["Backup and recovery<br/>[BackupServidor.ps1]"]
  node_cert_export["Certificate export"]
end

node_admin(("Administrator"))

node_admin -->|"runs"| node_install
node_install -->|"selects profile"| node_server_profile
node_install -->|"selects profile"| node_lab_profile
node_install -->|"selects profile"| node_ti_profile
node_admin -->|"provisions trust"| node_certificate
node_lab_profile -->|"installs collector"| node_collector
node_lab_profile -->|"installs relay"| node_relay
node_relay -->|"sends diagnostics"| node_server
node_relay -->|"sends heartbeat"| node_server
node_server_profile -->|"installs server"| node_server
node_server_profile -->|"installs dashboard"| node_dashboard
node_server -->|"uses SQLite"| node_database
node_dashboard -->|"administers inventory"| node_server
node_server -.->|"supports sync"| node_ad_sync
node_admin -->|"updates server"| node_updater
node_admin -->|"backs up or restores"| node_backup
node_admin -->|"exports certificate"| node_cert_export

click node_install "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Instalar-SGB-LAB.ps1"
click node_server_profile "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Servidor.ps1"
click node_lab_profile "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Laboratorio.ps1"
click node_ti_profile "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-TI.ps1"
click node_certificate "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Confiar-Servidor.ps1"
click node_collector "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/payload/win-x64/SgbService.exe"
click node_relay "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Relay/SgbRelay.exe"
click node_server "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/SgbServer.exe"
click node_dashboard "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/wwwroot/index.html"
click node_database "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/appsettings.json"
click node_ad_sync "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/appsettings.json"
click node_updater "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Atualizar-Servidor.ps1"
click node_backup "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Instalacao/BackupServidor.ps1"
click node_cert_export "https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Exportar-Certificado-Servidor.ps1"

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_install,node_server_profile,node_lab_profile,node_ti_profile,node_certificate toneBlue
class node_collector,node_relay toneAmber
class node_server,node_dashboard,node_database,node_ad_sync toneMint
class node_updater,node_backup,node_cert_export toneRose
class node_admin toneIndigo
```

## Components

### Deployment and trust

- [Package installer](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Instalar-SGB-LAB.ps1): `Instalar-SGB-LAB.ps1`
- [Server profile](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Servidor.ps1): `scripts/Perfis/Instalar-Servidor.ps1`
- [Lab profile](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-Laboratorio.ps1): `scripts/Perfis/Instalar-Laboratorio.ps1`
- [TI profile](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Perfis/Instalar-TI.ps1): `scripts/Perfis/Instalar-TI.ps1`
- [Certificate trust](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Confiar-Servidor.ps1): `Confiar-Servidor.ps1`

### Workstation collection

- [Diagnostic collector](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/payload/win-x64/SgbService.exe): `payload/win-x64/SgbService.exe`
- [Diagnostic relay](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Relay/SgbRelay.exe): `publicado-v030/Relay/SgbRelay.exe`

### Central inventory

- [Server API](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/SgbServer.exe): `publicado-v030/Server/SgbServer.exe`
- [Web dashboard](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/wwwroot/index.html): `publicado-v030/Server/wwwroot/index.html`
- [SQLite inventory](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/appsettings.json): `publicado-v030/Server/appsettings.json`
- [Active Directory sync](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/publicado-v030/Server/appsettings.json): `publicado-v030/Server/appsettings.json`

### Maintenance

- [Server updater](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Atualizar-Servidor.ps1): `Atualizar-Servidor.ps1`
- [Backup and recovery](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/scripts/Instalacao/BackupServidor.ps1): `scripts/Instalacao/BackupServidor.ps1`
- [Certificate export](https://github.com/v3ctr0r/sgb-lab-dist/blob/main/Exportar-Certificado-Servidor.ps1): `Exportar-Certificado-Servidor.ps1`

### Other components

- **Administrator**

## Connections

- Administrator → Package installer: runs (evidence: `README.md`)
- Package installer → Server profile: selects profile (evidence: `README.md`)
- Package installer → Lab profile: selects profile (evidence: `README.md`)
- Package installer → TI profile: selects profile (evidence: `README.md`)
- Administrator → Certificate trust: provisions trust (evidence: `README.md`)
- Lab profile → Diagnostic collector: installs collector (evidence: `README.md`)
- Lab profile → Diagnostic relay: installs relay (evidence: `README.md`)
- Diagnostic relay → Server API: sends diagnostics (evidence: `README.md`)
- Diagnostic relay → Server API: sends heartbeat (evidence: `README.md`)
- Server profile → Server API: installs server (evidence: `README.md`)
- Server profile → Web dashboard: installs dashboard (evidence: `README.md`)
- Server API → SQLite inventory: uses SQLite (evidence: `README.md`)
- Web dashboard → Server API: administers inventory (evidence: `README.md`)
- Server API → Active Directory sync: supports sync (evidence: `README.md`)
- Administrator → Server updater: updates server (evidence: `README.md`)
- Administrator → Backup and recovery: backs up or restores (evidence: `README.md`)
- Administrator → Certificate export: exports certificate (evidence: `README.md`)
