From 5b378cad38f7d689ec1c9b7edfb582c946c97e56 Mon Sep 17 00:00:00 2001 From: Stef Date: Tue, 8 Jul 2025 11:00:30 +0200 Subject: [PATCH] Add barcode scanning and meal selection features Introduces a barcode scanner page using the camera for food item entry, adds routes for selecting meal types and scanning products, and updates the test.html template to allow adding items to specific meals. Also updates branding in base.html, changes the Flask secret key, and enables SSL by default in app.py. --- README.md | 4 +- app.py | 10 +++- application/templates/base.html | 2 +- application/user/routes.py | 43 +++++++++++++- application/user/templates/get_item.html | 62 ++++++++++++++++++++ application/user/templates/test.html | 74 +++++++++++++----------- 6 files changed, 151 insertions(+), 44 deletions(-) create mode 100644 application/user/templates/get_item.html diff --git a/README.md b/README.md index 89fc073..b7817a2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,2 @@ # cal_counter -Calorie Counter Webapp - -Bello -Iman +Calorie Counter Webapp \ No newline at end of file diff --git a/app.py b/app.py index 5b1f5fb..93d892b 100644 --- a/app.py +++ b/app.py @@ -13,7 +13,7 @@ from application.user.routes import user_bp from typing import Optional # Config -app.config["SECRET_KEY"] = "Iman" +app.config["SECRET_KEY"] = "Stef123" login_manager.login_view = "login" # type: ignore @@ -81,5 +81,9 @@ def scan(): # Run if __name__ == "__main__": - # app.run(host="0.0.0.0", debug=True, ssl_context=("cert.pem", "key.pem")) - app.run(host="0.0.0.0", debug=True) + app.run( + host="0.0.0.0", + port=443, + debug=True, + ssl_context=("cert.pem", "key.pem"), + ) diff --git a/application/templates/base.html b/application/templates/base.html index 3cf8b6b..1458fd9 100644 --- a/application/templates/base.html +++ b/application/templates/base.html @@ -13,7 +13,7 @@