invoice-gen

Professional invoices for freelancers and small teams

A Flask application for company and client records, labor vs itemized lines, logo uploads, PDF-style output flows, and draft autosave (local + server) so work is not lost on navigation. Production deploy uses Gunicorn behind nginx with SCRIPT_NAME=/invoice for subpath hosting.

Project structure

invoice_gen/
├── app.py                 # Flask app factory / routes
├── templates/             # Jinja2 templates (dashboard, invoice UI)
├── static/                # CSS, JS, uploaded logos
├── docker-compose.yml     # dev/prod switch via Dockerfile / env
└── requirements.txt

Environments

Development mounts source for hot reload and uses Flask’s server; production uses Gunicorn, secure cookies, and HTTPS-friendly URL generation.

DevelopmentFLASK_ENV=development, debug, optional Dockerfile.dev, relaxed cookie security for HTTP.
ProductionGunicorn workers, SESSION_COOKIE_SECURE, PREFERRED_URL_SCHEME=https, no debug PIN.
Static/invoice/static/ and uploads can be aliased to host paths outside the container for large files.

Design

The UI centers on a single dashboard workflow: define parties, add line items (labor vs goods), preview, then generate. Draft merge logic avoids clobbering local edits when the server returns partial state—see the repo changelog for SQLAlchemy 2.x route fixes and HTTPS redirect behavior.