# emgeorrk/pulse architecture

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

- Interactive diagram: https://gitdiagram.com/emgeorrk/pulse
- Repository: https://github.com/emgeorrk/pulse

## Overview

Pulse is a native macOS menu-bar system monitor. The main workflow starts at the command entry point, probes available hardware, periodically samples sensors and computes metric snapshots, then presents pinned values and grouped details in the tray. Settings control sampling and display; optional capabilities include login launch and release notifications. The sensor package covers CPU, memory, network, disk, GPU, system, and battery readings, with dedicated HID/SMC temperature and IOReport power paths. Some wiring is documented only in the README or app excerpt; uncertain links are omitted.

Main entry points: [`internal/usecase/monitor.go`](https://github.com/emgeorrk/pulse/blob/main/internal/usecase/monitor.go) (Sampling and rates), [`internal/controller/tray/tray.go`](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/tray.go) (Tray interface), [`internal/app/app.go`](https://github.com/emgeorrk/pulse/blob/main/internal/app/app.go) (App orchestration), [`internal/controller/tray/registry.go`](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/registry.go) (Metric groups)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and settings"]
  node_entry["Pulse entry point<br/>[main.go]"]
  node_app["App orchestration<br/>[app.go]"]
  node_config["Settings store<br/>[config.go]"]
end

subgraph group_sampling["Monitoring and sensors"]
  node_metrics["Metric entities<br/>[metrics.go]"]
  node_monitor["Sampling and rates<br/>[monitor.go]"]
  node_tempcalc["Temperature aggregates<br/>[temps.go]"]
  node_sensorcore["System sensor readers"]
  node_battery["Battery reader<br/>[battery_darwin.go]"]
  node_smc["SMC sensors<br/>[smc_darwin.go]"]
  node_ioreport["IOReport power<br/>[ioreport_darwin.go]"]
end

subgraph group_presentation["Menu bar presentation"]
  node_tray["Tray interface<br/>[tray.go]"]
  node_registry["Metric groups<br/>[registry.go]"]
  node_sensorlabel["Temperature labels<br/>[sensorlabel.go]"]
  node_icons["Tray icons<br/>[icons.go]"]
  node_format["Metric formatting<br/>[format.go]"]
end

subgraph group_integrations["Optional integrations"]
  node_autostart["Login launch"]
  node_updates["Release checker<br/>[checker.go]"]
  node_publicip["Public IP lookup<br/>[publicip.go]"]
end

node_user(("Mac user"))
node_release_service(("Release service"))
node_ip_service(("IP lookup service"))

node_user -->|"launches"| node_entry
node_entry -->|"selects run mode"| node_app
node_app -->|"loads settings"| node_config
node_app -->|"probes hardware"| node_sensorcore
node_app -->|"creates monitor"| node_monitor
node_app -->|"starts interface"| node_tray
node_monitor -->|"reads interval"| node_config
node_monitor -->|"samples readings"| node_sensorcore
node_monitor -->|"builds snapshots"| node_metrics
node_monitor -->|"reads battery"| node_battery
node_monitor -.->|"reads fan data"| node_smc
node_monitor -.->|"reads power"| node_ioreport
node_monitor -.->|"aggregates temperatures"| node_tempcalc
node_tray -->|"updates settings"| node_config
node_tray -->|"builds metric groups"| node_registry
node_registry -->|"formats values"| node_format
node_registry -->|"selects icons"| node_icons
node_tray -->|"configures login"| node_autostart
node_tray -->|"checks releases"| node_updates
node_updates -.->|"checks versions"| node_release_service
node_monitor -->|"fetches address"| node_publicip
node_publicip -.->|"looks up address"| node_ip_service
node_sensorlabel -->|"classifies sensors"| node_tempcalc
node_tray -.->|"renders snapshots"| node_metrics

click node_entry "https://github.com/emgeorrk/pulse/blob/main/cmd/pulse/main.go"
click node_app "https://github.com/emgeorrk/pulse/blob/main/internal/app/app.go"
click node_config "https://github.com/emgeorrk/pulse/blob/main/config/config.go"
click node_metrics "https://github.com/emgeorrk/pulse/blob/main/internal/entity/metrics.go"
click node_monitor "https://github.com/emgeorrk/pulse/blob/main/internal/usecase/monitor.go"
click node_tempcalc "https://github.com/emgeorrk/pulse/blob/main/internal/usecase/temps.go"
click node_sensorcore "https://github.com/emgeorrk/pulse/tree/main/internal/sensors"
click node_battery "https://github.com/emgeorrk/pulse/blob/main/internal/sensors/battery_darwin.go"
click node_smc "https://github.com/emgeorrk/pulse/blob/main/internal/sensors/smc_darwin.go"
click node_ioreport "https://github.com/emgeorrk/pulse/blob/main/internal/sensors/ioreport_darwin.go"
click node_tray "https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/tray.go"
click node_registry "https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/registry.go"
click node_sensorlabel "https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/sensorlabel.go"
click node_icons "https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/icons/icons.go"
click node_format "https://github.com/emgeorrk/pulse/blob/main/pkg/format/format.go"
click node_autostart "https://github.com/emgeorrk/pulse/blob/main/internal/autostart/autostart_darwin.go"
click node_updates "https://github.com/emgeorrk/pulse/blob/main/internal/updatecheck/checker.go"
click node_publicip "https://github.com/emgeorrk/pulse/blob/main/internal/sensors/publicip.go"

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_app,node_config,node_user toneBlue
class node_metrics,node_monitor,node_tempcalc,node_sensorcore,node_battery,node_smc,node_ioreport toneAmber
class node_tray,node_registry,node_sensorlabel,node_icons,node_format toneMint
class node_autostart,node_updates,node_publicip toneRose
class node_release_service,node_ip_service toneIndigo
```

## Components

### Startup and settings

- [Pulse entry point](https://github.com/emgeorrk/pulse/blob/main/cmd/pulse/main.go): `cmd/pulse/main.go`
- [App orchestration](https://github.com/emgeorrk/pulse/blob/main/internal/app/app.go): `internal/app/app.go`
- [Settings store](https://github.com/emgeorrk/pulse/blob/main/config/config.go): `config/config.go`

### Monitoring and sensors

- [Metric entities](https://github.com/emgeorrk/pulse/blob/main/internal/entity/metrics.go): `internal/entity/metrics.go`
- [Sampling and rates](https://github.com/emgeorrk/pulse/blob/main/internal/usecase/monitor.go): `internal/usecase/monitor.go`
- [Temperature aggregates](https://github.com/emgeorrk/pulse/blob/main/internal/usecase/temps.go): `internal/usecase/temps.go`
- [System sensor readers](https://github.com/emgeorrk/pulse/tree/main/internal/sensors): `internal/sensors`
- [Battery reader](https://github.com/emgeorrk/pulse/blob/main/internal/sensors/battery_darwin.go): `internal/sensors/battery_darwin.go`
- [SMC sensors](https://github.com/emgeorrk/pulse/blob/main/internal/sensors/smc_darwin.go): `internal/sensors/smc_darwin.go`
- [IOReport power](https://github.com/emgeorrk/pulse/blob/main/internal/sensors/ioreport_darwin.go): `internal/sensors/ioreport_darwin.go`

### Menu bar presentation

- [Tray interface](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/tray.go): `internal/controller/tray/tray.go`
- [Metric groups](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/registry.go): `internal/controller/tray/registry.go`
- [Temperature labels](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/sensorlabel.go): `internal/controller/tray/sensorlabel.go`
- [Tray icons](https://github.com/emgeorrk/pulse/blob/main/internal/controller/tray/icons/icons.go): `internal/controller/tray/icons/icons.go`
- [Metric formatting](https://github.com/emgeorrk/pulse/blob/main/pkg/format/format.go): `pkg/format/format.go`

### Optional integrations

- [Login launch](https://github.com/emgeorrk/pulse/blob/main/internal/autostart/autostart_darwin.go): `internal/autostart/autostart_darwin.go`
- [Release checker](https://github.com/emgeorrk/pulse/blob/main/internal/updatecheck/checker.go): `internal/updatecheck/checker.go`
- [Public IP lookup](https://github.com/emgeorrk/pulse/blob/main/internal/sensors/publicip.go): `internal/sensors/publicip.go`

### Other components

- **Mac user**
- **Release service**
- **IP lookup service**

## Connections

- Mac user → Pulse entry point: launches (evidence: `README.md`)
- Pulse entry point → App orchestration: selects run mode (evidence: `cmd/pulse/main.go`)
- App orchestration → Settings store: loads settings (evidence: `internal/app/app.go`)
- App orchestration → System sensor readers: probes hardware (evidence: `internal/app/app.go`)
- App orchestration → Sampling and rates: creates monitor (evidence: `internal/app/app.go`)
- App orchestration → Tray interface: starts interface (evidence: `internal/app/app.go`)
- Sampling and rates → Settings store: reads interval (evidence: `internal/usecase/monitor.go`)
- Sampling and rates → System sensor readers: samples readings (evidence: `internal/usecase/monitor.go`)
- Sampling and rates → Metric entities: builds snapshots (evidence: `internal/usecase/monitor.go`)
- Sampling and rates → Battery reader: reads battery (evidence: `internal/usecase/monitor.go`)
- Sampling and rates → SMC sensors: reads fan data
- Sampling and rates → IOReport power: reads power
- Sampling and rates → Temperature aggregates: aggregates temperatures
- Tray interface → Settings store: updates settings (evidence: `internal/controller/tray/tray.go`)
- Tray interface → Metric groups: builds metric groups (evidence: `internal/controller/tray/tray.go`)
- Metric groups → Metric formatting: formats values (evidence: `internal/controller/tray/registry.go`)
- Metric groups → Tray icons: selects icons (evidence: `internal/controller/tray/registry.go`)
- Tray interface → Login launch: configures login (evidence: `internal/controller/tray/tray.go`)
- Tray interface → Release checker: checks releases (evidence: `internal/controller/tray/tray.go`)
- Release checker → Release service: checks versions
- Sampling and rates → Public IP lookup: fetches address (evidence: `internal/usecase/monitor.go`)
- Public IP lookup → IP lookup service: looks up address
- Temperature labels → Temperature aggregates: classifies sensors (evidence: `internal/controller/tray/sensorlabel.go`)
- Tray interface → Metric entities: renders snapshots
