# scriptedbits/gamevault-relocator architecture

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

- Interactive diagram: https://gitdiagram.com/scriptedbits/gamevault-relocator
- Repository: https://github.com/scriptedbits/gamevault-relocator

## Overview

##### Project Type and Purpose
- The project is a desktop utility targeting users who manage large gaming collections that may span multiple storage locations.
- Its primary functionality is to relocate directories (using either native file moves or Robocopy) and then create symlinks to preserve existing file paths and references.
- It also includes an update mechanism (as seen from updater.py, updater.exe, and update.sh) and versioning resources (version_info.rc) to manage releases.

##### Analyzing the File Structure
- The main functional file is GameVault-Relocator.py, which contains the core logic for moving directories and creating symlinks.
- There is a .spec file (likely for PyInstaller) that helps bundle the Python script into a standalone executable.
- Updater components appear in updater.py, updater.exe, and update.sh, indicating a dedicated module or component responsible for checking for and applying updates.
- The version_info.rc file provides versioning information that integrates with the Windows resource system.
- The overall project is kept relatively flat, suggesting a single-application (monolithic) structure rather than a distributed or microservices architecture.

##### Key Components
a. Main Application Module:
– The central component running the file relocation logic, handling user input (parameters such as source and destination folders) and initiating file moves.
b. File Handling & Symlink Module:
– This module is responsible for interfacing with the OS. It executes file moves (either using native move commands or Robocopy) and creates symbolic links.
– Represent the dependency on OS-level file system operations.
c. Updater Module:
– Incorporate both updater.py and updater.exe into a distinct update service that checks for new versions and applies updates using the provided update.sh script.
– Link this module to version_info.rc to show version management.
d. User Interface (UI) or Command-Line Interface (CLI):
– Since the tool has a “simple, modern UI,” make sure to include a component for user interaction. Whether it’s a graphical UI or a CLI, show this component interfacing with the main application.
e. External Tools and Dependencies:
– Highlight dependencies on external utilities like Robocopy (primarily for Windows environments) and the underlying Python runtime.

##### Establishing Relationships and Interactions
- The File Handling component should also have bidirectional communication with the OS File System block (showing both commands issued and system feedback).
- The Updater Module can be connected to an “Update Server” (external) to indicate that it may interact with a repository of releases, even if this isn’t explicitly detailed.

##### Architectural Patterns or Design Principles
- Although the project is relatively small, it is good practice to denote logical separation of concerns:
– Separation between the core relocation logic and the update mechanism.
– A clear interface for external system dependencies (such as file system operations).
- The design may implicitly follow a single-responsibility principle by isolating update concerns from file handling tasks.

##### Technical Notations
- Clear labels for each component (e.g., “Main Application Module”, “File Handling & Symlink Processor”, “Updater Service”, “User Interface”).
- If available, include annotations to specify technologies like Python, Robocopy, and PyInstaller.

– Begin with the end-user and the UI.
– Follow the flow through the Main Application, branching it into the specialized File Handling module and the independent Updater module.
– Finally, show the interaction with operating system resources and any external update servers.
This detailed, component-level breakdown accurately represents GameVault-Relocator’s architecture and will help guide any further development or deployment considerations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    UI("User Interface (UI/CLI)"):::ui
    MainApp("Main Application Module"):::core
    PackagingSpec("Packaging Spec"):::packaging
    FileHandler("File Handling & Symlink Processor"):::core
    OSFS("OS File System"):::external
    Robocopy("Robocopy"):::external
    PythonRuntime("Python Runtime"):::external
    UpdateServer("Update Server"):::external

    %% Updater Subgraph
    subgraph "Updater Module"
        UpdaterPython("Updater (Python)"):::updater
        UpdaterExe("Updater (Executable)"):::updater
        UpdaterScript("Updater (Script)"):::updater
        VersionMgr("Version Management (version_info.rc)"):::version
    end

    %% Connections
    UI -->|"initiates"| MainApp
    PackagingSpec -->|"packaging"| MainApp
    MainApp -->|"handles relocation"| FileHandler
    MainApp -->|"checks_updates"| UpdaterPython
    FileHandler <-->|"file_ops"| OSFS
    FileHandler -->|"uses"| Robocopy
    FileHandler -->|"runs_on"| PythonRuntime
    UpdaterPython -->|"manages_version"| VersionMgr
    UpdaterExe -->|"manages_version"| VersionMgr
    UpdaterScript -->|"triggers_update"| UpdateServer

    %% Click Events
    click MainApp "https://github.com/scriptedbits/gamevault-relocator/blob/main/GameVault-Relocator.py"
    click PackagingSpec "https://github.com/scriptedbits/gamevault-relocator/blob/main/GameVault-Relocator.spec"
    click UpdaterPython "https://github.com/scriptedbits/gamevault-relocator/blob/main/updater.py"
    click UpdaterExe "https://github.com/scriptedbits/gamevault-relocator/blob/main/updater.exe"
    click UpdaterScript "https://github.com/scriptedbits/gamevault-relocator/blob/main/update.sh"
    click VersionMgr "https://github.com/scriptedbits/gamevault-relocator/blob/main/version_info.rc"

    %% Styles
    classDef ui fill:#ffcc00,stroke:#000,stroke-width:2px;
    classDef core fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef updater fill:#99ccff,stroke:#333,stroke-width:2px;
    classDef external fill:#ffcccc,stroke:#333,stroke-width:2px;
    classDef packaging fill:#e6ccff,stroke:#333,stroke-width:2px;
    classDef version fill:#ffe699,stroke:#333,stroke-width:2px;
```
