How mridulparth/folderfortsync works
Project Type & Purpose
• The project is a full-featured file synchronization tool aimed at providing secure, real-time cloud backup.
• It offers secure authentication, intuitive file selection, and complete sync controls with features like pause/resume and auto-retry, all wrapped in a modern dark UI.
Main Components
• Sync Application Entry Point (sync_app.py): Acts as the central controller that initializes the UI and orchestrates the file sync process.
• UI Components (ui_components.py): Contains the visual elements, custom dialogs, and layout definitions powered by CustomTkinter.
• File Uploader (file_uploader.py): Manages the core logic of file transfers including upload, progress tracking, error handling, and retry mechanisms.
• Folder Manager (folder_manager.py): Handles operations related to FolderFort Cloud, such as fetching and managing remote folder structures.
• External Dependencies and Libraries: Utilize CustomTkinter (UI), Requests (API communication), Humanize (displaying file sizes and times), and Keyring (secure credential storage).
Relationships & Interactions
• The Main Application (sync_app.py) serves as the central hub. It initializes the UI components and ties together the file uploader and folder manager.
• The UI layer interacts with users by prompting for API tokens, allowing file/folder selection, and presenting sync controls. User actions make calls to:
• The File Uploader for starting, pausing, resuming, or stopping the sync.
• The Folder Manager to refresh and select cloud folders.
• The File Uploader and Folder Manager modules communicate with external services:
• File Uploader uses HTTP requests (via the Requests library) to send files to the cloud.
• Folder Manager interacts with the FolderFort Cloud API to fetch available folders and manage remote structures.
• Secure authentication is achieved by capturing the API token (via the UI) and securely storing it using Keyring.
Important Architectural Patterns & Design Principles
• Separation of Concerns: The project isolates UI (ui_components.py), business logic for file transfers (file_uploader.py), and cloud interactions (folder_manager.py) into discrete modules.
• Modularization: By splitting the functionality into separate Python files, the project is easier to maintain and extend.
• Clear Data Flow: The main application acts as a mediator, directing information between the user interface and backend synchronization components.
• Error Handling & Retry: The File Uploader includes logic to auto-retry failed transfers, ensuring robustness.