# thanakorn-tata/testannouncement architecture

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

- Interactive diagram: https://gitdiagram.com/thanakorn-tata/testannouncement
- Repository: https://github.com/thanakorn-tata/testannouncement

## Overview

Announcement is a desktop energy-saving announcement utility with separate Windows and macOS implementations. Its principal workflow checks campaign dates and invocation mode, then shows either a tracked farewell popup or a toast notification. The Windows entry point also registers a Start Menu shortcut and dispatches to dedicated popup and toast components; the macOS script performs its own date/message selection and notification dispatch. The README provides no capability detail, so the macOS workflow is based on its sampled source; relationships not visible there are omitted.

Main entry points: [`Program.cs`](https://github.com/thanakorn-tata/testannouncement/blob/main/Program.cs) (Windows dispatcher), [`macos/main.py`](https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py) (macOS dispatcher), [`UI/MainPopupForm.cs`](https://github.com/thanakorn-tata/testannouncement/blob/main/UI/MainPopupForm.cs) (Farewell popup), [`Repositories/MessageRepository.cs`](https://github.com/thanakorn-tata/testannouncement/blob/main/Repositories/MessageRepository.cs) (Message repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_windows["Windows app"]
  node_win_entry["Windows dispatcher<br/>[Program.cs]"]
  node_campaign["Campaign tracking<br/>[Program.cs]"]
  node_shortcut["Shell shortcut<br/>[ShortcutService.cs]"]
  node_popup["Farewell popup<br/>[MainPopupForm.cs]"]
  node_toast["Windows toast<br/>[ToastService.cs]"]
end

subgraph group_macos["macOS app"]
  node_mac_entry["macOS dispatcher<br/>[main.py]"]
  node_mac_campaign["macOS campaign logic<br/>[main.py]"]
  node_mac_popup["macOS popup<br/>[main.py]"]
  node_mac_toast["macOS notification<br/>[main.py]"]
  node_mac_os["macOS notification service"]
end

subgraph group_content["Messages and settings"]
  node_settings["Toast settings"]
  node_messages["Message repository"]
end

node_user(("User or scheduler"))

node_user -->|"launches"| node_win_entry
node_win_entry -->|"reads settings"| node_settings
node_win_entry -->|"checks campaign"| node_campaign
node_win_entry -->|"ensures shortcut"| node_shortcut
node_win_entry -->|"opens popup"| node_popup
node_win_entry -->|"reads toast text"| node_messages
node_win_entry -->|"shows toast"| node_toast
node_popup -->|"renders message"| node_messages
node_user -->|"launches"| node_mac_entry
node_mac_entry -->|"checks dates"| node_mac_campaign
node_mac_entry -->|"opens popup"| node_mac_popup
node_mac_entry -->|"shows notification"| node_mac_toast
node_mac_toast -->|"invokes osascript"| node_mac_os

click node_win_entry "https://github.com/thanakorn-tata/testannouncement/blob/main/Program.cs"
click node_campaign "https://github.com/thanakorn-tata/testannouncement/blob/main/Program.cs"
click node_shortcut "https://github.com/thanakorn-tata/testannouncement/blob/main/Services/ShortcutService.cs"
click node_popup "https://github.com/thanakorn-tata/testannouncement/blob/main/UI/MainPopupForm.cs"
click node_toast "https://github.com/thanakorn-tata/testannouncement/blob/main/Services/ToastService.cs"
click node_settings "https://github.com/thanakorn-tata/testannouncement/blob/main/Configuration/AppSettingsManager.cs"
click node_messages "https://github.com/thanakorn-tata/testannouncement/blob/main/Repositories/MessageRepository.cs"
click node_mac_entry "https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py"
click node_mac_campaign "https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py"
click node_mac_popup "https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py"
click node_mac_toast "https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.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_win_entry,node_campaign,node_shortcut,node_popup,node_toast toneBlue
class node_mac_entry,node_mac_campaign,node_mac_popup,node_mac_toast,node_mac_os toneAmber
class node_settings,node_messages toneMint
class node_user toneRose
```

## Components

### Windows app

- [Windows dispatcher](https://github.com/thanakorn-tata/testannouncement/blob/main/Program.cs): `Program.cs`
- [Campaign tracking](https://github.com/thanakorn-tata/testannouncement/blob/main/Program.cs): `Program.cs`
- [Shell shortcut](https://github.com/thanakorn-tata/testannouncement/blob/main/Services/ShortcutService.cs): `Services/ShortcutService.cs`
- [Farewell popup](https://github.com/thanakorn-tata/testannouncement/blob/main/UI/MainPopupForm.cs): `UI/MainPopupForm.cs`
- [Windows toast](https://github.com/thanakorn-tata/testannouncement/blob/main/Services/ToastService.cs): `Services/ToastService.cs`

### macOS app

- [macOS dispatcher](https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py): `macos/main.py`
- [macOS campaign logic](https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py): `macos/main.py`
- [macOS popup](https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py): `macos/main.py`
- [macOS notification](https://github.com/thanakorn-tata/testannouncement/blob/main/macos/main.py): `macos/main.py`
- **macOS notification service**

### Messages and settings

- [Toast settings](https://github.com/thanakorn-tata/testannouncement/blob/main/Configuration/AppSettingsManager.cs): `Configuration/AppSettingsManager.cs`
- [Message repository](https://github.com/thanakorn-tata/testannouncement/blob/main/Repositories/MessageRepository.cs): `Repositories/MessageRepository.cs`

### Other components

- **User or scheduler**

## Connections

- User or scheduler → Windows dispatcher: launches (evidence: `Program.cs`)
- Windows dispatcher → Toast settings: reads settings (evidence: `Program.cs`)
- Windows dispatcher → Campaign tracking: checks campaign (evidence: `Program.cs`)
- Windows dispatcher → Shell shortcut: ensures shortcut (evidence: `Program.cs`)
- Windows dispatcher → Farewell popup: opens popup (evidence: `Program.cs`)
- Windows dispatcher → Message repository: reads toast text (evidence: `Program.cs`)
- Windows dispatcher → Windows toast: shows toast (evidence: `Program.cs`)
- Farewell popup → Message repository: renders message (evidence: `UI/MainPopupForm.cs`)
- User or scheduler → macOS dispatcher: launches (evidence: `macos/main.py`)
- macOS dispatcher → macOS campaign logic: checks dates (evidence: `macos/main.py`)
- macOS dispatcher → macOS popup: opens popup (evidence: `macos/main.py`)
- macOS dispatcher → macOS notification: shows notification (evidence: `macos/main.py`)
- macOS notification → macOS notification service: invokes osascript (evidence: `macos/main.py`)
