# dimanikulin/fva architecture

> Architecture diagram of the GitHub repository dimanikulin/fva, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dimanikulin/fva
- Repository: https://github.com/dimanikulin/fva

## Overview

##### Project Type and Purpose
- This is a desktop‐based, multi‐module “convergent tool set” for automating the import, enrichment, organization, and transfer of multimedia data (photos/audio/video) into online/offline multimedia IR systems (e.g., digiKam, Synology Moments).
- It comprises C++ Qt GUI applications, command‐line C++ processors, Python maintenance scripts, a shared C++ library, plus packaging and resource files.

##### File Structure Analysis
- Top-level modules (each with its own CMakeLists):
- FVACommonLib – core functionality (CSV, Exif, configuration, logging, dictionary).
- FVAConfigurator – QtWizard UI for configuring flows.
- FVADataProcessor – CLI tasks to validate/transform files.
- FVADescriptionEditor, FVADictionaryEditor – Qt GUI editors.
- FVAFlowController – orchestrates device contexts and processing steps.
- FVAOrganizer / FVAOrganizerWizard – wizards and simple organizer UIs.
- FVAPlayer, FVAViewer – media playback and filtering.
- scripts/ – Python scripts for ad-hoc tasks (metadata fixes, DB creation).
- test/, and per-module test/ directories – unit/integration tests.

##### README Insights
- Context view: external devices → FVA Solution → multimedia IR systems.
- Functional view: Layered architecture (UI → Processing → Data & Configuration).
- Deployment view: bin/, data/, logs/, scripts/ directories at install.

##### Main Components & Their Interactions
a. External Entities (Context):
- Photo-video sources: tablets, phones, cameras, external disks.
- End Targets: Offline IR (digiKam), Online IR (Synology Moments, Google Photos).
b. FVA Solution – Logical Subsystems:
1. UI Layer (Qt Apps):
- Configurator (QTWizard)
- DescriptionEditor, DictionaryEditor (Qt Designer UIs)
- Organizer Wizard
- Viewer, Player
2. Processing Layer (C++ CLIs + Flow Controller):
- FVADataProcessor and its CLT* commands
- FVAFlowController orchestrating tasks based on configuration
3. Data & Configuration Layer:
- FVACommonLib (CSV, Exif parsing, logging, constants, dictionary items)
- application configurations (fvaconfiguration)
- scripts (Python tools using CSV, Exif, DB scripts)
c. External Services:
- File system for input and output folder structures
- Packaging subsystem for building installers (WiX for Windows)

##### Architectural Patterns & Principles
- Layered Architecture: UI → Processing → Data/Config
- Modularization: Each tool in its own directory with isolated CMake build.
- Reuse via common library (FVACommonLib) and consistent command‐line base classes.
- CI/CD workflows (.github/workflows) for tests, code checks, documentation, release.
- Testability: each module has unit tests; integration tests under test/integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    Devices(["Photo/Video Sources"]):::external
    IROffline(["digiKam (Offline IR)"]):::external
    IROnline(["Synology Moments / Google Photos (Online IR)"]):::external

    %% FVA Solution Container
    subgraph "FVA Solution"
        direction TB

        subgraph "UI Layer" 
            direction TB
            Configurator["FVAConfigurator<br/>Qt/C++"]:::ui
            DescriptionEditor["FVADescriptionEditor<br/>Qt/C++"]:::ui
            DictionaryEditor["FVADictionaryEditor<br/>Qt/C++"]:::ui
            OrganizerWizard["FVAOrganizerWizard<br/>Qt/C++"]:::ui
            Organizer["FVAOrganizer<br/>Qt/C++"]:::ui
            Player["FVAPlayer<br/>Qt/C++"]:::ui
            Viewer["FVAViewer<br/>Qt/C++"]:::ui
        end

        subgraph "Processing Layer"
            direction TB
            FlowController["FVAFlowController<br/>C++ CLI, CMake"]:::processing
            DataProcessor["FVADataProcessor CLI Tools<br/>C++ CLI, CMake"]:::processing
        end

        subgraph "Data & Configuration Layer"
            direction TB
            CommonLib["FVACommonLib<br/>C++ Lib"]:::config
            Scripts["Python Scripts<br/>Python"]:::config
            Resources["Resources (dictionaries, icons, localization)"]:::config
            Configuration["Configuration Files<br/>CSV/SQL"]:::config
        end
    end

    Packaging["Packaging (WiX, installers)"]:::package

    %% Connections
    Devices -->|Multimedia files| Configurator
    Devices -->|Multimedia files| DescriptionEditor
    Devices -->|Multimedia files| DictionaryEditor
    Devices -->|Multimedia files| OrganizerWizard
    Devices -->|Multimedia files| Organizer
    Devices -->|Multimedia files| Player
    Devices -->|Multimedia files| Viewer
    Devices -->|Multimedia files| DataProcessor

    Configurator -->|Configuration| FlowController
    DescriptionEditor -->|Configuration| FlowController
    DictionaryEditor -->|Configuration| FlowController
    OrganizerWizard -->|Configuration| FlowController
    Organizer -->|Configuration| FlowController
    Player -->|User commands| FlowController
    Viewer -->|User commands| FlowController

    DataProcessor -->|CLI tasks| CommonLib
    FlowController -->|Orchestration| CommonLib
    FlowController -->|Reads config| Configuration
    FlowController -->|Reads resources| Resources
    Scripts -->|Maintenance tasks| CommonLib

    FlowController -->|Processed output| IROffline
    FlowController -->|Processed output| IROnline

    Packaging -->|Builds installers| Configurator
    Packaging -->|Builds installers| DataProcessor
    Packaging -->|Includes| bin/
    Packaging -->|Includes| data/
    Packaging -->|Includes| logs/
    Packaging -->|Includes| scripts/

    %% Click Events
    click CommonLib "https://github.com/dimanikulin/fva/tree/master/FVACommonLib/"
    click Configurator "https://github.com/dimanikulin/fva/tree/master/FVAConfigurator/"
    click DataProcessor "https://github.com/dimanikulin/fva/tree/master/FVADataProcessor/"
    click FlowController "https://github.com/dimanikulin/fva/tree/master/FVAFlowController/"
    click DescriptionEditor "https://github.com/dimanikulin/fva/tree/master/FVADescriptionEditor/"
    click DictionaryEditor "https://github.com/dimanikulin/fva/tree/master/FVADictionaryEditor/"
    click OrganizerWizard "https://github.com/dimanikulin/fva/tree/master/FVAOrganizerWizard/"
    click Organizer "https://github.com/dimanikulin/fva/tree/master/FVAOrganizer/"
    click Player "https://github.com/dimanikulin/fva/tree/master/FVAPlayer/"
    click Viewer "https://github.com/dimanikulin/fva/tree/master/FVAViewer/"
    click Scripts "https://github.com/dimanikulin/fva/tree/master/scripts/"
    click Configuration "https://github.com/dimanikulin/fva/tree/master/configuration/"
    click Resources "https://github.com/dimanikulin/fva/tree/master/resources/"
    click Packaging "https://github.com/dimanikulin/fva/tree/master/packaging/"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef processing fill:#98FB98,stroke:#000,stroke-width:1px
    classDef config fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef package fill:#FFDEAD,stroke:#000,stroke-width:1px
```
