Commit Graph

24 Commits

Author SHA1 Message Date
312eda85df Can now set macro target 2025-10-10 19:50:18 +02:00
c3e9c8631d Remove part of day from remaining code 2025-08-14 12:32:00 +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
97ff4acf02 Add change password functionality for users
Introduces a change password route, form, and template, allowing authenticated users to update their password. Updates the User model with a method to set the must_change_password flag. Adjusts login and navigation logic to support the new flow and ensures users are redirected to change their password if required.
2025-08-11 18:03:18 +02:00
cd9ae72864 Reapply "Add must_change_password field to User model"
This reverts commit 47241e341e.
2025-08-11 17:20:45 +02:00
47241e341e Revert "Add must_change_password field to User model"
This reverts commit 42747df92f.
2025-08-11 17:17:30 +02:00
42747df92f Add must_change_password field to User model
Introduces a new boolean column 'must_change_password' to the User model and database schema. This field enforces password change requirements for users and is included in the model's constructor and migration.
2025-08-11 17:17:10 +02:00
3f9bd8984d Change energy field from integer to float
Updated the FoodItem model and FoodItemForm to use float for the energy field instead of integer.
2025-08-11 16:51:31 +02:00
7fe30bfebf Improve FoodItem uniqueness and add name constraint
Refactored add_meal routes to check for existing FoodItems by name or barcode and improved form handling. Made barcode optional in FoodItemForm. Added a unique constraint on (name, owner_id) for FoodItem in both the model and database migrations, while retaining the (barcode, owner_id) constraint. Updated FoodItem relationship to cascade deletes.
2025-08-11 14:32:53 +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
bb5b2e8bc7 Change barcode field from integer to string
Updated the barcode field in FoodItem model and form from integer to string to support barcodes with leading zeros or non-numeric values. Added validation to ensure barcode contains only digits. Updated seed data to use string barcodes.
2025-07-08 11:06:03 +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
7bf8a754db Add FoodLog model and update relationships
Introduces the FoodLog model to track user food consumption, adds relationships between User, FoodItem, and FoodLog, and updates seed.py to include sample FoodLog data. Also fixes route redirection to use the correct blueprint namespace.
2025-07-01 13:06:26 +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
c5acf7d19b Refactor food item editing and remove index template
Removed the unused index.html template. Refactored the food item editing route to use a new updateFromForm method in the FoodItem model for updating fields from the form, simplifying the update logic and form population in routes.py.
2025-06-29 16:25:55 +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
a5312d7ad0 Add admin check and update FoodItems model
Introduced an admin_required check for all admin routes using Flask-Login's current_user. Updated the FoodItems model to use per-100g nutritional fields and removed unit relationships. Seed script now creates both admin and regular user accounts.
2025-06-27 17:23:54 +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