Thank you for your interest in contributing! This guide will help you understand the project structure and how to get started.
protondrive-tauri/
├── src-tauri/ # Rust backend (Tauri framework)
│ ├── src/main.rs # IPC commands, system tray, menus
│ ├── Cargo.toml # Rust dependencies
│ └── tauri.conf.json # Configuration
├── WebClients/ # Git submodule (Proton Drive web app)
│ └── applications/drive/
│ ├── src/ # React/TypeScript source
│ └── build/ # Compiled output
└── scripts/ # Build and setup scripts
-
Clone with submodules:
git clone --recurse-submodules https://github.com/yourusername/protondrive-tauri.git cd protondrive-tauri -
Run the setup script:
bash scripts/setup.sh
Or manually:
npm install rustup update
-
Web app changes (React/TypeScript):
- Edit files in
WebClients/applications/drive/src/ - Changes hot-reload in dev mode
- Edit files in
-
Desktop features (Rust):
- Edit
src-tauri/src/main.rsfor IPC commands, system tray, etc. - Restart dev server to apply changes
- Edit
-
Configuration:
src-tauri/tauri.conf.json- Window size, bundles, metadatasrc-tauri/Cargo.toml- Rust dependencies
npm run devThis will:
- Start a dev server at
http://localhost:5173 - Launch the Tauri window
- Enable hot-reload for web app changes
npm run buildThis creates production binaries in src-tauri/target/release/bundle/.
- Follow Rust naming conventions
- Use
cargo fmtto format:cd src-tauri && cargo fmt
- Use
cargo clippyto lint:cd src-tauri && cargo clippy -- -D warnings
- Inherited from WebClients. Follow their conventions in
WebClients/applications/drive/
Edit src-tauri/src/main.rs:
#[tauri::command]
async fn my_new_command(param: String) -> Result<String, String> {
// Your logic here
Ok(format!("Processed: {}", param))
}
fn main() {
// ...
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
show_notification,
open_file_dialog,
get_app_version,
check_for_updates,
my_new_command, // Add here
])
// ...
}Then use from the web app (React):
import { invoke } from "@tauri-apps/api/tauri";
const result = await invoke("my_new_command", { param: "test" });Edit the on_system_tray_event handler in src-tauri/src/main.rs:
.on_system_tray_event(|app, event| match event {
SystemTrayEvent::MenuItemClick { id, .. } => {
match id.as_str() {
"my_action" => {
// Handle your action
}
_ => {}
}
}
_ => {}
})- Run
npm run dev - Test features in the app window
- Check system tray, notifications, dialogs
Tests for the web app are in WebClients/applications/drive/. Run them:
cd WebClients/applications/drive
npm testThe WebClients repository is a git submodule. To update:
cd WebClients
git fetch origin
git checkout <tag-or-commit>
cd ..
git add WebClients
git commit -m "Update WebClients to <version>"
git push-
Create a feature branch:
git checkout -b feature/my-feature
-
Commit with clear messages:
git commit -m "Add system tray icon support" -
Push and create a pull request:
git push origin feature/my-feature
npm run build:appimageOutput: src-tauri/target/release/bundle/appimage/Proton Drive_*.AppImage
npm run build:debOutput: src-tauri/target/release/bundle/deb/proton-drive_*.deb
npm run build:rpmOutput: src-tauri/target/release/bundle/rpm/proton-drive-*.rpm
Update Rust and dependencies:
rustup update
cd src-tauri && cargo updategit submodule update --init --recursiveKill the process or change the port in tauri.conf.json:
"devPath": "http://localhost:5174"- Tauri Documentation
- Proton Drive GitHub
- Check existing issues or open a new one
Thank you for contributing!