Add barcode scanning and nutrition lookup feature

Introduces a new /scan route and template for barcode scanning using ZXing in the browser. Adds a /nutri/<barcode> API endpoint to fetch food item nutrition data by barcode. Updates the FoodItem model to include a barcode field and a to_dict method for JSON serialization. Also updates seed data to include a barcode.
This commit is contained in:
2025-06-29 00:08:25 +02:00
parent d5e8c3fa94
commit 0919048cfd
4 changed files with 148 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ with app.app_context():
protein=5.5,
saturated_fats=10,
sugar=35,
barcode=2278012003502,
)
)