# marcells/streamdeck-microsoft365 architecture

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

- Interactive diagram: https://gitdiagram.com/marcells/streamdeck-microsoft365
- Repository: https://github.com/marcells/streamdeck-microsoft365

## Overview

This Stream Deck plugin lets users configure a Microsoft app and account, then displays unread-mail or upcoming-calendar information on a button and opens the related Outlook destination when pressed. The runtime separates shared Graph authentication and account coordination from the mail and calendar actions; both actions render status through shared SVG icon code. README describes account setup and the user-facing behaviors. Property-inspector HTML files are present but not sampled, so their action-specific wiring is not detailed here.

Main entry points: [`Elgato.Plugins.Microsoft365/GraphAction{TSettings}.cs`](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAction%7BTSettings%7D.cs) (Graph action base), [`Elgato.Plugins.Microsoft365/MailAction.cs`](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/MailAction.cs) (Mail action), [`Elgato.Plugins.Microsoft365/CalendarAction.cs`](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/CalendarAction.cs) (Calendar action), [`Elgato.Plugins.Microsoft365/GraphAuthenticator.cs`](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAuthenticator.cs) (Graph authenticator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Plugin runtime"]
  node_entry["Plugin entry<br/>[Program.cs]"]
  node_actionbase["Graph action base"]
  node_notifier["Account notifier<br/>[ActionNotifier.cs]"]
  node_inspector["Property inspector<br/>[PropertyInspector]"]
  node_commonjs["Inspector socket logic<br/>[sdtools.common.js]"]
end

subgraph group_identity["Identity and accounts"]
  node_auth["Graph authenticator"]
  node_msidentity(("Microsoft identity"))
  node_graph(("Microsoft Graph"))
end

subgraph group_actions["Stream Deck actions"]
  node_mail["Mail action<br/>[MailAction.cs]"]
  node_calendar["Calendar action<br/>[CalendarAction.cs]"]
  node_outlook(("Outlook destination"))
end

subgraph group_presentation["Button presentation"]
  node_icon["SVG icon creator<br/>[IconCreator.cs]"]
  node_deckimage(("Stream Deck button"))
end

node_user(("Stream Deck user"))
node_host(("Stream Deck host"))

node_user -->|"configures actions"| node_host
node_host -->|"starts plugin"| node_entry
node_host -.->|"dispatches action events"| node_actionbase
node_actionbase -->|"initializes authentication"| node_auth
node_auth -->|"acquires tokens"| node_msidentity
node_auth -->|"creates Graph client"| node_graph
node_actionbase -->|"sends account data"| node_inspector
node_inspector -.->|"loads shared scripts"| node_commonjs
node_commonjs -->|"sends settings"| node_host
node_actionbase -->|"registers actions"| node_notifier
node_notifier -->|"notifies account removal"| node_actionbase
node_actionbase -.->|"hosts action"| node_mail
node_actionbase -.->|"hosts action"| node_calendar
node_mail -->|"queries unread mail"| node_graph
node_calendar -->|"queries calendar events"| node_graph
node_mail -->|"creates status image"| node_icon
node_calendar -->|"creates status image"| node_icon
node_icon -.->|"sets button image"| node_deckimage
node_mail -->|"opens inbox"| node_outlook
node_calendar -->|"opens calendar"| node_outlook
node_user -->|"sets app and account"| node_inspector

click node_entry "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/Program.cs"
click node_actionbase "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAction%7BTSettings%7D.cs"
click node_notifier "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/ActionNotifier.cs"
click node_inspector "https://github.com/marcells/streamdeck-microsoft365/tree/main/Elgato.Plugins.Microsoft365/PropertyInspector"
click node_commonjs "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/PropertyInspector/sdtools.common.js"
click node_auth "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAuthenticator.cs"
click node_mail "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/MailAction.cs"
click node_calendar "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/CalendarAction.cs"
click node_icon "https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/IconCreator.cs"

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_entry,node_actionbase,node_notifier,node_inspector,node_commonjs,node_user toneBlue
class node_auth,node_msidentity,node_graph toneAmber
class node_mail,node_calendar,node_outlook toneMint
class node_icon,node_deckimage toneRose
class node_host toneIndigo
```

## Components

### Plugin runtime

- [Plugin entry](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/Program.cs): `Elgato.Plugins.Microsoft365/Program.cs`
- [Graph action base](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAction%7BTSettings%7D.cs): `Elgato.Plugins.Microsoft365/GraphAction{TSettings}.cs`
- [Account notifier](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/ActionNotifier.cs): `Elgato.Plugins.Microsoft365/ActionNotifier.cs`
- [Property inspector](https://github.com/marcells/streamdeck-microsoft365/tree/main/Elgato.Plugins.Microsoft365/PropertyInspector): `Elgato.Plugins.Microsoft365/PropertyInspector`
- [Inspector socket logic](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/PropertyInspector/sdtools.common.js): `Elgato.Plugins.Microsoft365/PropertyInspector/sdtools.common.js`

### Identity and accounts

- [Graph authenticator](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/GraphAuthenticator.cs): `Elgato.Plugins.Microsoft365/GraphAuthenticator.cs`
- **Microsoft identity**
- **Microsoft Graph**

### Stream Deck actions

- [Mail action](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/MailAction.cs): `Elgato.Plugins.Microsoft365/MailAction.cs`
- [Calendar action](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/CalendarAction.cs): `Elgato.Plugins.Microsoft365/CalendarAction.cs`
- **Outlook destination**

### Button presentation

- [SVG icon creator](https://github.com/marcells/streamdeck-microsoft365/blob/main/Elgato.Plugins.Microsoft365/IconCreator.cs): `Elgato.Plugins.Microsoft365/IconCreator.cs`
- **Stream Deck button**

### Other components

- **Stream Deck user**
- **Stream Deck host**

## Connections

- Stream Deck user → Stream Deck host: configures actions (evidence: `README.md`)
- Stream Deck host → Plugin entry: starts plugin (evidence: `Elgato.Plugins.Microsoft365/Program.cs`)
- Stream Deck host → Graph action base: dispatches action events
- Graph action base → Graph authenticator: initializes authentication (evidence: `Elgato.Plugins.Microsoft365/GraphAction{TSettings}.cs`)
- Graph authenticator → Microsoft identity: acquires tokens (evidence: `Elgato.Plugins.Microsoft365/GraphAuthenticator.cs`)
- Graph authenticator → Microsoft Graph: creates Graph client (evidence: `Elgato.Plugins.Microsoft365/GraphAuthenticator.cs`)
- Graph action base → Property inspector: sends account data (evidence: `Elgato.Plugins.Microsoft365/GraphAction{TSettings}.cs`)
- Property inspector → Inspector socket logic: loads shared scripts
- Inspector socket logic → Stream Deck host: sends settings (evidence: `Elgato.Plugins.Microsoft365/PropertyInspector/sdtools.common.js`)
- Graph action base → Account notifier: registers actions (evidence: `Elgato.Plugins.Microsoft365/GraphAction{TSettings}.cs`)
- Account notifier → Graph action base: notifies account removal (evidence: `Elgato.Plugins.Microsoft365/ActionNotifier.cs`)
- Graph action base → Mail action: hosts action
- Graph action base → Calendar action: hosts action
- Mail action → Microsoft Graph: queries unread mail (evidence: `Elgato.Plugins.Microsoft365/MailAction.cs`)
- Calendar action → Microsoft Graph: queries calendar events (evidence: `Elgato.Plugins.Microsoft365/CalendarAction.cs`)
- Mail action → SVG icon creator: creates status image (evidence: `Elgato.Plugins.Microsoft365/MailAction.cs`)
- Calendar action → SVG icon creator: creates status image (evidence: `Elgato.Plugins.Microsoft365/CalendarAction.cs`)
- SVG icon creator → Stream Deck button: sets button image
- Mail action → Outlook destination: opens inbox (evidence: `README.md`)
- Calendar action → Outlook destination: opens calendar (evidence: `README.md`)
- Stream Deck user → Property inspector: sets app and account (evidence: `README.md`)
