# kris-gray-28/brs-golf-monitor architecture

> Architecture diagram of the GitHub repository kris-gray-28/brs-golf-monitor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kris-gray-28/brs-golf-monitor
- Repository: https://github.com/kris-gray-28/brs-golf-monitor

## Overview

This is a Cowglen BRS tee-sheet monitor. Its runtime repeatedly checks BRS, filters tee times to a configured date and window, detects bookable empty four-balls, suppresses repeat alerts for already-notified times, and sends email. The workflow is implemented primarily in main.py, with SMTP delivery in mail_alert.py. The README also describes configurable course use. The inspector scripts are exploratory HTML tools, not part of the documented monitoring workflow. Edges reflect the shown calls; external BRS and SMTP behavior is represented only where the source makes requests or connects.

Main entry points: [`main.py`](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py) (Availability check), [`mail_alert.py`](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/mail_alert.py) (Email alert sender)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitor["Monitoring workflow"]
  node_poller["Polling loop<br/>[main.py]"]
  node_availability["Availability check<br/>[main.py]"]
  node_window["Window and 4-ball detection<br/>[main.py]"]
  node_alerted[("Alerted-time set<br/>[main.py]")]
end

subgraph group_alerts["Alert delivery"]
  node_mailer["Email alert sender<br/>[mail_alert.py]"]
end

node_operator(("Monitor operator"))
node_brs["BRS booking system"]
node_smtp["AOL SMTP"]
node_recipient(("Email recipient"))

node_operator -->|"starts"| node_poller
node_poller -->|"calls repeatedly"| node_availability
node_availability -->|"requests login and tee data"| node_brs
node_availability -->|"checks returned slots"| node_window
node_window -->|"checks and records times"| node_alerted
node_window -->|"sends alert"| node_mailer
node_mailer -->|"connects and sends"| node_smtp
node_smtp -->|"delivers email"| node_recipient

click node_poller "https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py"
click node_availability "https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py"
click node_window "https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py"
click node_alerted "https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py"
click node_mailer "https://github.com/kris-gray-28/brs-golf-monitor/blob/main/mail_alert.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_poller,node_availability,node_window,node_alerted toneBlue
class node_mailer toneAmber
class node_operator,node_brs,node_smtp,node_recipient toneIndigo
```

## Components

### Monitoring workflow

- [Polling loop](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py): `main.py`
- [Availability check](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py): `main.py`
- [Window and 4-ball detection](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py): `main.py`
- [Alerted-time set](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/main.py): `main.py`

### Alert delivery

- [Email alert sender](https://github.com/kris-gray-28/brs-golf-monitor/blob/main/mail_alert.py): `mail_alert.py`

### Other components

- **Monitor operator**
- **BRS booking system**
- **AOL SMTP**
- **Email recipient**

## Connections

- Monitor operator → Polling loop: starts (evidence: `README.md`)
- Polling loop → Availability check: calls repeatedly (evidence: `main.py`)
- Availability check → BRS booking system: requests login and tee data (evidence: `main.py`)
- Availability check → Window and 4-ball detection: checks returned slots (evidence: `main.py`)
- Window and 4-ball detection → Alerted-time set: checks and records times (evidence: `main.py`)
- Window and 4-ball detection → Email alert sender: sends alert (evidence: `main.py`)
- Email alert sender → AOL SMTP: connects and sends (evidence: `mail_alert.py`)
- AOL SMTP → Email recipient: delivers email
