100 Commits
Author SHA1 Message Date
Peter Stockings ff6a921550 Improve styling of exercise history/sparkline partials 2026-02-28 16:33:43 +11:00
Peter Stockings 57f7610963 Remove requirements.txt 2026-02-27 12:39:13 +11:00
Peter Stockings a401c1a1ab Switch to UV 2026-02-27 12:36:40 +11:00
Peter Stockings b0b42c0d77 Migrate from psycopg2 to psycopg3 to fix SIGSEGV crashes 2026-02-27 12:06:38 +11:00
Peter Stockings 89d0a7fb12 Switch to gevent workers to prevent SIGSEGV 2026-02-27 11:57:41 +11:00
Peter Stockings 37e56559a9 Fix python version formatting 2026-02-27 11:49:11 +11:00
Peter Stockings d9def5c6b6 Add .python-version set to 3.14.0 2026-02-27 11:47:17 +11:00
Peter Stockings ccb71c37a4 Update remaining Flask extensions to versions compatible with Flask 3 2026-02-27 11:46:02 +11:00
Peter Stockings 7aebf8284d Update flask-htmx to fix Flask 3 dependency conflict and remove deprecated runtime.txt 2026-02-27 11:43:03 +11:00
Peter Stockings 28b542e618 Bump up to new python buildpack 2026-02-27 11:28:04 +11:00
Peter Stockings fb07c1d8ed Bump up python version and packages 2026-02-27 11:26:09 +11:00
Peter Stockings 1c51bb6ced Remove dark TW classes from exercise history table 2026-02-27 10:29:54 +11:00
Peter Stockings c4feaa97dd Add remember me cookie so users dont have to login each workout 2026-02-26 23:59:34 +11:00
Peter Stockings 73e02a7b12 Show exercise weekly/monthly progress on exercise history table 2026-02-26 23:53:47 +11:00
Peter Stockings b31ab97cd4 Allow users to toggle to progress table view when selecting an exercise 2026-02-26 23:48:08 +11:00
Peter Stockings 895b813a35 Add button to topsets to show history as a table 2026-02-26 23:26:49 +11:00
Peter Stockings 67009c9603 Add search for activity logs 2026-02-13 00:28:12 +11:00
Peter Stockings 8c08140ad0 Move settings endpoints to separate blueprint 2026-02-08 18:48:03 +11:00
Peter Stockings 31078b181a Split up settings sub pages into templates loaded by htmx to reduce initial load 2026-02-08 18:25:43 +11:00
Peter Stockings a6eca1b4ac Add ability to add/update/delete exercise categories 2026-02-08 16:48:47 +11:00
Peter Stockings ce28f7f749 Add exercise category search in settings 2026-02-08 16:31:05 +11:00
Peter Stockings 31f738cfb3 Improve look of exercise list in settings page 2026-02-08 16:23:31 +11:00
Peter Stockings 0cd74f7207 Create blueprint for exercises 2026-02-08 16:08:30 +11:00
Peter Stockings ef91dc1fe4 Changel LLM model gemini-2.0-flash -> gemini-2.5-flash-lite 2026-02-08 14:51:11 +11:00
Peter Stockings a9f3dd4a38 Embed achievement badges in exercise progress graphs 2026-02-06 00:20:12 +11:00
Peter Stockings 3f3725d277 Improve look of SQL explorer page, and improve validation of exercise selection in workouts 2026-02-04 12:37:05 +11:00
Peter Stockings 09d90b5a1e Round person graph models to one decimal place to reduce svg size 2026-02-04 09:54:03 +11:00
Peter Stockings 3fabde145d Preload csss & js, add skeleton graphs for loading 2026-02-04 09:53:35 +11:00
Peter Stockings 71a5ae590e Add brotli complression, cache graph requests for 5mins and add pagination for person overview 2026-02-04 09:28:18 +11:00
Peter Stockings b4121eada7 Add database connection pooling 2026-02-04 00:03:03 +11:00
Peter Stockings a6a71f3139 Only load graphs when they come into view 2026-02-03 23:52:59 +11:00
Peter Stockings 9998616946 Add defer to hyperscript 2026-02-03 23:52:21 +11:00
Peter Stockings c20f2e2f85 Added safety checks to the graph regression logic in utils.py. This stops those "illegal value" server warnings and makes the math more efficient for small datasets 2026-02-03 23:51:52 +11:00
Peter Stockings ec8d7f6825 Add asset caching 2026-02-03 23:36:58 +11:00
Peter Stockings 2e79ad1b8b Remove more unused js and css 2026-02-03 23:36:30 +11:00
Peter Stockings d223bdeebc Add compression 2026-02-03 23:25:13 +11:00
Peter Stockings 9a2ce6754a Remove unused js libs 2026-02-03 23:24:49 +11:00
Peter Stockings afc5749c82 Reduce size of logo 2026-02-03 23:08:45 +11:00
Peter Stockings 2d1509a0cd Remove dependencies on external fonts 2026-02-03 23:03:29 +11:00
Peter Stockings 83c3cd83a6 Remove SweetAlert 2 library 2026-02-03 22:55:12 +11:00
Peter Stockings db8d39d1eb Fix issue where adding a set would result in two 'Topset added' notification 2026-02-03 22:51:19 +11:00
Peter Stockings 437271bc8c Fix for mobile monthly calendar view so clicking redirects to workout view 2026-02-03 15:21:36 +11:00
Peter Stockings ac093ec2e0 Update programs functionality 2026-02-03 15:10:59 +11:00
Peter Stockings b26ae1e319 Adjust monthly calendar view sets font size 2026-02-02 22:47:25 +11:00
Peter Stockings f53bf3d106 Improve monthly calendar view 2026-02-02 21:51:32 +11:00
Peter Stockings 2b330e4743 Add acheivement badges to monthly calendar view 2026-02-02 20:54:28 +11:00
Peter Stockings bc2a350e90 Show monthly stats in calendar view 2026-02-01 10:55:28 +11:00
Peter Stockings a59cef5c95 Add missing entries to changelog 2026-01-31 15:06:23 +11:00
Peter Stockings d7c9f71d22 Add activity logs table 2026-01-31 14:53:01 +11:00
Peter Stockings 62080b97a4 Ensure only admins can delete users/exercises and users can only edit there own name 2026-01-31 14:19:16 +11:00
Peter Stockings 32719cc141 Add is_admin property to person table 2026-01-31 14:08:47 +11:00
Peter Stockings 32b7527576 Change settings page use tabs 2026-01-31 13:58:22 +11:00
Peter Stockings 9e20976591 Add 'Machine vs Free Weight' & 'Compound vs Isolation' breakdowns for workouts 2026-01-31 13:11:21 +11:00
Peter Stockings 8b276804b9 Add popover for details on muscle distribution in a workout 2026-01-31 00:19:02 +11:00
Peter Stockings 5d2f3986bd Switch muscle distribution to a line chart 2026-01-31 00:11:06 +11:00
Peter Stockings d03581bff4 feat: assign tags to exercises and show muscle distribution of workout 2026-01-30 23:53:04 +11:00
Peter Stockings 78f4a53c49 Fix error when attempting to update set due to missing exercise id param in template 2026-01-30 22:54:50 +11:00
Peter Stockings e156dd30cc Add badges to sets showing stats ie weight/rep increase or how many weeks stalled 2026-01-30 22:42:06 +11:00
Peter Stockings eada1a829b Log LLM usage 2026-01-30 19:45:31 +11:00
Peter Stockings 1c500328d1 Fix AI SQL query generation 2026-01-30 19:37:40 +11:00
Peter Stockings 14d29724f1 Log SQL executions made via UI 2026-01-30 19:17:25 +11:00
Peter Stockings 4dcf589b63 Log login attempts 2026-01-30 19:07:09 +11:00
Peter Stockings b6443bc1e2 Make background of ERD transparent 2026-01-30 18:47:26 +11:00
Peter Stockings ec12072a33 Improve layout of ERD 2026-01-29 19:30:11 +11:00
Peter Stockings d72bb1f30f Make SQL queries require auth 2026-01-29 19:17:35 +11:00
Peter Stockings 722ff4d8e5 Show navbar title even on mobile 2026-01-29 19:01:11 +11:00
Peter Stockings cb08992e19 Make navbar more responsive on mobile 2026-01-29 18:56:41 +11:00
Peter Stockings 036d852aab Add authentication for update/delete endpoints 2026-01-29 18:41:24 +11:00
Peter Stockings e7520035c7 Add script to update password for a user 2026-01-29 18:40:49 +11:00
Peter Stockings 144e555abb Update logo 2026-01-29 17:17:42 +11:00
Peter Stockings 26dda12fff Make login/signup links responsive on mobile 2026-01-29 15:54:09 +11:00
Peter Stockings 2dc2b62d7b Improve performance of calendar view 2026-01-29 15:21:58 +11:00
Peter Stockings c14b43f9ab Revert back to using npx in build step due to dokku build pack using node (Should update this) 2026-01-29 13:26:10 +11:00
Peter Stockings 6fb9ba126f Generate ERD diagram from schema at build time rather then dynamically to reduce dependency on mermaid js library in the frontend 2026-01-29 13:20:45 +11:00
Peter Stockings 509d11443d Remove dependency on tail select component and instead role my own to minmise bundle size 2026-01-29 12:49:12 +11:00
Peter Stockings 04fe00412a Add tailwind build step 2026-01-29 09:30:51 +11:00
Peter Stockings 71315eb719 Speed up people_graphs 2026-01-29 00:41:08 +11:00
Peter Stockings 436eb16c32 Remove plotly in attempt to fix build error 2026-01-29 00:23:20 +11:00
Peter Stockings a94271c790 Remove license from readme 2026-01-29 00:10:55 +11:00
Peter Stockings c607f672c9 Update readme 2026-01-29 00:08:40 +11:00
Peter Stockings 3a0d4531b6 Switch to using polars 2026-01-29 00:05:25 +11:00
Peter Stockings dd82f461be feat: Add workout program management
- Create database tables: workout_program, program_session, person_program_assignment.
- Add Flask blueprint `routes/programs.py` with routes for creating, listing, viewing, and deleting programs.
- Implement program creation form (`templates/program_create.html`):
    - Allows defining program name, description, and multiple sessions.
    - Each session includes a name and dynamically added exercise selections.
    - Uses `tail.select` for searchable exercise dropdowns.
    - JavaScript handles dynamic addition/removal of sessions and exercises.
