# dulnindu123/database-backup-automation architecture

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

- Interactive diagram: https://gitdiagram.com/dulnindu123/database-backup-automation
- Repository: https://github.com/dulnindu123/database-backup-automation

## Overview

This is an enterprise SQL Server backup and disaster-recovery product. Operators configure backups through the desktop GUI or CLI; scheduled runs validate configuration, perform backup and encryption, and use the broker client to upload and report telemetry. Separate admin tools provision customer signing bundles, while recovery tools decrypt archives and run restore drills. The source excerpts and index establish the main client-side calls, but the README is empty and several listed subsystems were not sampled, so their internal connections are not asserted.

Main entry points: [`backup_core.py`](https://github.com/dulnindu123/database-backup-automation/blob/main/backup_core.py) (Backup engine), [`broker_client.py`](https://github.com/dulnindu123/database-backup-automation/blob/main/broker_client.py) (Broker client), [`preflight.py`](https://github.com/dulnindu123/database-backup-automation/blob/main/preflight.py) (Preflight validation), [`app_gui.py`](https://github.com/dulnindu123/database-backup-automation/blob/main/app_gui.py) (Desktop GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operation["Backup operation"]
  node_gui["Desktop GUI<br/>[app_gui.py]"]
  node_cli["Command-line app<br/>[cli_app.py]"]
  node_scheduler["Scheduled automation<br/>[auto_backup.py]"]
  node_engine["Backup engine<br/>[backup_core.py]"]
  node_version["Version identity<br/>[version.py]"]
end

subgraph group_security["Security and recovery"]
  node_crypto["Archive encryption<br/>[crypto_stream.py]"]
  node_restore["Restore drill"]
  node_recovery["Recovery tools<br/>[decrypt_gui.py]"]
end

subgraph group_broker["Broker and agents"]
  node_brokerclient["Broker client<br/>[broker_client.py]"]
  node_broker["Apps Script broker<br/>[Code.gs]"]
  node_pull["Backup pull tool<br/>[pull_backup.py]"]
  node_shell["Shell backup agent<br/>[backup_agent.ps1]"]
end

subgraph group_admin["Customer administration"]
  node_provision["Customer provisioning"]
  node_signing["Bundle signing<br/>[sign_bundle.py]"]
  node_batch["Batch provisioning"]
end

subgraph group_setup["Installation and validation"]
  node_preflight["Preflight validation<br/>[preflight.py]"]
  node_installer["Setup wizard<br/>[installer_gui.py]"]
end

node_operator(("Operator"))
node_sql["SQL Server"]
node_local[("Local backup files")]
node_cloud["Upload broker service"]

node_operator -->|"configures"| node_gui
node_operator -.->|"runs"| node_cli
node_gui -->|"uses"| node_engine
node_gui -->|"validates with"| node_preflight
node_gui -->|"uses"| node_brokerclient
node_cli -->|"uses"| node_engine
node_cli -->|"validates with"| node_preflight
node_cli -->|"uses"| node_brokerclient
node_scheduler -->|"runs"| node_engine
node_scheduler -->|"validates with"| node_preflight
node_scheduler -->|"uses"| node_brokerclient
node_engine -->|"encrypts with"| node_crypto
node_engine -->|"uses"| node_brokerclient
node_engine -->|"reads"| node_version
node_brokerclient -->|"uploads to"| node_cloud
node_preflight -->|"probes via"| node_brokerclient
node_installer -->|"validates with"| node_preflight
node_installer -->|"uses"| node_brokerclient
node_installer -->|"uses"| node_engine
node_provision -->|"builds signed bundle"| node_signing
node_batch -->|"uses"| node_signing
node_restore -->|"decrypts with"| node_crypto
node_restore -.->|"restores to"| node_sql
node_engine -.->|"backs up"| node_sql
node_engine -.->|"writes archives"| node_local
node_broker -.->|"provides endpoint"| node_cloud

click node_gui "https://github.com/dulnindu123/database-backup-automation/blob/main/app_gui.py"
click node_cli "https://github.com/dulnindu123/database-backup-automation/blob/main/cli_app.py"
click node_scheduler "https://github.com/dulnindu123/database-backup-automation/blob/main/auto_backup.py"
click node_engine "https://github.com/dulnindu123/database-backup-automation/blob/main/backup_core.py"
click node_crypto "https://github.com/dulnindu123/database-backup-automation/blob/main/crypto_stream.py"
click node_version "https://github.com/dulnindu123/database-backup-automation/blob/main/version.py"
click node_brokerclient "https://github.com/dulnindu123/database-backup-automation/blob/main/broker_client.py"
click node_broker "https://github.com/dulnindu123/database-backup-automation/blob/main/apps_script_broker/Code.gs"
click node_pull "https://github.com/dulnindu123/database-backup-automation/blob/main/apps_script_broker/pull_backup.py"
click node_shell "https://github.com/dulnindu123/database-backup-automation/blob/main/shell_client/backup_agent.ps1"
click node_preflight "https://github.com/dulnindu123/database-backup-automation/blob/main/preflight.py"
click node_installer "https://github.com/dulnindu123/database-backup-automation/blob/main/installer_gui.py"
click node_provision "https://github.com/dulnindu123/database-backup-automation/blob/main/Tools/setup_new_customer.py"
click node_signing "https://github.com/dulnindu123/database-backup-automation/blob/main/admin/sign_bundle.py"
click node_batch "https://github.com/dulnindu123/database-backup-automation/blob/main/Tools/batch_setup_customers.py"
click node_restore "https://github.com/dulnindu123/database-backup-automation/blob/main/admin_recovery_tool/admin_restore_drill.py"
click node_recovery "https://github.com/dulnindu123/database-backup-automation/blob/main/admin_recovery_tool/decrypt_gui.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_gui,node_cli,node_scheduler,node_engine,node_version toneBlue
class node_crypto,node_restore,node_recovery,node_local toneAmber
class node_brokerclient,node_broker,node_pull,node_shell,node_sql toneMint
class node_provision,node_signing,node_batch toneRose
class node_preflight,node_installer,node_operator,node_cloud toneIndigo
```

## Components

### Backup operation

- [Desktop GUI](https://github.com/dulnindu123/database-backup-automation/blob/main/app_gui.py): `app_gui.py`
- [Command-line app](https://github.com/dulnindu123/database-backup-automation/blob/main/cli_app.py): `cli_app.py`
- [Scheduled automation](https://github.com/dulnindu123/database-backup-automation/blob/main/auto_backup.py): `auto_backup.py`
- [Backup engine](https://github.com/dulnindu123/database-backup-automation/blob/main/backup_core.py): `backup_core.py`
- [Version identity](https://github.com/dulnindu123/database-backup-automation/blob/main/version.py): `version.py`

### Security and recovery

- [Archive encryption](https://github.com/dulnindu123/database-backup-automation/blob/main/crypto_stream.py): `crypto_stream.py`
- [Restore drill](https://github.com/dulnindu123/database-backup-automation/blob/main/admin_recovery_tool/admin_restore_drill.py): `admin_recovery_tool/admin_restore_drill.py`
- [Recovery tools](https://github.com/dulnindu123/database-backup-automation/blob/main/admin_recovery_tool/decrypt_gui.py): `admin_recovery_tool/decrypt_gui.py`

### Broker and agents

- [Broker client](https://github.com/dulnindu123/database-backup-automation/blob/main/broker_client.py): `broker_client.py`
- [Apps Script broker](https://github.com/dulnindu123/database-backup-automation/blob/main/apps_script_broker/Code.gs): `apps_script_broker/Code.gs`
- [Backup pull tool](https://github.com/dulnindu123/database-backup-automation/blob/main/apps_script_broker/pull_backup.py): `apps_script_broker/pull_backup.py`
- [Shell backup agent](https://github.com/dulnindu123/database-backup-automation/blob/main/shell_client/backup_agent.ps1): `shell_client/backup_agent.ps1`

### Customer administration

- [Customer provisioning](https://github.com/dulnindu123/database-backup-automation/blob/main/Tools/setup_new_customer.py): `Tools/setup_new_customer.py`
- [Bundle signing](https://github.com/dulnindu123/database-backup-automation/blob/main/admin/sign_bundle.py): `admin/sign_bundle.py`
- [Batch provisioning](https://github.com/dulnindu123/database-backup-automation/blob/main/Tools/batch_setup_customers.py): `Tools/batch_setup_customers.py`

### Installation and validation

- [Preflight validation](https://github.com/dulnindu123/database-backup-automation/blob/main/preflight.py): `preflight.py`
- [Setup wizard](https://github.com/dulnindu123/database-backup-automation/blob/main/installer_gui.py): `installer_gui.py`

### Other components

- **Operator**
- **SQL Server**
- **Local backup files**
- **Upload broker service**

## Connections

- Operator → Desktop GUI: configures (evidence: `app_gui.py`)
- Operator → Command-line app: runs
- Desktop GUI → Backup engine: uses (evidence: `app_gui.py`)
- Desktop GUI → Preflight validation: validates with (evidence: `app_gui.py`)
- Desktop GUI → Broker client: uses (evidence: `app_gui.py`)
- Command-line app → Backup engine: uses (evidence: `cli_app.py`)
- Command-line app → Preflight validation: validates with (evidence: `cli_app.py`)
- Command-line app → Broker client: uses (evidence: `cli_app.py`)
- Scheduled automation → Backup engine: runs (evidence: `auto_backup.py`)
- Scheduled automation → Preflight validation: validates with (evidence: `auto_backup.py`)
- Scheduled automation → Broker client: uses (evidence: `auto_backup.py`)
- Backup engine → Archive encryption: encrypts with (evidence: `backup_core.py`)
- Backup engine → Broker client: uses (evidence: `backup_core.py`)
- Backup engine → Version identity: reads (evidence: `backup_core.py`)
- Broker client → Upload broker service: uploads to (evidence: `broker_client.py`)
- Preflight validation → Broker client: probes via (evidence: `preflight.py`)
- Setup wizard → Preflight validation: validates with (evidence: `installer_gui.py`)
- Setup wizard → Broker client: uses (evidence: `installer_gui.py`)
- Setup wizard → Backup engine: uses (evidence: `installer_gui.py`)
- Customer provisioning → Bundle signing: builds signed bundle (evidence: `Tools/setup_new_customer.py`)
- Batch provisioning → Bundle signing: uses (evidence: `Tools/batch_setup_customers.py`)
- Restore drill → Archive encryption: decrypts with (evidence: `admin_recovery_tool/admin_restore_drill.py`)
- Restore drill → SQL Server: restores to
- Backup engine → SQL Server: backs up
- Backup engine → Local backup files: writes archives
- Apps Script broker → Upload broker service: provides endpoint
