# snapshotmanager/snapm architecture

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

- Interactive diagram: https://gitdiagram.com/snapshotmanager/snapm
- Repository: https://github.com/snapshotmanager/snapm

## Overview

Snapm manages coordinated Linux snapshot sets through a CLI and a central manager, which resolves storage providers and coordinates snapshot operations. The product also supports boot/revert entries, scheduled snapshots with retention, and filesystem-difference reports. The graph emphasizes those documented capabilities and the source-indexed internal links; unsampled implementations are represented only where the tree or README supports them.

Main entry points: [`snapm/command.py`](https://github.com/snapshotmanager/snapm/blob/main/snapm/command.py) (Snapm CLI), [`snapm/manager/_manager.py`](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_manager.py) (Snapshot manager), [`snapm/fsdiff/engine.py`](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/engine.py) (Difference engine), [`snapm/fsdiff/treewalk.py`](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/treewalk.py) (Filesystem walker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["Snapm CLI<br/>[command.py]"]
  node_report["Tabular reports<br/>[report.py]"]
end

subgraph group_snapshots["Snapshot management"]
  node_manager["Snapshot manager<br/>[_manager.py]"]
  node_snapshot_model["Snapshot sets<br/>[_snapm.py]"]
  node_provider_loader["Provider loader<br/>[_loader.py]"]
  node_plugin_api["Provider interface<br/>[_plugin.py]"]
  node_lvm["LVM2 backend<br/>[lvm2.py]"]
  node_stratis["Stratis backend<br/>[stratis.py]"]
  node_stratis_lib["Stratis client<br/>[_data.py]"]
  node_mounts["Snapshot mounts<br/>[_mounts.py]"]
end

subgraph group_automation["Boot and scheduling"]
  node_boot["Boot entries<br/>[_boot.py]"]
  node_schedule["Schedule and retention<br/>[_schedule.py]"]
  node_timers["Timer support<br/>[_timers.py]"]
  node_calendar["Calendar schedules<br/>[_calendar.py]"]
end

subgraph group_differences["Filesystem differences"]
  node_diff_options["Diff options<br/>[options.py]"]
  node_treewalk["Filesystem walker<br/>[treewalk.py]"]
  node_filetypes["File type detection<br/>[filetypes.py]"]
  node_diff_engine["Difference engine<br/>[engine.py]"]
  node_change_detector["Change detection<br/>[changes.py]"]
  node_content_differ["Content comparison<br/>[contentdiff.py]"]
  node_diff_tree["Tree output<br/>[tree.py]"]
end

node_user(("Administrator"))
node_storage[("Linux storage")]
node_boom["boom-boot"]
node_systemd["systemd"]

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches"| node_manager
node_cli -->|"formats reports"| node_report
node_cli -.->|"sets options"| node_diff_options
node_cli -.->|"requests comparison"| node_diff_engine
node_manager -->|"manages sets"| node_snapshot_model
node_manager -->|"loads providers"| node_provider_loader
node_provider_loader -->|"loads interface"| node_plugin_api
node_lvm -->|"implements"| node_plugin_api
node_stratis -->|"implements"| node_plugin_api
node_stratis -->|"uses client"| node_stratis_lib
node_lvm -.->|"manages volumes"| node_storage
node_stratis -.->|"manages pools"| node_storage
node_manager -->|"coordinates boot"| node_boot
node_boot -.->|"creates entries"| node_boom
node_manager -->|"manages schedules"| node_schedule
node_schedule -->|"uses timers"| node_timers
node_timers -->|"integrates with"| node_systemd
node_timers -->|"uses calendar"| node_calendar
node_diff_options -->|"configures walk"| node_treewalk
node_treewalk -->|"detects types"| node_filetypes
node_diff_engine -->|"compares trees"| node_treewalk
node_diff_engine -->|"detects changes"| node_change_detector
node_diff_engine -->|"compares content"| node_content_differ
node_diff_engine -->|"renders tree"| node_diff_tree
node_treewalk -->|"uses mount data"| node_mounts

click node_cli "https://github.com/snapshotmanager/snapm/blob/main/snapm/command.py"
click node_report "https://github.com/snapshotmanager/snapm/blob/main/snapm/report.py"
click node_manager "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_manager.py"
click node_snapshot_model "https://github.com/snapshotmanager/snapm/blob/main/snapm/_snapm.py"
click node_provider_loader "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_loader.py"
click node_plugin_api "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/_plugin.py"
click node_lvm "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/lvm2.py"
click node_stratis "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/stratis.py"
click node_stratis_lib "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/stratislib/_data.py"
click node_boot "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_boot.py"
click node_schedule "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_schedule.py"
click node_timers "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_timers.py"
click node_calendar "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_calendar.py"
click node_diff_options "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/options.py"
click node_treewalk "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/treewalk.py"
click node_filetypes "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/filetypes.py"
click node_diff_engine "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/engine.py"
click node_change_detector "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/changes.py"
click node_content_differ "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/contentdiff.py"
click node_diff_tree "https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/tree.py"
click node_mounts "https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_mounts.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_cli,node_report toneBlue
class node_manager,node_snapshot_model,node_provider_loader,node_plugin_api,node_lvm,node_stratis,node_stratis_lib,node_mounts,node_storage toneAmber
class node_boot,node_schedule,node_timers,node_calendar toneMint
class node_diff_options,node_treewalk,node_filetypes,node_diff_engine,node_change_detector,node_content_differ,node_diff_tree toneRose
class node_user,node_boom,node_systemd toneIndigo
```

## Components

### User interface

- [Snapm CLI](https://github.com/snapshotmanager/snapm/blob/main/snapm/command.py): `snapm/command.py`
- [Tabular reports](https://github.com/snapshotmanager/snapm/blob/main/snapm/report.py): `snapm/report.py`

### Snapshot management

- [Snapshot manager](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_manager.py): `snapm/manager/_manager.py`
- [Snapshot sets](https://github.com/snapshotmanager/snapm/blob/main/snapm/_snapm.py): `snapm/_snapm.py`
- [Provider loader](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_loader.py): `snapm/manager/_loader.py`
- [Provider interface](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/_plugin.py): `snapm/manager/plugins/_plugin.py`
- [LVM2 backend](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/lvm2.py): `snapm/manager/plugins/lvm2.py`
- [Stratis backend](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/stratis.py): `snapm/manager/plugins/stratis.py`
- [Stratis client](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/plugins/stratislib/_data.py): `snapm/manager/plugins/stratislib/_data.py`
- [Snapshot mounts](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_mounts.py): `snapm/manager/_mounts.py`

### Boot and scheduling

- [Boot entries](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_boot.py): `snapm/manager/_boot.py`
- [Schedule and retention](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_schedule.py): `snapm/manager/_schedule.py`
- [Timer support](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_timers.py): `snapm/manager/_timers.py`
- [Calendar schedules](https://github.com/snapshotmanager/snapm/blob/main/snapm/manager/_calendar.py): `snapm/manager/_calendar.py`

### Filesystem differences

- [Diff options](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/options.py): `snapm/fsdiff/options.py`
- [Filesystem walker](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/treewalk.py): `snapm/fsdiff/treewalk.py`
- [File type detection](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/filetypes.py): `snapm/fsdiff/filetypes.py`
- [Difference engine](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/engine.py): `snapm/fsdiff/engine.py`
- [Change detection](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/changes.py): `snapm/fsdiff/changes.py`
- [Content comparison](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/contentdiff.py): `snapm/fsdiff/contentdiff.py`
- [Tree output](https://github.com/snapshotmanager/snapm/blob/main/snapm/fsdiff/tree.py): `snapm/fsdiff/tree.py`

### Other components

- **Administrator**
- **Linux storage**
- **boom-boot**
- **systemd**

## Connections

- Administrator → Snapm CLI: invokes
- Snapm CLI → Snapshot manager: dispatches (evidence: `snapm/command.py`)
- Snapm CLI → Tabular reports: formats reports (evidence: `snapm/command.py`)
- Snapm CLI → Diff options: sets options
- Snapm CLI → Difference engine: requests comparison
- Snapshot manager → Snapshot sets: manages sets (evidence: `snapm/manager/_manager.py`)
- Snapshot manager → Provider loader: loads providers (evidence: `snapm/manager/_manager.py`)
- Provider loader → Provider interface: loads interface (evidence: `snapm/manager/_loader.py`)
- LVM2 backend → Provider interface: implements (evidence: `snapm/manager/plugins/lvm2.py`)
- Stratis backend → Provider interface: implements (evidence: `snapm/manager/plugins/stratis.py`)
- Stratis backend → Stratis client: uses client (evidence: `snapm/manager/plugins/stratis.py`)
- LVM2 backend → Linux storage: manages volumes
- Stratis backend → Linux storage: manages pools
- Snapshot manager → Boot entries: coordinates boot (evidence: `snapm/manager/_manager.py`)
- Boot entries → boom-boot: creates entries
- Snapshot manager → Schedule and retention: manages schedules (evidence: `snapm/manager/_manager.py`)
- Schedule and retention → Timer support: uses timers (evidence: `snapm/manager/_schedule.py`)
- Timer support → systemd: integrates with (evidence: `snapm/manager/_timers.py`)
- Timer support → Calendar schedules: uses calendar (evidence: `snapm/manager/_timers.py`)
- Diff options → Filesystem walker: configures walk (evidence: `snapm/fsdiff/treewalk.py`)
- Filesystem walker → File type detection: detects types (evidence: `snapm/fsdiff/treewalk.py`)
- Difference engine → Filesystem walker: compares trees (evidence: `snapm/fsdiff/engine.py`)
- Difference engine → Change detection: detects changes (evidence: `snapm/fsdiff/engine.py`)
- Difference engine → Content comparison: compares content (evidence: `snapm/fsdiff/engine.py`)
- Difference engine → Tree output: renders tree (evidence: `snapm/fsdiff/engine.py`)
- Filesystem walker → Snapshot mounts: uses mount data (evidence: `snapm/fsdiff/treewalk.py`)
