cargo build- Build debug versioncargo build --release- Build optimized release versioncargo run- Build and run debug versioncargo run --release- Build and run release version
cargo test- Run all testscargo test <test_name>- Run specific testcargo test -- --nocapture- Run tests with stdout output
cargo clippy --all-targets- Run linter (fix warnings)cargo fmt- Format code (Rustfmt)cargo check- Quick compile check without building
pnpm run build:css- Build Tailwind CSS from assetspnpm run watch:css- Watch and rebuild CSS
This is a Dioxus desktop application with:
src/main.rs- Application entry pointsrc/ui.rs- Dioxus UI components and logicsrc/db.rs- SQLite database with async actor patternsrc/tray.rs- System tray icon with menu (feature-gated)src/webview.rs- Webview utilities (currently using system browser)
- Use 2021 edition
- Prefer
anyhow::Resultfor error handling - Use
thiserrorfor custom error types when needed - Follow Rust naming:
snake_casefor functions/variables,PascalCasefor types - Use
#[derive(Debug, Clone)]for data structures - Prefer
Option<T>overnull,Result<T, E>over panics
- Group imports: std, external crates, local modules
- Use
usestatements at top of file - Prefer explicit imports over glob (
use dioxus::prelude::*is acceptable for Dioxus)
- Use
#[derive(Debug, Clone)]for data structures - Prefer owned types (
Stringover&str) for data persistence - Use
chrono::Utcfor timestamps - Use
serdefor JSON serialization with#[derive(Serialize, Deserialize)]
- Use crossbeam channels for thread communication
- Use
futures::channel::mpscfor async channel communication - Use
once_cell::sync::OnceCellfor global state - Use
use_signalanduse_effecthooks in Dioxus components
- Use
anyhow::Resultfor most functions - Use
?operator for error propagation - Provide context with
anyhow!("message: {}", var)
- Use rusqlite with bundled SQLite
- Use prepared statements with
params![] - Use
Connection::close()for cleanup - Use
Mutexfor thread-safe database access
- Use
use_signalfor reactive state - Use
use_effectfor side effects and data loading - Use
use_coroutinefor async operations - Follow Dioxus component patterns
- Use Tailwind CSS for styling via
assets/src/styles.css
- Keep related functionality in same module
- Use
mod.rsfor module exports when needed - Place tests in
#[cfg(test)]modules alongside code - Use
src/for source code,assets/for static files
- Use
real_trayfeature for tray icon functionality - Use
optional = truein Cargo.toml for optional dependencies - Use
#[cfg(feature = "feature_name")]to conditionally compile
- Functions:
snake_case - Types/Structs:
PascalCase - Constants:
SCREAMING_SNAKE_CASE - Files:
snake_case.rs - Variables:
snake_case
- Use
//for single-line comments - Use
///for doc comments on public items - Avoid unnecessary comments, prefer self-documenting code
- Make changes to code
- Run
cargo checkfor quick validation - Run
cargo clippyfor linting - Run
cargo fmtfor formatting - Run
cargo testto verify tests pass - Run
cargo buildto ensure it compiles - Test the application manually
- Cross-platform desktop application (Windows/macOS/Linux)
- Uses Dioxus desktop backend
- Tray icon functionality is feature-gated
- SQLite database for data persistence
- System browser for URL opening (not embedded webview)
Key external crates:
dioxus- UI frameworkrusqlite- SQLite databaseanyhow- Error handlingserde- Serializationchrono- Date/timeurl- URL parsingreqwest- HTTP requestsimage- Image processingscraper- HTML parsingcrossbeam-channel- Thread communicationonce_cell- Global statewry- Webview backendtray-icon- System tray (optional)
- Unit tests for database operations
- Integration tests for UI components
- Manual testing for desktop functionality
- No existing test framework configured yet
- CSS: Tailwind CSS via PostCSS
- Icons: SVG/PNG assets in
assets/icons/ - Build process:
pnpm run build:cssgenerates final CSS
- Use
println!for simple debugging - Use
logcrate for structured logging - Use Rust Analyzer for IDE debugging
- Check Cargo.toml features for platform-specific issues