- Node.js 18+
- Rust 1.85+
- Windows 10/11 with WebView2
git clone https://github.com/TMHSDigital/system-cleaner.git
cd system-cleaner
npm installnpm run devUse this for fast frontend iteration.
- Starts Vite on
http://localhost:5174 - Uses
src/lib/mockApi.tswhen Tauri runtime is unavailable - Good for UI layout work, browser automation, and non-destructive interaction testing
npm run tauri:devUse this before shipping anything that depends on real system behavior.
- Starts Vite on
http://localhost:5174 - Builds and launches the Tauri desktop shell
- Uses the real Rust backend through
invoke()
npm run tauri:buildOutput locations:
src-tauri/target/release/system-cleaner.exesrc-tauri/target/release/bundle/nsis/src-tauri/target/release/bundle/msi/
src/
├── components/
│ ├── ErrorBoundary.tsx # Top-level render crash recovery
│ ├── layout/ # Shell-level layout components
│ └── ui/ # Shared UI primitives
├── hooks/ # Screen data + action hooks
├── lib/ # API layer, mock API, shared helpers, types
└── styles/ # Theme tokens
src-tauri/src/commands/
├── cleanup.rs
├── disk.rs
├── memory.rs
├── recommendations.rs
└── startup.rs
- Keep imports at the top of the file.
- Prefer shared primitives over screen-specific one-off styling.
- Put screen data fetching and derived state in hooks, not directly in screen components.
- Preserve the
api.tscontract. New UI work should not bypass the API layer. - If you change browser preview behavior, keep
mockApi.tsaligned with the real backend shape, including edge cases like empty results and error responses. - Every screen must handle four states: loading, error, empty/healthy, and populated.
- Interactive elements must have
focus-visiblering styles for keyboard accessibility. - Use the shared
<Tooltip>component instead of nativetitleattributes for truncated text.
ErrorBoundary.tsx wraps the entire app. If a React render crash occurs, the user sees a styled recovery screen instead of a blank page. The boundary logs the error to the console for debugging.
Before merging frontend work:
npm exec tsc -- --noEmitAlso verify:
npm run devfor browser preview and non-destructive UI checksnpm run tauri:devfor real Tauri behavior- Disk Cleanup selection and filter behavior
- Memory kill-button protections for system processes
- Startup toggle reversibility
- Recommendation CTA navigation
- Add scan logic in
src-tauri/src/commands/disk.rs. - Add cleanup handling in
src-tauri/src/commands/cleanup.rsif the target needs special deletion logic. - Keep
risk,path,category, andidaccurate so the frontend workflow stays readable. - If browser preview should demonstrate the new target, update
src/lib/mockApi.tstoo.
- Add the recommendation logic in
src-tauri/src/commands/recommendations.rs. - Use one of the existing
action_typevalues when possible:
| Value | Navigates to |
|---|---|
navigate_disk |
Disk Cleanup |
navigate_memory |
Memory |
navigate_startup |
Startup |
info |
No navigation (informational) |
- If you need a new action type, add it to the
RecommendationActionunion insrc/lib/types.tsand add a case in thegetAction()switch inRecommendations.tsx. - If the browser preview should surface the same recommendation pattern, update
src/lib/mockApi.ts.
- Create the screen component in
src/components/. - Create a hook in
src/hooks/that fetches data and exposes anerrorfield. - Handle all four states in the screen: loading, error, empty, and populated.
- Add
focus-visiblestyles to all interactive elements. - Use shared primitives (
PageHeader,MetricCard,SectionCard,DataRow, etc.) instead of one-off styling. - Add the tab to the
Tabunion insrc/lib/types.tsand thetabsarray andrenderActiveScreenswitch inApp.tsx.
- Rust:
cargo fmt - TypeScript: Prettier-style formatting and shared-component reuse
- Comments: only when the logic is not obvious
- User-facing copy: short, direct, operational