Skip to content

kitfist0/MyCardholder

Repository files navigation

MyCardholder

An open source cardholder app to store you cards in one place.

Screenshots

Backup logic

The following terminology is used below:

  • Cloud checksum - backup file name.
  • Local checksum - sum of all card timestamps.

Backup Download

sequenceDiagram
    participant Client
    participant Cloud

    Note over Client, Cloud: Getting cloud checksum
    Client->>Cloud: Get cloud checksum
    Cloud-->>Client: Cloud checksum
    
    Note over Client: Comparison of checksums
    Client->>Client: Compare Cloud checksum > Local checksum
    alt New backup available
        Note over Client, Cloud: Download backup file
        Client->>Cloud: Get backup file
        Cloud-->>Client: Backup file bytes
        
        Note over Client: Import data from backup file
        Client->>Client: Reading cards from a backup file
        Client->>Client: Import cards into the database

        Client->>Client: Backup downloaded successfully
    else No download required
        Note over Client: Skip Download
        Client->>Client: Backup is up-to-date
    end
Loading

Backup Upload

sequenceDiagram
    participant Client
    participant Cloud

    Note over Client, Cloud: Getting cloud checksum
    Client->>Cloud: Get cloud checksum
    Cloud-->>Client: Cloud checksum
    
    Note over Client: Comparison of checksums
    Client->>Client: Compare Cloud checksum < Local checksum
    alt Cloud upload required
        Note over Client: Writing a new backup file
        Client->>Client: Export cards from the database
        Client->>Client: Writing cards to a backup file

        Note over Client, Cloud: Upload backup file
        Client->>Cloud: Backup file bytes
        Cloud-->>Client: OK        

        Client->>Client: Backup uploaded successfully
    else No upload required
        Note over Client: Skip Upload
        Client->>Client: Backup is up-to-date
    end
Loading

Tech-stack

UI