- Implement backend logic for program creation:
    - Parses form data including multiple exercises per session.
    - Automatically finds or creates non-person-specific tags based on selected exercises for each session.
    - Saves program and session data, linking sessions to appropriate tags.
- Implement program list view (`templates/program_list.html`):
    - Displays existing programs.
    - Includes HTMX-enabled delete button for each program.
    - Links program names to the view page using HTMX for dynamic loading.
- Implement program detail view (`templates/program_view.html`):
    - Displays program name, description, and sessions.
    - Parses session tag filters to retrieve and display associated exercises.
- Update changelog with details of the new feature.
2025-04-24 20:17:30 +10:00
Peter Stockings e7d125d57b Move workout tag logic into tags blueprint 2025-04-21 20:13:30 +10:00
Peter Stockings c88d28b47c Fix issue with newly added workout tags not being rendered 2025-04-20 17:05:32 +10:00
Peter Stockings 7aa7f9b8dc Partial refactor of tags functionality
Still need to move tags db logic to BP and move workout tag logic to BP as well
2025-04-19 21:10:34 +10:00
Peter Stockings e947feb3e3 refactor(sql_explorer): Replace Plotly with SVG rendering for plots
Replaces the Plotly-based graph generation in the SQL Explorer with direct SVG rendering within an HTML template, similar to the exercise progress sparklines.

