A simple and efficient web-based system for managing invoices and customers, designed to be lightweight and easy to use.
✅ Secure Login – Simple and secure session-based authentication
✅ Customer Management – Add, edit, and delete customers
✅ Invoice Creation – Easy interface with instant total calculation
✅ View & Export PDF – View invoices and download them as PDF
✅ Dashboard – Quick sales statistics overview
✅ Validation – Data validation and integrity checks
✅ Arabic Interface – Fully Arabic user interface
BACK-END
_ Python 3.x
_ Flask – Web framework
_ SQLAlchemy – ORM for database management
_ SQLite – Local database
_ Frontend
_ HTML5
_ CSS3
_ JavaScript
_ Bootstrap 5 – For styling and responsiveness
PDF
_ WeasyPrint – Convert HTML to PDF
invoice_system/
├── app.py # Main entry point
├── config.py # Configuration settings
├── models/
│ ├── customer.py # Customer model
│ ├── invoice.py # Invoice model
│ └── invoice_item.py # Invoice item model
├── routes/
│ ├── auth.py # Authentication
│ ├── dashboard.py # Dashboard
│ ├── customers.py # Customer management
│ └── invoices.py # Invoice management
├── templates/ # HTML templates
├── static/ # CSS & JavaScript
├── pdf/ # PDF generation
└── database.db # Database file
BASH
# Clone or copy the project
cd INVOICES_SYS
# Install dependencies
pip install -r requirements.txt
BASH
python app.py
http://localhost:5000
- id: Unique identifier
- name: Customer name (required)
- phone: Phone number
- email: Email address
- address: Address
- created_at: Creation date
- id: Unique identifier
- invoice_number: Unique invoice number
- customer_id: Customer ID (relationship)
- date: Invoice date
- currency: Currency
- subtotal: Subtotal amount
- total: Final total amount
- created_at: Creation date
- id: Unique identifier
- invoice_id: Invoice ID (relationship)
- item_name: Item name
- quantity: Quantity
- price: Price
- total: Total (quantity × price)
login_required → session → protected routes
View → Add → Edit → Delete
Select customer → Add items → Calculate total → Save
Read-only view → Download PDF → Print
Flask==2.3.2
Flask-SQLAlchemy==3.0.5
WeasyPrint==68.0
Werkzeug==2.3.6
In config.py:
DEBUG = True # Development mode
SECRET_KEY = '...' # Session security key
DATABASE = 'database.db' # Database file
###No Customers Found
Solution: Add a customer first before creating an invoice.
Make sure WeasyPrint and all required dependencies are installed.
It will be created automatically when running the application for the first time.