Contributing
Contributing to Xplorer
Thank you for your interest in contributing to Xplorer! This guide will help you get started.
Development Setup
See Getting Started for full setup instructions. In short:
git clone https://github.com/xplorer/xplorer.git
cd xplorer
pnpm install
pnpm dev
Project Structure
xplorer/
├── client/ # React frontend
├── src-tauri/ # Rust backend
├── extension-sdk/ # Extension SDK package
├── web/ # Documentation site (Next.js)
├── docs/ # Standalone docs
└── package.json # Root monorepo config
Making Changes
Frontend Changes
- Edit files in
client/src/ - Changes hot-reload automatically via Vite
- Run
pnpm checkto verify TypeScript types
Backend Changes
- Edit files in
src-tauri/src/ - Run
cd src-tauri && cargo checkto verify compilation - Restart the Tauri dev window to test (Ctrl+R to reload the WebView)
Documentation Changes
- Edit files in
docs/docs/ - Run
cd docs && pnpm startto preview locally - Build with
cd docs && pnpm build
Code Style
Rust
- Follow standard Rust formatting (
cargo fmt) - Use
Result<T, String>for Tauri command return types - Keep functions focused — one operation per function
- Use descriptive error messages in
Err()values
TypeScript / React
- Use TypeScript for all new files
- Use functional components with hooks
- Keep components under 300 lines — extract hooks for complex logic
- Use
TauriAPIfor all backend calls (never callinvoke()ortransport()directly —TauriAPIwraps the transport layer) - Use
cn()fromlib/utils.tsfor className merging
CSS / Styling
- Use Tailwind CSS utility classes
- Follow the glassmorphic theme patterns in existing components
- Use CSS custom properties for theme-able values
- Avoid inline styles
Testing
Frontend Tests
pnpm test # Watch mode
pnpm test:run # Single run
pnpm test:coverage # With coverage report
Tests use Vitest + Testing Library. Test files go in client/src/__tests__/.
Backend Tests
cd src-tauri && cargo test
Adding a New Feature
1. Backend Command
Add your Tauri command in the appropriate module:
// src-tauri/src/operations/my_ops.rs
#[tauri::command]
pub async fn my_new_command(param: String) -> Result<MyResult, String> {
// Implementation
}
Register it in main.rs:
.invoke_handler(tauri::generate_handler![
// ... existing commands
operations::my_ops::my_new_command,
])
2. Frontend API
Add the invoke wrapper in client/src/lib/tauri-api.ts:
export const TauriAPI = {
// ... existing methods
myNewCommand: (param: string): Promise<MyResult> =>
invoke('my_new_command', { param }),
};
3. UI Component
Create or update components in client/src/components/ to use the new API.
Reporting Issues
Please report bugs and feature requests on the GitHub issue tracker. Include:
- Steps to reproduce
- Expected vs actual behavior
- OS and Xplorer version
- Error messages or screenshots