# betoespinosa14/proj-uem-bt architecture

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

- Interactive diagram: https://gitdiagram.com/betoespinosa14/proj-uem-bt
- Repository: https://github.com/betoespinosa14/proj-uem-bt

## Overview

BEACON is a self-hosted, multi-tenant endpoint-management platform. An administrator enrolls endpoints from the web console; agents connect to the control plane, report inventory and telemetry, receive policy and commands, and return results. The server also supports compliance evaluation, scheduled tasks, usage reporting, audit history and outbound webhooks. The graph separates console, API, domain services, persistence and agent runtime. Some subsystem links are documented only at a high level; unsampled implementation details are not inferred.

Main entry points: [`internal/agent/conn/agent.go`](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/conn/agent.go) (Agent connection), [`internal/server/api/server.go`](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/api/server.go) (HTTP and WS API), [`internal/server/core/core.go`](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/core/core.go) (Core orchestration), [`internal/server/store`](https://github.com/betoespinosa14/proj-uem-bt/tree/main/internal/server/store) (Persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web console"]
  node_console_ui["Console pages"]
  node_api_client["Typed API client<br/>[api.ts]"]
end

subgraph group_control["Control plane"]
  node_api["HTTP and WS API<br/>[server.go]"]
  node_core["Core orchestration<br/>[core.go]"]
  node_store[("Persistence")]
end

subgraph group_domain["Management services"]
  node_audit["Audit log<br/>[audit.go]"]
  node_compliance["Compliance engine<br/>[rules.go]"]
  node_scheduler["Scheduled tasks<br/>[scheduler.go]"]
  node_webhooks["Webhook delivery<br/>[webhooks.go]"]
  node_hub["Live updates<br/>[hub.go]"]
end

subgraph group_agent["Endpoint agent"]
  node_agent_entry["Agent service<br/>[main.go]"]
  node_collector["Inventory collector<br/>[collect.go]"]
  node_connection["Agent connection<br/>[agent.go]"]
  node_protocol["Message protocol<br/>[protocol.go]"]
  node_commands["Command execution<br/>[exec.go]"]
  node_usage["Usage tracking<br/>[usage.go]"]
  node_agent_update["Agent updates<br/>[update.go]"]
end

node_admin(("Administrator"))
node_postgres[("PostgreSQL")]
node_siem_itsm(("SIEM / ITSM"))
node_endpoint(("Managed endpoint"))

node_admin -->|"manages fleet"| node_console_ui
node_console_ui -.->|"uses API"| node_api_client
node_api_client -->|"sends requests"| node_api
node_endpoint -->|"runs agent"| node_agent_entry
node_agent_entry -->|"collects facts"| node_collector
node_agent_entry -->|"starts runtime"| node_connection
node_connection -->|"collects inventory"| node_collector
node_connection -->|"sends messages"| node_protocol
node_collector -->|"builds inventory"| node_protocol
node_connection -->|"executes commands"| node_commands
node_connection -->|"tracks usage"| node_usage
node_connection -->|"updates agent"| node_agent_update
node_connection -->|"connects by WebSocket"| node_api
node_api -->|"dispatches management"| node_core
node_api -->|"serves data"| node_store
node_api -->|"records actions"| node_audit
node_api -->|"routes task requests"| node_scheduler
node_core -->|"reads and writes"| node_store
node_core -->|"evaluates rules"| node_compliance
node_core -->|"publishes updates"| node_hub
node_core -->|"emits events"| node_webhooks
node_scheduler -.->|"runs scheduled work"| node_core
node_webhooks -->|"loads hooks"| node_store
node_webhooks -->|"delivers events"| node_siem_itsm
node_store -->|"persists records"| node_postgres
node_api -->|"serves live updates"| node_hub

click node_console_ui "https://github.com/betoespinosa14/proj-uem-bt/tree/main/web/app/(console)"
click node_api_client "https://github.com/betoespinosa14/proj-uem-bt/blob/main/web/lib/api.ts"
click node_api "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/api/server.go"
click node_core "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/core/core.go"
click node_store "https://github.com/betoespinosa14/proj-uem-bt/tree/main/internal/server/store"
click node_audit "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/audit/audit.go"
click node_compliance "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/compliance/rules.go"
click node_scheduler "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/scheduler/scheduler.go"
click node_webhooks "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/notify/webhooks.go"
click node_hub "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/hub/hub.go"
click node_agent_entry "https://github.com/betoespinosa14/proj-uem-bt/blob/main/cmd/agent/main.go"
click node_collector "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/collect/collect.go"
click node_connection "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/conn/agent.go"
click node_protocol "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/protocol/protocol.go"
click node_commands "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/exec/exec.go"
click node_usage "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/usage/usage.go"
click node_agent_update "https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/update/update.go"

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_ui,node_api_client toneBlue
class node_api,node_core,node_store,node_postgres toneAmber
class node_audit,node_compliance,node_scheduler,node_webhooks,node_hub toneMint
class node_agent_entry,node_collector,node_connection,node_protocol,node_commands,node_usage,node_agent_update toneRose
class node_admin,node_siem_itsm,node_endpoint toneIndigo
```

## Components

### Web console

- [Console pages](https://github.com/betoespinosa14/proj-uem-bt/tree/main/web/app/(console)): `web/app/(console)`
- [Typed API client](https://github.com/betoespinosa14/proj-uem-bt/blob/main/web/lib/api.ts): `web/lib/api.ts`

### Control plane

- [HTTP and WS API](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/api/server.go): `internal/server/api/server.go`
- [Core orchestration](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/core/core.go): `internal/server/core/core.go`
- [Persistence](https://github.com/betoespinosa14/proj-uem-bt/tree/main/internal/server/store): `internal/server/store`

### Management services

- [Audit log](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/audit/audit.go): `internal/server/audit/audit.go`
- [Compliance engine](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/compliance/rules.go): `internal/server/compliance/rules.go`
- [Scheduled tasks](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/scheduler/scheduler.go): `internal/server/scheduler/scheduler.go`
- [Webhook delivery](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/notify/webhooks.go): `internal/server/notify/webhooks.go`
- [Live updates](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/server/hub/hub.go): `internal/server/hub/hub.go`

### Endpoint agent

- [Agent service](https://github.com/betoespinosa14/proj-uem-bt/blob/main/cmd/agent/main.go): `cmd/agent/main.go`
- [Inventory collector](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/collect/collect.go): `internal/agent/collect/collect.go`
- [Agent connection](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/conn/agent.go): `internal/agent/conn/agent.go`
- [Message protocol](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/protocol/protocol.go): `internal/protocol/protocol.go`
- [Command execution](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/exec/exec.go): `internal/agent/exec/exec.go`
- [Usage tracking](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/usage/usage.go): `internal/agent/usage/usage.go`
- [Agent updates](https://github.com/betoespinosa14/proj-uem-bt/blob/main/internal/agent/update/update.go): `internal/agent/update/update.go`

### Other components

- **Administrator**
- **PostgreSQL**
- **SIEM / ITSM**
- **Managed endpoint**

## Connections

- Administrator → Console pages: manages fleet (evidence: `README.md`)
- Console pages → Typed API client: uses API
- Typed API client → HTTP and WS API: sends requests (evidence: `README.md`)
- Managed endpoint → Agent service: runs agent (evidence: `README.md`)
- Agent service → Inventory collector: collects facts (evidence: `cmd/agent/main.go`)
- Agent service → Agent connection: starts runtime (evidence: `cmd/agent/main.go`)
- Agent connection → Inventory collector: collects inventory (evidence: `internal/agent/conn/agent.go`)
- Agent connection → Message protocol: sends messages (evidence: `internal/agent/conn/agent.go`)
- Inventory collector → Message protocol: builds inventory
- Agent connection → Command execution: executes commands (evidence: `internal/agent/conn/agent.go`)
- Agent connection → Usage tracking: tracks usage (evidence: `internal/agent/conn/agent.go`)
- Agent connection → Agent updates: updates agent (evidence: `internal/agent/conn/agent.go`)
- Agent connection → HTTP and WS API: connects by WebSocket (evidence: `README.md`)
- HTTP and WS API → Core orchestration: dispatches management (evidence: `internal/server/api/server.go`)
- HTTP and WS API → Persistence: serves data (evidence: `internal/server/api/server.go`)
- HTTP and WS API → Audit log: records actions
- HTTP and WS API → Scheduled tasks: routes task requests (evidence: `internal/server/api/server.go`)
- Core orchestration → Persistence: reads and writes (evidence: `internal/server/core/core.go`)
- Core orchestration → Compliance engine: evaluates rules (evidence: `internal/server/core/core.go`)
- Core orchestration → Live updates: publishes updates (evidence: `internal/server/core/core.go`)
- Core orchestration → Webhook delivery: emits events (evidence: `internal/server/core/core.go`)
- Scheduled tasks → Core orchestration: runs scheduled work
- Webhook delivery → Persistence: loads hooks (evidence: `internal/server/notify/webhooks.go`)
- Webhook delivery → SIEM / ITSM: delivers events (evidence: `README.md`)
- Persistence → PostgreSQL: persists records (evidence: `README.md`)
- HTTP and WS API → Live updates: serves live updates (evidence: `README.md`)
