StockMonitor is a dockerized Flask web app used by pizzerias to monitor raw product price evolution from supplier invoices in PDF format.
- PDF parser architecture with parser strategies per supplier.
- Authenticated API using
@require_authfor protected endpoints. - Default user pre-seeded from environment variables.
- Products with source name, editable natural name, and latest known unit price.
- Invoices stored in database including original PDF binary and parsed entries.
- Product history and unit price timeline.
- Shopping list/cart with estimated total based on latest product prices.
- Mobile-friendly web interface.
- Create env file:
cp .env.example .env- Run with Docker:
docker compose up --build- Open
http://localhost:5000and log in withDEFAULT_USERNAME/DEFAULT_PASSWORDfrom.env.
- Get token:
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin123"}'- Use token:
curl http://localhost:5000/api/products \
-H "Authorization: Bearer <token>"POST /api/auth/loginPOST /api/invoices/upload(PDF multipart file)GET /api/invoicesGET /api/invoices/<id>GET /api/products?q=...PATCH /api/products/<id>(rename natural name)GET /api/products/<id>/historyGET /api/cartPOST /api/cart/itemsDELETE /api/cart/items/<item_id>
pytest