A desktop application for managing invoices with Swiss QR bill generation, built with Rust, egui, and Diesel ORM.
- Invoice Management: Create, edit, and track invoices with draft, sent, paid, and overdue statuses
- Client Database: Store and manage customer information with billing addresses
- Swiss QR Bill Generation: Automatically generate ISO 20022 compliant QR bills
- PDF Export: Professional invoice PDFs using Typst templates
- Item Templates: Reusable line item templates for common services/products
- IBAN Validation: Built-in validation for Swiss and international IBANs
- SCOR References: ISO 11649 compliant creditor reference generation
- Rust 2024 edition or later
- SQLite (bundled via diesel)
Clone the repository and build:
git clone <repository-url>
cd swiss-qr-bill
cargo build --releaseThe compiled binary will be located at target/release/bill-manager.
cargo runOr run the compiled binary directly:
./target/release/bill-manager- Launch the application
- Navigate to Settings
- Configure your creditor information (name, address, IBAN)
- Set default values for new invoices
- Go to the Bills tab
- Click "New Bill"
- Select a client (or create a new one)
- Add line items manually or use templates
- Generate the PDF with Swiss QR bill
- Export or mark as sent
src/
├── main.rs # Application entry point
├── app.rs # Application state and business logic
├── db.rs # Database layer (Diesel ORM)
├── models.rs # Database models
├── ui.rs # egui UI implementation
├── pdf.rs # PDF and QR bill generation
├── types.rs # Core data types
└── schema.rs # Auto-generated Diesel schema
The application follows a three-layer architecture:
- Database Layer (
db.rs): Diesel ORM with SQLite for persistence - Application State (
app.rs): In-memory caching with database synchronization - UI Layer (
ui.rs): Immediate mode GUI using egui
See CLAUDE.md for detailed architecture documentation.
# Development build
cargo build
# Release build (optimized)
cargo build --release
# Run tests
cargo test
# Check for errors without building
cargo checkThe application uses SQLite with Diesel ORM. The database file (bills.db) is created automatically on first run. Migrations are embedded and run automatically.
To work with migrations:
# Install diesel CLI
cargo install diesel_cli --no-default-features --features sqlite
# Create a new migration
diesel migration generate migration_name
# Run migrations manually (usually automatic)
diesel migration run- egui: Immediate mode GUI framework
- Diesel: ORM and query builder for SQLite
- Typst: Modern document formatting for PDF generation
- qrcode: QR code generation
- iso_11649: SCOR reference number generation
- iban: IBAN validation
- Database:
bills.dbin the application directory - Typst Packages:
~/.cache/typst/packages/(platform-specific) - Templates: Expected in
templates/directory
[Add your license here]
[Add contribution guidelines here]