A simple and efficient Invoice Generator built with Python and Flask. Designed to create professional PDF invoices with support for client management, VAT handling, and export services.
- Client Management: Add, edit, and list clients.
- Invoice Creation: Create invoices with multiple line items.
- Auto-Numbering: Intelligent invoice numbering based on client and year.
- PDF Generation: Generate professional PDF invoices ready to send.
- VAT Handling: Configurable VAT percentage.
- Export Services: Special "VAT 0%" mode for export services with required legal notices.
- Dashboard: Track invoice status (Draft, Paid).
-
Clone the repository:
git clone <repository-url> cd Invoice-generator
-
Create a virtual environment (optional but recommended):
python -m venv .venv # Windows .venv\Scripts\activate # Mac/Linux source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Initialize the Database:
# Initialize the database migration repository (if not exists) flask db init # Generate migration script (if models changed) flask db migrate -m "Initial migration" # Apply migrations flask db upgrade
-
Run the application:
python app.py
-
Open in Browser: Go to
http://127.0.0.1:5000
When you first run the application, verify your settings:
- Go to the Settings page in the nav bar.
- Update your Sender Information (Name, Address, Email).
- Update your Bank Details (IBAN, Swift, Account Holder).
- Flask: Web framework.
- SQLite: Database.
- ReportLab: PDF generation.
- HTML/CSS: Frontend.
To create a standalone executable for distribution:
-
Install PyInstaller (if not already installed):
pip install pyinstaller
-
Build the Executable: Run the following command in the project root:
python -m PyInstaller --name "InvoiceGenerator" --onefile --windowed --add-data "templates;templates" --add-data "static;static" --add-data "migrations;migrations" app.py
-
Locate the Output: The executable will be generated in the
distfolder:dist\InvoiceGenerator.exe -
Distribution: You can zip and send
InvoiceGenerator.exe. It does not require Python to be installed on the target machine.
To build and push the Docker image to Docker Hub manually:
-
Build the image:
docker-compose build
-
Tag the image:
docker tag invoice-generator-app:latest josephlteif/invoice-generator:latest
-
Push to Docker Hub:
docker push josephlteif/invoice-generator:latest
-
On your Server:
- Update your Portainer stack or run
docker pull josephlteif/invoice-generator:latest. - Restart the container.
- Update your Portainer stack or run