- Modifies `routes/sql_explorer.py` endpoints (`plot_query`, `plot_unsaved_query`) to fetch raw data instead of using pandas/Plotly.
- Adds `utils.prepare_svg_plot_data` to process raw SQL results, determine plot type (scatter, line, bar, table), normalize data, and prepare it for SVG.
- Creates `templates/partials/sql_explorer/svg_plot.html` to render the SVG plot with axes, ticks, labels, and basic tooltips.
- Removes the `generate_plot` function's usage for SQL Explorer and the direct dependency on Plotly for this feature.
2025-04-15 19:34:26 +10:00
Peter Stockings 51ec18c461 feat: Add dismissible exercise progress graph to workout page
Adds a feature to view exercise progress directly from the workout page.

- Modifies `templates/partials/topset.html`.
- Adds a graph icon next to the exercise name in the topset list.
- Clicking the icon uses HTMX to fetch and display the progress graph for that exercise inline in a new table row.
- Implements a dismiss button using hyperscript to hide the graph after viewing.
2025-04-13 19:20:53 +10:00
Peter Stockings 3da0dc3b3d Fix for regression where selecting exercise for a new set on an exercise that hasnt had an set recorded wouldnt diplay the name 2025-04-13 18:04:11 +10:00
Peter Stockings 62e203bc2a feat: Add SQL script export option
- Added functionality to export the full database schema (CREATE statements) and data (INSERT statements) as a single `.sql` file.
- Created a new route `/export/database.sql` in `routes/export.py`.
- Added helper functions to `routes/export.py` (adapted from `sql_explorer`) to generate schema CREATE statements and data INSERT statements.
- Added a download link for the SQL export to the Settings page (`templates/settings.html`).
- Updated the changelog entry for data export to include the SQL option.
2025-04-12 21:17:19 +10:00
Peter Stockings 2d67badd32 Remove comments from generated SQL queries 2025-04-05 21:51:56 +11:00
Peter Stockings 64dda01af6 Add on requests==2.26.0 to requirements.txt 2025-04-05 21:38:17 +11:00
Peter Stockings ead73e8190 Add instructions on how to set Gemni model 2025-04-05 21:29:41 +11:00
Peter Stockings bd8a3fcdb2 refactor: Use REST API for Gemini SQL generation
- Modified the `_generate_sql_from_natural_language` helper function in `routes/sql_explorer.py` to use direct REST API calls via the `requests` library instead of the `google-generativeai` Python library.
- Added `requests` and `json` imports and removed the `google-generativeai` import.
- Updated error handling for API communication and response parsing.
- Updated the corresponding changelog entry.
2025-04-05 21:17:56 +11:00
Peter Stockings b875b49eca feat: Refactor endpoint listing into blueprint
- Moved endpoint listing and searching routes (`list_endpoints`, `search_endpoints`) and helper function (`get_routes`) from `app.py` into a new blueprint at `routes/endpoints.py`.
- Added `/endpoints` URL prefix to the blueprint.
- Registered the new `endpoints_bp` blueprint in `app.py`.
- Removed the original endpoint route definitions and helper function from `app.py`.
- Updated `url_for` calls in relevant templates (`endpoints.html`, `base.html`) to reference the new blueprint endpoints (e.g., `endpoints.list_endpoints`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
```
2025-03-31 23:15:24 +11:00
Peter Stockings a8fe28339b I have refactored the SQL Explorer functionality into its own blueprint (routes/sql_explorer.py) with a /sql URL prefix. This involved moving the relevant routes from app.py, registering the new blueprint, removing the old routes, updating url_for calls in the templates, and documenting the change in the changelog.
Here is a conventional commit message summarizing the changes:

```
feat: Refactor SQL Explorer into blueprint

- Moved SQL Explorer routes (view explorer, save/load/execute/delete queries, view schema, plot queries) from `app.py` into a new blueprint at `routes/sql_explorer.py`.
- Added `/sql` URL prefix to the blueprint.
- Registered the new `sql_explorer_bp` blueprint in `app.py`.
- Removed the original SQL Explorer route definitions from `app.py`.
- Updated `url_for` calls in relevant templates (`sql_explorer.html`, `partials/sql_explorer/sql_query.html`, `base.html`) to reference the new blueprint endpoints (e.g., `sql_explorer.sql_explorer`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
```
2025-03-31 23:00:54 +11:00
Peter Stockings eaeb4ab2c8 feat: Refactor workout functionality into blueprint
- Moved workout-related routes (create/delete/edit workouts, topsets, tags, start dates, show workout) from `app.py` into a new blueprint at `routes/workout.py`.
- Integrated workout view model logic from `features/workout.py` directly into `routes/workout.py` helper function `_get_workout_view_model`.
- Removed `features/workout.py` and the corresponding class instantiation in `db.py`.
- Registered the new `workout_bp` blueprint in `app.py`.
- Removed the original workout route definitions from `app.py`.
- Updated `url_for` calls in relevant templates (`workout.html`, `person_overview.html`, `partials/workout_tags.html`, `partials/topset.html`, `partials/start_date.html`, `partials/new_set_form.html`, `notes.html`, `calendar.html`) to reference the new blueprint endpoints (e.g., `workout.create_workout`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
2025-03-31 22:38:48 +11:00
Peter Stockings 78436b230b feat: Refactor notes functionality into blueprint
- Moved notes-related routes (viewing/editing workout notes) from `app.py` into a new blueprint at `routes/notes.py`.
- Integrated notes-specific database logic (fetching and updating notes) directly into `routes/notes.py` helper functions, removing the corresponding methods from `db.py` for better encapsulation.
- Registered the new `notes_bp` blueprint in `app.py`.
- Removed the original notes route definitions from `app.py`.
- Updated `url_for` calls in `templates/partials/workout_note.html` to reference the new blueprint endpoints (e.g., `notes.get_person_notes`).
- Updated `templates/changelog/changelog.html` to document this refactoring in its own entry.
2025-03-31 22:08:47 +11:00
Peter Stockings 6095e76f10 Here is a conventional commit message summarizing the refactoring work:
```
feat: Refactor calendar feature into blueprint

- Moved calendar logic from `features/calendar.py` and `app.py` into a new blueprint at `routes/calendar.py`.
- Removed the `Calendar` class and refactored logic into helper functions within the blueprint module for better organization and readability.
- Eliminated the `pandas` dependency for date range generation, using standard `datetime` operations instead.
- Resolved circular import issues between `db.py`, `extensions.py`, and `routes/calendar.py` by adjusting import locations.
- Corrected `url_for` calls in templates (`calendar.html`, `partials/people_link.html`) to reference the new blueprint endpoint (`calendar.get_calendar`).
- Fixed an `AttributeError` related to HTMX request checking in the calendar route.
- Corrected `AttributeError` related to `.date()` calls on `datetime.date` objects in view processing functions.
- Updated `templates/changelog/changelog.html` to document the refactoring and associated fixes.
```
2025-03-30 22:20:48 +11:00
Peter Stockings 4a822ea2ba Update python buildpack version to reflect archived state 2025-03-30 22:02:09 +11:00
Peter Stockings 2465cad005 feat: Add static changelog page
Adds a new static page accessible at /changelog to display site updates and changes manually.

- Creates a new Flask Blueprint in `routes/changelog.py` to handle the route logic.
- Registers the `changelog_bp` blueprint in `app.py`.
- Creates the corresponding template `templates/changelog/changelog.html` extending the base layout.
- Adds a link to the Changelog page in the main sidebar navigation in `templates/base.html`, using an archive icon for consistency.
- Applies basic card styling to the changelog page content for improved visual structure.
2025-03-30 21:30:25 +11:00