Guidelines for AI-assisted development on this project.
DLMan is a cross-platform download manager:
- Frontend: React 18 + TypeScript + Tailwind + shadcn/ui + Zustand
- Backend: Tauri v2 + Rust + SQLite (sqlx)
- Core:
dlman-corecrate (shared between desktop and CLI)
- SQLite is the single source of truth for downloads, segments, and settings
- Queues still use JSON files
- Frontend syncs with backend on startup via
get_settings()command
User Action → Zustand Store → Tauri Command → DlmanCore → SQLite
↓
Tauri Event → Zustand Store → UI Update
apps/desktop/src/ # React frontend
apps/desktop/src-tauri/src/ # Tauri/Rust backend
crates/dlman-core/src/ # Core engine (shared)
crates/dlman-types/src/ # Shared types
- Strict mode, no
any - One component per file
- Use existing shadcn/ui components
- Use
thiserrorfor errors - No
.unwrap()in production code - Async with tokio
- Files under 300 lines
- Events over polling
- Memoize expensive operations
| File | Purpose |
|---|---|
commands.rs |
Tauri commands (frontend ↔ backend) |
dlman-core/src/lib.rs |
Core API |
persistence.rs |
SQLite operations |
stores/*.ts |
Zustand stores |
- Add function in
commands.rs - Register in
lib.rs - Call from frontend with
invoke()
- Add field to
Settingsstruct indlman-types - Update SQLite schema in
persistence.rs - Add to settings dialog UI
- Core logic in
dlman-core/src/engine/ - Test with CLI first (
cargo run -p dlman-cli) - Then integrate with desktop
- Don't poll for updates (use Tauri events)
- Don't store settings in JSON (use SQLite)
- Don't put business logic in React components
- Don't use inline styles (use Tailwind)