Skip to content

Hureru/CloudLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudLink

A Windows desktop application for syncing software configuration and save data to OneDrive using symbolic links.

Features

  • OneDrive Integration: Automatically detects OneDrive installation and manages sync directory
  • Symlink Management: Creates symbolic links, junctions, or hardlinks to sync files seamlessly
  • Backup & Restore: Versioned backups with configurable retention policy (up to 10 versions)
  • Conflict Detection: Three-layer conflict detection (timestamp, hash, OneDrive status) with resolution UI
  • Software Templates: Pre-configured templates for popular software (VS Code, Git, Chrome, etc.)
  • Sync Rules: Flexible rules with exclusion patterns for fine-grained control
  • Real-time Status: Monitor sync status, health checks, and history for all managed software

System Requirements

  • Windows 10/11
  • OneDrive desktop app installed and configured
  • Flutter SDK 3.0+ (for development)

Installation

From Source

  1. Clone the repository:

    git clone https://github.com/your-username/cloudlink.git
    cd cloudlink
  2. Install dependencies:

    flutter pub get
  3. Run the application:

    flutter run -d windows

Build Release

flutter build windows --release

The executable will be in build/windows/x64/runner/Release/.

Usage

Adding Software

  1. Click the "+" button on the main screen
  2. Choose from a template or manually configure:
    • Name: Unique identifier for the software
    • Display Name: Friendly name shown in the UI
    • Config Path: Path to the configuration directory (supports variables like {APPDATA})
    • Sync Mode: config_only or full

Configuring Sync Rules

Each software can have multiple sync rules:

  • Source Path: Local path to sync (e.g., {APPDATA}\Code\User)
  • Target Path: OneDrive path (auto-generated or custom)
  • Link Type: symbolic, junction, or hardlink
  • Exclude Patterns: Glob patterns to exclude (e.g., *.log, cache/*)

Path Variables

CloudLink supports the following path variables:

Variable Description Example
{APPDATA} Roaming AppData C:\Users\Name\AppData\Roaming
{LOCALAPPDATA} Local AppData C:\Users\Name\AppData\Local
{USER_PROFILE} User home directory C:\Users\Name
{ONEDRIVE} OneDrive root C:\Users\Name\OneDrive
{PROGRAMFILES} Program Files C:\Program Files

Syncing

  1. Select a software from the list
  2. Click "Sync" to start synchronization
  3. The sync process will:
    • Create a backup of existing files
    • Copy files to OneDrive
    • Create a symbolic link from the original location to OneDrive

Conflict Resolution

When conflicts are detected:

  1. Navigate to Conflict Management from the sidebar
  2. Review conflicting files with modification times and sizes
  3. Choose resolution:
    • Keep Local: Use local version
    • Keep Cloud: Use OneDrive version
    • Ignore: Skip this conflict

Backup & Restore

  • Backups are created automatically before each sync
  • Access backups via the Backup section
  • Restore any previous version with one click
  • Configure retention policy in settings (default: 10 versions)

Architecture

lib/
├── models/           # Data models (Software, SyncRule, Conflict, etc.)
├── services/         # Business logic
│   ├── sync_engine.dart       # Core sync orchestration
│   ├── backup_service.dart    # Backup management
│   ├── link_manager.dart      # Symlink operations
│   ├── onedrive_service.dart  # OneDrive detection
│   ├── conflict_detector.dart # Conflict detection
│   └── database_service.dart  # SQLite persistence
├── platform/         # Windows-specific APIs
└── ui/               # Flutter UI components
    ├── screens/      # Main screens
    ├── dialogs/      # Dialog windows
    └── widgets/      # Reusable widgets

Development

Running Tests

# All tests
flutter test

# Unit tests only
flutter test test/unit/

# Integration tests
flutter test test/integration/

# With coverage
flutter test --coverage

Project Structure

  • test/unit/ - Unit tests for services and models
  • test/widget/ - Widget tests for UI components
  • test/integration/ - Integration tests for workflows
  • test/helpers/ - Test utilities and mocks

License

MIT License - see LICENSE for details.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages