Skip to content

chinmaygarg/Quick-Invoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧾 UCLEAN Invoice Generation System

License: MIT Tauri React Rust TypeScript

A professional desktop invoice generation system built with Tauri, React, and Rust. Designed specifically for laundry and dry cleaning businesses with full GST compliance for the Indian market.

✨ Key Features

🧾 Invoice Management

  • πŸ–¨οΈ Multiple Print Formats: A5, A4, and 80mm Thermal printer support
  • πŸ’° GST Compliance: Automatic SGST, CGST, and IGST calculations with HSN codes
  • 🌐 HTML Invoice Generation: High-quality HTML invoices with auto-print browser integration
  • πŸ”’ Auto Numbering: Sequential invoice numbering with customizable format
  • πŸ“… Complete Date Tracking: Order, pickup, delivery, and due date management
  • πŸ’± Currency in Words: Automatic amount-to-words conversion

πŸ‘₯ Customer Management

  • πŸ“ Comprehensive Profiles: Complete customer information with notes
  • πŸ“ž Contact Management: Phone, email, and address with validation
  • πŸ“Š Customer Analytics: Order history, spending patterns, and loyalty tracking
  • πŸ” Smart Search: Fast customer lookup with autocomplete
  • πŸ“ˆ Customer Stats: Total orders, spending, and last order tracking

πŸͺ Multi-Store Support

  • 🏒 Store Profiles: Manage multiple business locations
  • πŸ“ Location-based Operations: Store-specific invoicing and reporting
  • πŸ“‹ Individual Analytics: Location-wise performance tracking
  • βš™οΈ Custom Settings: Store-specific configurations and branding
  • πŸͺ Store Status Management: Active/inactive store controls

🧽 Service Management

  • 🏷️ Comprehensive Catalog: Detailed service listings with categories
  • πŸ’Έ Flexible Pricing: Weight-based, area-based, and quantity-based pricing
  • 🎯 Service Variants: Multiple options per service (Express, Premium, etc.)
  • πŸ“¦ Add-on Services: Additional services with separate pricing
  • πŸ“ Multiple Units: kg, sqft, pieces, and custom units
  • πŸ“Š Service Analytics: Popular services and revenue tracking

πŸ“Š Reports & Analytics

  • πŸ’Ή Sales Reports: Revenue tracking with date ranges and filters
  • πŸ“ˆ GST Reports: Tax summary reports for compliance
  • πŸ‘€ Customer Insights: Top customers and behavior analysis
  • 🚚 Express Delivery Tracking: Premium service monitoring
  • πŸ“‹ Service Performance: Most popular and profitable services
  • πŸ’° Payment Analysis: Payment method and outstanding tracking

πŸ’Ύ Data Management & Security

  • πŸ”’ Local Storage: SQLite database for complete data security
  • πŸ’Ύ Backup & Restore: Full database backup with restore functionality
  • πŸ”„ Data Export: Export to CSV, PDF, and other formats
  • πŸ” Data Validation: Input validation and data integrity checks
  • πŸ“± Offline Operation: Full functionality without internet dependency

πŸš€ Quick Start

System Requirements

Component Minimum Recommended
Operating System Windows 10, macOS 10.15, Ubuntu 18.04 Windows 11, macOS 12+, Ubuntu 20.04+
RAM 4 GB 8 GB+
Storage 200 MB 1 GB+
Node.js 18.0.0 20.x LTS
Rust 1.70.0 Latest stable

Prerequisites

Before installation, ensure you have:

  1. Node.js 18+ - Download here
  2. Rust 1.70+ - Install via rustup
  3. Git - Download here

Platform-specific Requirements

Windows:

  • Visual Studio Build Tools or Visual Studio 2019/2022
  • WebView2 Runtime (usually pre-installed on Windows 11)

macOS:

  • Xcode Command Line Tools: xcode-select --install

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/uclean-invoice-system.git
    cd uclean-invoice-system
  2. Install dependencies

    # Using npm (recommended)
    npm install
    
    # Or using pnpm
    pnpm install
    
    # Or using yarn
    yarn install
  3. Start development server

    npm run dev

The application will automatically open in a desktop window. The first run may take a few minutes to compile the Rust backend.

πŸ› οΈ Development

Project Structure

uclean/
β”œβ”€β”€ src/                          # React Frontend
β”‚   β”œβ”€β”€ components/               # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/                  # Base UI components
β”‚   β”‚   β”œβ”€β”€ forms/               # Form components
β”‚   β”‚   └── modals/              # Modal dialogs
β”‚   β”œβ”€β”€ contexts/                # React contexts
β”‚   β”œβ”€β”€ hooks/                   # Custom React hooks
β”‚   β”œβ”€β”€ lib/                     # Utility functions
β”‚   β”œβ”€β”€ types/                   # TypeScript type definitions
β”‚   └── styles/                  # CSS and Tailwind styles
β”œβ”€β”€ src-tauri/                   # Rust Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ database/            # Database models and migrations
β”‚   β”‚   β”‚   β”œβ”€β”€ mod.rs           # Database manager
β”‚   β”‚   β”‚   β”œβ”€β”€ schema.sql       # Database schema
β”‚   β”‚   β”‚   └── seed.sql         # Initial data
β”‚   β”‚   β”œβ”€β”€ handlers/            # Tauri command handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ customer_handler.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ invoice_handler.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ service_handler.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ store_handler.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ report_handler.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ pricing_handler.rs
β”‚   β”‚   β”‚   └── html_handler.rs
β”‚   β”‚   β”œβ”€β”€ models/              # Data models and types
β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ pricing_engine.rs
β”‚   β”‚   β”‚   β”œβ”€β”€ html_generator.rs
β”‚   β”‚   β”‚   └── template_engine.rs
β”‚   β”‚   β”œβ”€β”€ utils/               # Helper functions
β”‚   β”‚   └── main.rs              # Application entry point
β”‚   β”œβ”€β”€ icons/                   # Application icons
β”‚   β”œβ”€β”€ build.rs                 # Build script
β”‚   β”œβ”€β”€ Cargo.toml               # Rust dependencies
β”‚   └── tauri.conf.json          # Tauri configuration
β”œβ”€β”€ dist/                        # Production build output
β”œβ”€β”€ public/                      # Static assets
└── tests/                       # Test suites

Available Scripts

# Development
npm run dev              # Start development server with hot reload
npm run build            # Build for production
npm run preview          # Preview production build

# Testing
npm test                 # Run unit tests
npm run test:watch       # Run tests in watch mode
npm run test:e2e         # Run end-to-end tests
npm run test:coverage    # Generate test coverage report

# Code Quality
npm run lint             # Run ESLint
npm run lint:fix         # Fix ESLint issues automatically
npm run format           # Format code with Prettier
npm run type-check       # TypeScript type checking

# Rust Backend
cd src-tauri
cargo check              # Check Rust code
cargo test               # Run Rust tests
cargo build              # Build Rust backend
cargo clean              # Clean build artifacts

Technology Stack

Frontend

  • React 18: Modern React with concurrent features and hooks
  • TypeScript: Full type safety and better development experience
  • Tailwind CSS: Utility-first CSS framework for rapid UI development
  • React Hook Form: Performant forms with validation
  • Zod: Schema validation and type inference
  • React Router: Client-side routing
  • Lucide React: Beautiful icon library
  • React Hot Toast: Elegant notifications

Backend

  • Rust: High-performance, memory-safe systems programming
  • Tauri: Secure, fast desktop application framework
  • SQLx: Async SQL toolkit with compile-time checked queries
  • SQLite: Lightweight, serverless database
  • Tokio: Async runtime for Rust
  • Serde: Serialization/deserialization framework
  • Chrono: Date and time handling
  • Anyhow: Error handling
  • Tera: Template engine for HTML generation

Build Tools

  • Vite: Fast build tool and development server
  • Tauri CLI: Desktop application bundling
  • ESLint: Code linting and quality checks
  • Prettier: Code formatting
  • Jest: Unit testing framework
  • Playwright: End-to-end testing

πŸ“Š Database Schema

The system uses SQLite with the following main entities:

Core Tables

  • customers: Customer information, contact details, and preferences
  • stores: Business locations with settings and configurations
  • services: Service catalog with pricing and categories
  • service_variants: Service variations (Express, Premium, etc.)
  • service_addons: Additional services and add-ons
  • invoices: Invoice headers with customer and store information
  • invoice_items: Invoice line items with services and pricing
  • invoice_item_addons: Add-on services for invoice items

Key Features

  • Referential Integrity: Foreign key constraints ensure data consistency
  • Audit Trail: Created and updated timestamps on all records
  • Soft Deletes: Important records are marked inactive instead of deleted
  • Flexible Pricing: Support for quantity, weight, and area-based pricing
  • GST Compliance: Built-in tax calculation and tracking

🎯 Usage Guide

Setting Up Your Business

  1. Configure Your Store

    • Navigate to Settings β†’ Store Management
    • Add your business details, GST information, and branding
    • Set up default tax rates and invoice preferences
  2. Create Service Catalog

    • Go to Services β†’ Manage Services
    • Add your cleaning services with appropriate pricing
    • Configure service variants and add-ons
    • Set GST rates and HSN codes for compliance
  3. Add Customer Information

    • Use the Customer Management section
    • Import existing customer data or add manually
    • Set up customer preferences and notes

Creating Invoices

  1. New Invoice Workflow

    • Click "New Invoice" from the dashboard
    • Select customer (or create new)
    • Choose services and quantities
    • Review pricing and tax calculations
    • Generate and print invoice
  2. Invoice Customization

    • Choose print format (A5, A4, or Thermal)
    • Add custom notes and terms
    • Apply discounts or express charges
    • Set pickup and delivery dates
    • HTML invoices open automatically in browser with print dialog

Reports and Analytics

  • Sales Dashboard: Overview of daily, weekly, and monthly performance
  • Customer Reports: Top customers, order frequency, and spending patterns
  • Service Analytics: Most popular services and revenue by category
  • GST Reports: Tax collection summary for compliance filing
  • Payment Tracking: Outstanding amounts and payment method analysis

πŸ”§ Configuration

Application Settings

{
  "business": {
    "name": "Your Business Name",
    "address": "Complete Business Address",
    "phone": "+91-XXXXXXXXXX",
    "email": "business@example.com",
    "gst_number": "22AAAAA0000A1Z5",
    "website": "https://yourbusiness.com"
  },
  "invoice": {
    "prefix": "INV",
    "starting_number": 1001,
    "date_format": "DD/MM/YYYY",
    "currency": "INR",
    "decimal_places": 2
  },
  "print": {
    "default_format": "A5",
    "auto_print": false,
    "copies": 1
  }
}

GST Configuration

The system supports Indian GST requirements:

  • SGST + CGST: Intra-state transactions
  • IGST: Inter-state transactions
  • HSN Codes: Service classification codes
  • Tax Rates: 5%, 12%, 18%, 28% standard rates
  • Reverse Charge: B2B transaction support

πŸš€ Building for Production

Development Build

npm run build

Platform-specific Builds

# Windows (from any platform)
npm run build -- --target x86_64-pc-windows-msvc

# macOS (from macOS)
npm run build -- --target x86_64-apple-darwin
npm run build -- --target aarch64-apple-darwin

# Linux (from Linux)
npm run build -- --target x86_64-unknown-linux-gnu

The built application will be available in src-tauri/target/release/bundle/.

πŸ§ͺ Testing

Unit Tests

npm test                    # Run all tests
npm run test:watch          # Watch mode
npm run test:coverage       # With coverage

E2E Tests

npm run test:e2e           # Run Playwright tests

Rust Tests

cd src-tauri
cargo test                 # Run Rust tests
cargo test -- --nocapture  # With output

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
    • Follow the coding standards
    • Add tests for new features
    • Update documentation
  4. Commit your changes
    git commit -m 'Add amazing feature'
  5. Push to your fork
    git push origin feature/amazing-feature
  6. Open a Pull Request

Code Standards

  • TypeScript: Strict mode enabled, full type coverage
  • Rust: Follow standard Rust conventions and clippy recommendations
  • Testing: Minimum 80% code coverage for new features
  • Documentation: Update docs for any API changes

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Troubleshooting

Common Issues

Build Failures:

  • Ensure all prerequisites are installed
  • Clear node_modules and reinstall: rm -rf node_modules && npm install
  • Clear Rust cache: cd src-tauri && cargo clean

Database Issues:

  • Delete database.sqlite to reset to default schema
  • Check file permissions in the application data directory

Print Issues:

  • Ensure Chrome browser is installed and set as default
  • Check browser print settings and page setup
  • Try different print formats (A4, A5, Thermal)
  • Verify HTML files are opening correctly in browser

Performance Issues:

  • Check available disk space (SQLite database grows over time)
  • Consider archiving old invoices
  • Monitor system resources during HTML generation
  • Clear browser cache if print previews are slow

For more detailed troubleshooting, see docs/DEVELOPMENT_SETUP.md and docs/BUILD_GUIDE.md.

πŸ“ž Support

πŸ™ Acknowledgments

  • Built with ❀️ using Tauri and React
  • Icons by Lucide
  • UI components inspired by shadcn/ui
  • Special thanks to the open-source community

Made with πŸš€ by the UCLEAN Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •