# vegybs/windrose-monitor architecture

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

- Interactive diagram: https://gitdiagram.com/vegybs/windrose-monitor
- Repository: https://github.com/vegybs/windrose-monitor

## Overview

Windrose Server Monitor is a Python daemon that tracks player activity on a Pterodactyl-hosted server and sends Discord notifications. Its documented workflow obtains console logs through the Wings WebSocket (with an optional HTTP fallback), parses player sections, compares current players with persisted state, and reports joins, leaves, and count changes. The implementation is concentrated in one source file; the systemd unit provides the documented hardened service wrapper. Some internal connections below follow README workflow descriptions because the relevant source excerpts are incomplete.

Main entry points: [`windrose_monitor.py`](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py) (Monitor daemon), [`windrose-monitor.service`](https://github.com/vegybs/windrose-monitor/blob/main/windrose-monitor.service) (systemd service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Monitor runtime"]
  node_daemon["Monitor daemon"]
  node_config["Configuration"]
  node_log_buffer["Console log buffer"]
end

subgraph group_tracking["Player tracking"]
  node_parser["Player section parser"]
  node_player_state["Player state tracking"]
  node_state_file[("Persistent state")]
end

subgraph group_integrations["External integrations"]
  node_ws["WebSocket listener"]
  node_http_logs["HTTP log fallback"]
  node_notifications["Discord notifications"]
end

node_systemd["systemd service"]
node_pterodactyl["Pterodactyl Wings"]
node_discord["Discord webhook"]

node_systemd -->|"starts"| node_daemon
node_daemon -->|"loads"| node_config
node_daemon -->|"starts listener"| node_ws
node_ws -->|"connects to"| node_pterodactyl
node_ws -->|"buffers output"| node_log_buffer
node_daemon -->|"fetches logs"| node_http_logs
node_http_logs -->|"requests logs"| node_pterodactyl
node_log_buffer -.->|"supplies lines"| node_parser
node_daemon -.->|"parses logs"| node_parser
node_parser -.->|"identifies players"| node_player_state
node_player_state -->|"persists state"| node_state_file
node_player_state -.->|"creates updates"| node_notifications
node_notifications -->|"posts messages"| node_discord

click node_systemd "https://github.com/vegybs/windrose-monitor/blob/main/windrose-monitor.service"
click node_daemon "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_config "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_ws "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_http_logs "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_log_buffer "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_parser "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_player_state "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_state_file "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"
click node_notifications "https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py"

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_daemon,node_config,node_log_buffer toneBlue
class node_parser,node_player_state,node_state_file toneAmber
class node_ws,node_http_logs,node_notifications,node_discord toneMint
class node_systemd toneTeal
class node_pterodactyl toneIndigo
```

## Components

### Monitor runtime

- [Monitor daemon](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [Configuration](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [Console log buffer](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`

### Player tracking

- [Player section parser](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [Player state tracking](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [Persistent state](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`

### External integrations

- [WebSocket listener](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [HTTP log fallback](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`
- [Discord notifications](https://github.com/vegybs/windrose-monitor/blob/main/windrose_monitor.py): `windrose_monitor.py`

### Other components

- [systemd service](https://github.com/vegybs/windrose-monitor/blob/main/windrose-monitor.service): `windrose-monitor.service`
- **Pterodactyl Wings**
- **Discord webhook**

## Connections

- systemd service → Monitor daemon: starts (evidence: `README.md`)
- Monitor daemon → Configuration: loads (evidence: `windrose_monitor.py`)
- Monitor daemon → WebSocket listener: starts listener (evidence: `windrose_monitor.py`)
- WebSocket listener → Pterodactyl Wings: connects to (evidence: `README.md`)
- WebSocket listener → Console log buffer: buffers output (evidence: `windrose_monitor.py`)
- Monitor daemon → HTTP log fallback: fetches logs (evidence: `windrose_monitor.py`)
- HTTP log fallback → Pterodactyl Wings: requests logs (evidence: `windrose_monitor.py`)
- Console log buffer → Player section parser: supplies lines (evidence: `README.md`)
- Monitor daemon → Player section parser: parses logs (evidence: `README.md`)
- Player section parser → Player state tracking: identifies players (evidence: `README.md`)
- Player state tracking → Persistent state: persists state (evidence: `windrose_monitor.py`)
- Player state tracking → Discord notifications: creates updates (evidence: `README.md`)
- Discord notifications → Discord webhook: posts messages (evidence: `windrose_monitor.py`)
