# zynthasius39/homeops architecture

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

- Interactive diagram: https://gitdiagram.com/zynthasius39/homeops
- Repository: https://github.com/zynthasius39/homeops

## Overview

This repository is a self-hosted infrastructure and home-lab operations project: Terraform defines cloud, DNS, and cluster resources, while Ansible playbooks configure Kubernetes, hosts, and services. Its distinct firmware project runs Somnus, an ESP32 one-shot wake-on-LAN device that checks connectivity and reports through Telegram. The tree shows the infrastructure domains, but no README or playbook/Terraform excerpts were provided, so their internal invocation paths and dependencies are not asserted. Firmware relationships below are visible in the excerpted C source.

Main entry points: [`firmware/somnus/main/main.c`](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c) (Somnus Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_infra["Infrastructure"]
  node_cloudflare["Cloudflare Resources"]
  node_dns["DNS Records"]
  node_cluster_tf["Cluster Provisioning"]
end

subgraph group_cluster["Kubernetes"]
  node_cluster_playbooks["Cluster Configuration"]
end

subgraph group_hosts["Host Services"]
  node_monolit["Host Services"]
  node_opnsense["Firewall Services"]
end

subgraph group_firmware["Somnus Firmware"]
  node_somnus["Somnus Controller<br/>[main.c]"]
  node_wifi["Wi-Fi Setup<br/>[main.c]"]
  node_wifi_events["Wi-Fi Events<br/>[main.c]"]
  node_connectivity["Connectivity Check<br/>[main.c]"]
  node_wake_packet["Wake-on-LAN<br/>[main.c]"]
  node_sleep["Deep Sleep<br/>[main.c]"]
end

node_operator(("Operator"))
node_telegram["Telegram API"]
node_target_pc(("Target PC"))

node_somnus -->|"initializes"| node_wifi
node_wifi -->|"registers"| node_wifi_events
node_somnus -->|"waits for"| node_wifi_events
node_somnus -->|"checks"| node_connectivity
node_connectivity -->|"sends HTTPS"| node_telegram
node_somnus -->|"sends after delay"| node_wake_packet
node_wake_packet -->|"broadcasts packet"| node_target_pc
node_somnus -->|"notifies"| node_telegram
node_somnus -->|"enters after success"| node_sleep

click node_cloudflare "https://github.com/zynthasius39/homeops/tree/main/infra/cloudflare"
click node_dns "https://github.com/zynthasius39/homeops/tree/main/infra/dns"
click node_cluster_tf "https://github.com/zynthasius39/homeops/tree/main/infra/kluster"
click node_cluster_playbooks "https://github.com/zynthasius39/homeops/tree/main/playbooks/kluster"
click node_monolit "https://github.com/zynthasius39/homeops/tree/main/playbooks/monolit"
click node_opnsense "https://github.com/zynthasius39/homeops/tree/main/playbooks/opnsense"
click node_somnus "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"
click node_wifi "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"
click node_wifi_events "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"
click node_connectivity "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"
click node_wake_packet "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"
click node_sleep "https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c"

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_cloudflare,node_dns,node_cluster_tf toneBlue
class node_cluster_playbooks toneAmber
class node_monolit,node_opnsense,node_telegram toneMint
class node_somnus,node_wifi,node_wifi_events,node_connectivity,node_wake_packet,node_sleep toneRose
class node_operator,node_target_pc toneIndigo
```

## Components

### Infrastructure

- [Cloudflare Resources](https://github.com/zynthasius39/homeops/tree/main/infra/cloudflare): `infra/cloudflare`
- [DNS Records](https://github.com/zynthasius39/homeops/tree/main/infra/dns): `infra/dns`
- [Cluster Provisioning](https://github.com/zynthasius39/homeops/tree/main/infra/kluster): `infra/kluster`

### Kubernetes

- [Cluster Configuration](https://github.com/zynthasius39/homeops/tree/main/playbooks/kluster): `playbooks/kluster`

### Host Services

- [Host Services](https://github.com/zynthasius39/homeops/tree/main/playbooks/monolit): `playbooks/monolit`
- [Firewall Services](https://github.com/zynthasius39/homeops/tree/main/playbooks/opnsense): `playbooks/opnsense`

### Somnus Firmware

- [Somnus Controller](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`
- [Wi-Fi Setup](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`
- [Wi-Fi Events](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`
- [Connectivity Check](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`
- [Wake-on-LAN](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`
- [Deep Sleep](https://github.com/zynthasius39/homeops/blob/main/firmware/somnus/main/main.c): `firmware/somnus/main/main.c`

### Other components

- **Operator**
- **Telegram API**
- **Target PC**

## Connections

- Somnus Controller → Wi-Fi Setup: initializes (evidence: `firmware/somnus/main/main.c`)
- Wi-Fi Setup → Wi-Fi Events: registers (evidence: `firmware/somnus/main/main.c`)
- Somnus Controller → Wi-Fi Events: waits for (evidence: `firmware/somnus/main/main.c`)
- Somnus Controller → Connectivity Check: checks (evidence: `firmware/somnus/main/main.c`)
- Connectivity Check → Telegram API: sends HTTPS (evidence: `firmware/somnus/main/main.c`)
- Somnus Controller → Wake-on-LAN: sends after delay (evidence: `firmware/somnus/main/main.c`)
- Wake-on-LAN → Target PC: broadcasts packet (evidence: `firmware/somnus/main/main.c`)
- Somnus Controller → Telegram API: notifies (evidence: `firmware/somnus/main/main.c`)
- Somnus Controller → Deep Sleep: enters after success (evidence: `firmware/somnus/main/main.c`)
