Commit Graph

27 Commits

Author SHA1 Message Date
Stef
88f553a08e New webpage structure, not yet finished. Change password implemented again (#11)
* Adjusted GUI of daily dashboard to better deal with float values

* Change password + New base (#10)

* created a new Base template to test with

* Changed out the base and added a new password page

* Password change works, UI needs redisgn
2025-10-08 15:38:40 +02:00
73985b9b6d Refactor add meal flow and remove v2 routes
Migrated add_meal_v2 routes and templates to add_meal, renaming endpoints and updating references throughout the app. Removed legacy daily_log2 route and template, consolidating to daily_log. Moved macro_arr_to_json to utils.py for reuse. Updated navigation and redirect logic to use new routes. Improved item finding and barcode scanning UI.
2025-08-14 15:50:17 +02:00
f7f6d23562 Removed old log for new log 2025-08-14 12:29:02 +02:00
d78f48710e Add meal v2 flow and user timezone support
Introduces a new add_meal_v2 blueprint with barcode scanning, item search, and improved meal logging UI. Adds user timezone support: login form now captures timezone, User model and database schema updated, and timezone is set on login. Refactors templates and forms to support these changes, and removes the old login template.
2025-08-14 06:08:17 +02:00
85297daaaf Add new daily log dashboard and macro summary
Introduces a new route and template for an enhanced daily log dashboard with macro nutrient summary. Refactors FoodItem model to add type annotations and a macros() method, and updates form handling to default missing values to zero. Also adds a navigation link to the new dashboard in the base template.
2025-08-14 02:49:06 +02:00
c7395b07d9 Move logout route to auth blueprint
The logout route was relocated from the main app to the auth blueprint for better organization. The logout link in the base template was updated to reference the new route location.
2025-08-11 18:05:30 +02:00
0da580faf1 Refactor login flow to use auth blueprint
Moved login route and logic from app.py to application/auth/routes.py under the 'auth' blueprint. Updated all references to the login route to use 'auth.login'. Added a dedicated login.html template under application/auth/templates. Adjusted login_required utility and default_return logic for consistency.
2025-08-11 17:43:46 +02:00
ea2ea27d9e Refactor login_required and add auth blueprint
Moved the login_required logic to a new utils.py for reuse. Added a new auth blueprint and registered it in app.py. Updated user blueprint to use the shared login_required function.
2025-08-11 17:33:47 +02:00
5f0312e4f0 Add favicon support and static favicon file
Added a route to serve /favicon.ico using send_from_directory and included the favicon.ico file in the static directory. This improves browser tab display and branding.
2025-08-11 15:13:45 +02:00
d15ade61f2 Remove barcode scanner feature and template
Deleted the /scan route and its associated scan.html template, removing the barcode scanner functionality from the application.
2025-08-11 15:02:40 +02:00
6ecec986b7 Update app.py 2025-08-11 02:00:42 +02:00
ef2d969654 Create default admin user if no users exist
Adds logic to automatically create an admin account with default credentials if the user table is empty when the app starts. This ensures there is always an admin user available for initial setup.
2025-08-11 01:57:31 +02:00
b8bd8d802b Change server port to 80 and improve log removal redirect
Updated app.py to run the server on port 80 without SSL context. Enhanced the log removal route to redirect with the current offset if present in the session.
2025-08-07 21:36:25 +02:00
e3119a69fc Add day navigation to daily log view
Updated the daily log route and template to support viewing logs for previous and next days using an offset parameter. The default redirect now points to the daily log instead of the dashboard. The daily_log.html template includes navigation buttons for moving between days.
2025-08-07 20:49:10 +02:00
c552a4571e Add barcode-based meal logging workflow
Introduces a new add_meal blueprint with routes and templates for scanning barcodes, adding new food items, and logging meals. Updates FoodItemForm and FoodLogForm validation, changes FoodLog.amount to float, and integrates the new workflow into the daily log UI. Refactors user routes and templates to support the new meal logging process.
2025-08-07 17:00:56 +02:00
5b378cad38 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.
2025-07-08 11:00:30 +02:00
30e5e959cd Add daily overview and part_of_day to food logs
Introduces 'overview' and 'test' routes and templates for daily nutrition summaries. Updates FoodLog model to include 'part_of_day' and 'date_' fields for better log categorization. Adjusts log creation and seed data to support new fields. Removes SSL context from app run for local development.
2025-07-07 14:44:50 +02:00
12d7e0c30c Enable HTTPS and external access in Flask app
Updated app.run to bind to 0.0.0.0 for external access and enabled HTTPS using cert.pem and key.pem SSL context.
2025-07-01 12:11:02 +02:00
1b79925b49 Move food item routes to user blueprint
Refactored food item related routes from app.py to application/user/routes.py under the user blueprint. Updated template and JS references to use the blueprint route names, improving code organization and modularity.
2025-06-29 17:52:03 +02:00
a6f6cdf346 Add manual food item entry and update food item management
Introduces a new route and template for manually adding food items. Updates food item edit and delete operations to use the food item's ID instead of barcode and adds ownership checks. Adjusts form and model to make barcode optional, and updates navigation and dashboard templates to reflect these changes.
2025-06-29 17:41:58 +02:00
e00bfee948 Refactor food item nutrition field names for consistency
Standardized field names for nutritional values in FoodItem model and throughout the codebase, changing 'fats_100g' to 'fat_100', 'saturated_fats_100g' to 'saturated_fat_100', and similar updates for other fields. Updated all references in models, templates, routes, and seed data to match the new naming convention for improved clarity and consistency.
2025-06-29 16:36:05 +02:00
700b351b0e Add edit and delete functionality for food items
Implemented routes and templates to allow users to edit and delete their food items from the dashboard. Updated dashboard template to include Edit and Delete buttons. Refactored template locations and removed unused dashboard.html. Fixed redirect logic in app.py and updated seed data.
2025-06-29 13:54:31 +02:00
970d102831 Add user dashboard and per-user food item ownership
Introduces a user dashboard route and template, moving dashboard logic to a user blueprint. FoodItem now has an owner_id field and a unique constraint on (barcode, owner_id), with relationships set up in the User model. Updates food item creation to associate with the current user, and adds a utility script for dropping a temporary table.
2025-06-29 11:24:34 +02:00
a39f54dbb0 Add food item management and improve barcode workflow
Implemented routes and forms for adding and viewing food items by barcode, including templates for displaying and entering nutritional information. Enhanced the scan workflow to redirect to food item details or entry form. Added admin ability to delete food items. Improved UI for login and scan pages. Updated FoodItem model and form fields for consistency and accuracy.
2025-06-29 08:39:25 +02:00
0919048cfd 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.
2025-06-29 00:08:25 +02:00
d5e8c3fa94 Refactor food item model and add barcode scanner page
Renamed FoodItems to FoodItem and Units to Unit in models.py, updated related imports and usage throughout the codebase. Added a barcode scanner test page using ZXing in the admin section. Improved food_items.html to display nutritional information in a table. Registered the admin blueprint in app.py and cleaned up blueprint registration in __init__.py. Updated seed.py to use the new FoodItem model.
2025-06-28 12:53:27 +02:00
b498f3693a Initial commit: Flask calorie counter app setup
Add base Flask application with user authentication, SQLAlchemy models for users, units, and food items, admin blueprint, and basic templates. Includes database migration setup, login form, and seed script for initial user creation.
2025-06-26 14:19:09 +02:00