Welcome Contributors!
Thank you for your interest in contributing to r2Vault! This guide will help you get started with the development workflow, code style, and submission process.r2Vault is an open-source macOS client for Cloudflare R2, built with Swift 6 and SwiftUI.
How to Contribute
There are many ways to contribute to r2Vault:- Report bugs via GitHub Issues
- Suggest features or improvements
- Fix bugs and submit pull requests
- Add new features that enhance the user experience
- Improve documentation and code comments
- Write tests to increase code coverage
Development Workflow
Create a branch
Create a feature branch for your changes:Use descriptive branch names:
feature/add-bucket-searchfix/upload-progress-bugdocs/update-readme
Make your changes
- Open
Fiaxe.xcodeprojin Xcode - Make your changes following the code style guidelines
- Test your changes thoroughly
- Update documentation if needed
Commit your changes
Write clear, descriptive commit messages:Good commit messages:
- Start with a verb (Add, Fix, Update, Remove)
- Keep the subject line under 50 characters
- Add details in the body if needed
Push and create a PR
Push your branch and open a pull request:Then visit github.com/xaif/r2Vault to create your pull request.
Code Style
Swift 6 Standards
r2Vault follows Swift 6 conventions and leverages modern language features:- Strict concurrency enabled throughout the project
- @Observable macro for reactive state management (no more
@Published) - async/await for all asynchronous operations
- TaskGroup for concurrent operations (uploads, deletions)
- MainActor annotations where appropriate
SwiftUI Patterns
State Management:Code Organization
Follow the existing project structure:- Use descriptive names:
uploadSingleFilenotupload1 - Follow Swift API design guidelines
- Use camelCase for functions and variables
- Use PascalCase for types and protocols
- Add comments for complex logic
- Use
// MARK: -to organize code sections - Document public APIs with doc comments
Project Structure
Core Components
Models
Models
- R2Credentials.swift — Bucket credential storage
- R2Object.swift — File/folder object model
- UploadItem.swift — Upload history item
- UploadTask.swift — Upload task with progress tracking
Services
Services
- AWSV4Signer.swift — S3-compatible request signing with CryptoKit
- KeychainService.swift — Secure credential persistence
- MenuBarManager.swift — NSStatusItem + NSPopover management
- R2BrowseService.swift — Bucket listing, delete, recursive operations
- R2UploadService.swift — File upload with progress streaming
- ThumbnailCache.swift — Memory + disk thumbnail cache
- UpdateService.swift — GitHub release update checker
- UploadHistoryStore.swift — Upload history persistence
ViewModels
ViewModels
- AppViewModel.swift — Central application state using @Observable
- Browser navigation and state
- Upload queue management
- Credential management
- Update checking
Views
Views
- BrowserView.swift — Main file browser (icon/list views)
- MenuBarView.swift — Menu bar popover UI
- SettingsView.swift — Credentials and preferences
- UploadQueueView.swift — Active uploads HUD
- UploadHistoryView.swift — Past uploads list
Tech Stack
| Layer | Technology |
|---|---|
| UI | SwiftUI |
| Architecture | MVVM with @Observable |
| Concurrency | Swift async/await, TaskGroup |
| Authentication | AWS Signature V4 (CryptoKit) |
| Networking | URLSession |
| Storage | UserDefaults, Keychain |
| Menu Bar | AppKit NSStatusItem + NSPopover |
Testing
Manual Testing
Before submitting a PR, test these key flows:- File Upload
- File Browser
- File Management
- Drag and drop files from Finder
- Upload via file picker button
- Upload folders recursively
- Cancel in-progress uploads
- Verify progress tracking
- Check public URL auto-copy
Test Environments
- Development: Test with a non-production R2 bucket
- Multiple buckets: Verify bucket switching works correctly
- Large files: Test upload progress with files >100MB
- Folders: Test recursive upload of nested folder structures
Submitting Pull Requests
PR Checklist
Before submitting, ensure:- Code builds without warnings or errors
- Changes have been manually tested
- Code follows Swift 6 and SwiftUI patterns
- No sensitive data (API keys, credentials) in code
- Commit messages are clear and descriptive
- PR description explains what and why
PR Description Template
Review Process
- Submit PR: Create your pull request on GitHub
- Automated checks: GitHub Actions will build your changes
- Code review: Maintainers will review your code
- Address feedback: Make requested changes if needed
- Merge: Once approved, your PR will be merged
Areas for Contribution
High Priority
Testing
Add unit tests and UI tests to improve code coverage.
Performance
Optimize thumbnail caching and large file uploads.
Error Handling
Improve error messages and recovery flows.
Accessibility
Add VoiceOver support and keyboard navigation.
Feature Ideas
- File preview: In-app preview for more file types
- Batch operations: Bulk rename, move, copy
- Search: Advanced search with filters
- Sync: Two-way sync between local and R2
- Sharing: Generate presigned URLs with expiration
- Analytics: Storage usage and bandwidth tracking
Resources
GitHub Repository
View source code and submit issues
Building from Source
Build instructions and troubleshooting
Cloudflare R2 Docs
R2 API reference and documentation
Swift Docs
Swift language documentation
Questions?
If you have questions or need help:- Open a GitHub Discussion
- File an Issue for bugs
- Check existing issues and PRs for similar work