# bit-team/backintime architecture

> Architecture diagram of the GitHub repository bit-team/backintime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bit-team/backintime
- Repository: https://github.com/bit-team/backintime

## Overview

##### Main System Components

a. Core Components:
- CLI Interface (`common/cli.py`)
- Qt GUI Interface (`qt/` directory)
- Configuration Management (`common/config.py`, `common/configfile.py`)
- Backup Engine (`common/snapshots.py`)
- Plugin System (`common/pluginmanager.py`)

b. Supporting Services:
- SSH Tools (`common/sshtools.py`)
- Mount Handler (`common/mount.py`)
- Password Management (`common/password.py`)
- Scheduling System (`common/schedule.py`)

##### Component Relationships

**[User Interfaces]**

- v
**[Configuration Layer]**

- v
**[Backup Engine] <--> [Plugin System]**

- v
**[Storage Handlers]**

##### Specific Implementation Details

Technical aspects:

a. User Interface Layer:
- Dual interface options (CLI and Qt GUI)
- Separation between UI and core logic
- Notification system (`qt/plugins/notifyplugin.py`)

b. Core Functionality:
- Snapshot management system
- Rsync integration point
- Demonstrate the plugin architecture

c. Storage Layer:
- Local storage handling
- Remote storage via SSH
- Mount point management

##### Key Flows to Highlight

Important processes:
- Backup initiation flow
- Snapshot creation process
- Remote storage interaction
- Plugin execution chain

##### Technical Details

Annotations for:
- Python 3 implementation
- rsync dependency
- SSH capabilities
- Supported storage types
- Plugin extension points

This design should reflect Back In Time's nature as a modular, extensible backup solution with multiple interface options and robust storage handling capabilities.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef ui fill:#2374ab,color:white
    classDef core fill:#57a773,color:white
    classDef storage fill:#ff8c42,color:white
    classDef security fill:#ed474a,color:white
    classDef plugin fill:#9067c6,color:white
    classDef config fill:#8c8c8c,color:white

    %% Main components
    subgraph User_Interfaces
        CLI["CLI Interface"]:::ui
        GUI["Qt GUI Interface"]:::ui
        SysTray["System Tray"]:::ui
        RestoreUI["Restore Interface"]:::ui
        SnapshotsUI["Snapshots Dialog"]:::ui
        ProfileUI["Profile Management"]:::ui
    end

    subgraph Core_Components
        Config["Configuration Manager"]:::config
        BackupEngine["Backup Engine"]:::core
        PluginSystem["Plugin System"]:::plugin
        Schedule["Scheduler"]:::core
    end

    subgraph Storage_Layer
        Mount["Mount Handler"]:::storage
        SSH["SSH Tools"]:::storage
        Local["Local Storage"]:::storage
    end

    subgraph Security
        Password["Password Manager"]:::security
    end

    subgraph Plugins
        NotifyPlugin["Notification Plugin"]:::plugin
        UserCallback["User Callback Plugin"]:::plugin
    end

    %% Relationships
    CLI --> Config
    GUI --> Config
    SysTray --> GUI
    RestoreUI --> BackupEngine
    SnapshotsUI --> BackupEngine
    ProfileUI --> Config

    Config --> BackupEngine
    BackupEngine --> PluginSystem
    PluginSystem --> NotifyPlugin
    PluginSystem --> UserCallback
    Schedule --> BackupEngine

    BackupEngine --> Mount
    BackupEngine --> SSH
    BackupEngine --> Local
    SSH --> Password

    %% Click events
    click CLI "https://github.com/bit-team/backintime/blob/dev/common/cli.py"
    click GUI "https://github.com/bit-team/backintime/blob/dev/qt/app.py"
    click Config "https://github.com/bit-team/backintime/blob/dev/common/config.py"
    click BackupEngine "https://github.com/bit-team/backintime/blob/dev/common/snapshots.py"
    click PluginSystem "https://github.com/bit-team/backintime/blob/dev/common/pluginmanager.py"
    click SSH "https://github.com/bit-team/backintime/blob/dev/common/sshtools.py"
    click Mount "https://github.com/bit-team/backintime/blob/dev/common/mount.py"
    click Password "https://github.com/bit-team/backintime/blob/dev/common/password.py"
    click Schedule "https://github.com/bit-team/backintime/blob/dev/common/schedule.py"
    click NotifyPlugin "https://github.com/bit-team/backintime/blob/dev/qt/plugins/notifyplugin.py"
    click ProfileUI "https://github.com/bit-team/backintime/tree/dev/qt/manageprofiles/"
    click SysTray "https://github.com/bit-team/backintime/blob/dev/qt/plugins/systrayiconplugin.py"
    click RestoreUI "https://github.com/bit-team/backintime/blob/dev/qt/restoredialog.py"
    click SnapshotsUI "https://github.com/bit-team/backintime/blob/dev/qt/snapshotsdialog.py"
    click UserCallback "https://github.com/bit-team/backintime/blob/dev/common/plugins/usercallbackplugin.py"

    %% Legend
    subgraph Legend
        UI["User Interface"]:::ui
        CoreComp["Core Component"]:::core
        StorageComp["Storage Component"]:::storage
        SecurityComp["Security Component"]:::security
        PluginComp["Plugin Component"]:::plugin
        ConfigComp["Configuration Component"]:::config
    end
```
