# boredazfcuk/docker-icloudpd architecture

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

- Interactive diagram: https://gitdiagram.com/boredazfcuk/docker-icloudpd
- Repository: https://github.com/boredazfcuk/docker-icloudpd

## Overview

docker-icloudpd is a Dockerized iCloud Photos backup and synchronization service. Its main workflow is syncing photos from iCloud to local storage, with documented HEIC conversion and optional Nextcloud upload/delete synchronization. Separate capabilities include credential storage, local and Telegram-based reauthentication, Telegram-triggered sync, and notifications. The README documents these behaviors, but no runtime source excerpts were supplied, so links between scripts and feature implementations are limited to relationships the documentation states explicitly.

Main entry points: [`sync-icloud.sh`](https://github.com/boredazfcuk/docker-icloudpd/blob/master/sync-icloud.sh) (iCloud photo sync), [`reauth.sh`](https://github.com/boredazfcuk/docker-icloudpd/blob/master/reauth.sh) (Local reauthentication), [`launcher.sh`](https://github.com/boredazfcuk/docker-icloudpd/blob/master/launcher.sh) (Container launcher), [`authenticate.exp`](https://github.com/boredazfcuk/docker-icloudpd/blob/master/authenticate.exp) (Authentication setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sync["Photo sync"]
  node_launcher["Container launcher<br/>[launcher.sh]"]
  node_syncjob["iCloud photo sync<br/>[sync-icloud.sh]"]
  node_localfiles[("Local photo files")]
  node_conversion["HEIC conversion<br/>[sync-icloud.sh]"]
  node_healthcheck["Container health check<br/>[healthcheck.sh]"]
end

subgraph group_auth["Authentication and messaging"]
  node_keyring[("System keyring")]
  node_authscript["Authentication setup<br/>[authenticate.exp]"]
  node_reauth["Local reauthentication<br/>[reauth.sh]"]
  node_telegram["Telegram bot"]
  node_messages["Telegram messaging<br/>[sendmessage.sh]"]
end

subgraph group_integrations["Storage and notifications"]
  node_nextcloud["Nextcloud"]
  node_notifications["Notification services"]
end

node_user(("Container operator"))
node_icloud["iCloud Photos"]

node_user -->|"starts container"| node_launcher
node_launcher -->|"runs sync"| node_syncjob
node_syncjob -->|"downloads photos"| node_icloud
node_syncjob -->|"writes files"| node_localfiles
node_syncjob -->|"converts HEIC"| node_conversion
node_syncjob -.->|"uploads and syncs deletes"| node_nextcloud
node_conversion -->|"creates JPGs"| node_localfiles
node_conversion -.->|"uploads JPGs"| node_nextcloud
node_authscript -->|"stores credentials"| node_keyring
node_reauth -->|"renews authentication"| node_icloud
node_telegram -->|"requests sync"| node_syncjob
node_telegram -->|"submits MFA code"| node_reauth
node_messages -->|"sends messages"| node_telegram
node_syncjob -.->|"sends notifications"| node_notifications
node_user -->|"runs locally"| node_reauth

click node_launcher "https://github.com/boredazfcuk/docker-icloudpd/blob/master/launcher.sh"
click node_syncjob "https://github.com/boredazfcuk/docker-icloudpd/blob/master/sync-icloud.sh"
click node_conversion "https://github.com/boredazfcuk/docker-icloudpd/blob/master/sync-icloud.sh"
click node_authscript "https://github.com/boredazfcuk/docker-icloudpd/blob/master/authenticate.exp"
click node_reauth "https://github.com/boredazfcuk/docker-icloudpd/blob/master/reauth.sh"
click node_messages "https://github.com/boredazfcuk/docker-icloudpd/blob/master/sendmessage.sh"
click node_healthcheck "https://github.com/boredazfcuk/docker-icloudpd/blob/master/healthcheck.sh"

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_launcher,node_syncjob,node_localfiles,node_conversion,node_healthcheck toneBlue
class node_keyring,node_authscript,node_reauth,node_telegram,node_messages toneAmber
class node_nextcloud,node_notifications toneMint
class node_user,node_icloud toneIndigo
```

## Components

### Photo sync

- [Container launcher](https://github.com/boredazfcuk/docker-icloudpd/blob/master/launcher.sh): `launcher.sh`
- [iCloud photo sync](https://github.com/boredazfcuk/docker-icloudpd/blob/master/sync-icloud.sh): `sync-icloud.sh`
- **Local photo files**
- [HEIC conversion](https://github.com/boredazfcuk/docker-icloudpd/blob/master/sync-icloud.sh): `sync-icloud.sh`
- [Container health check](https://github.com/boredazfcuk/docker-icloudpd/blob/master/healthcheck.sh): `healthcheck.sh`

### Authentication and messaging

- **System keyring**
- [Authentication setup](https://github.com/boredazfcuk/docker-icloudpd/blob/master/authenticate.exp): `authenticate.exp`
- [Local reauthentication](https://github.com/boredazfcuk/docker-icloudpd/blob/master/reauth.sh): `reauth.sh`
- **Telegram bot**
- [Telegram messaging](https://github.com/boredazfcuk/docker-icloudpd/blob/master/sendmessage.sh): `sendmessage.sh`

### Storage and notifications

- **Nextcloud**
- **Notification services**

### Other components

- **Container operator**
- **iCloud Photos**

## Connections

- Container operator → Container launcher: starts container
- Container launcher → iCloud photo sync: runs sync
- iCloud photo sync → iCloud Photos: downloads photos
- iCloud photo sync → Local photo files: writes files
- iCloud photo sync → HEIC conversion: converts HEIC
- iCloud photo sync → Nextcloud: uploads and syncs deletes
- HEIC conversion → Local photo files: creates JPGs
- HEIC conversion → Nextcloud: uploads JPGs
- Authentication setup → System keyring: stores credentials
- Local reauthentication → iCloud Photos: renews authentication
- Telegram bot → iCloud photo sync: requests sync
- Telegram bot → Local reauthentication: submits MFA code
- Telegram messaging → Telegram bot: sends messages
- iCloud photo sync → Notification services: sends notifications
- Container operator → Local reauthentication: runs locally
