Repository navigation
feat(api): list user routines - #72
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first authenticated routine read endpoint:
GET /routines.The endpoint provides owner-scoped summary data for future routine-list cards and new-user empty states without loading full exercise configuration.
Closes #71.
What changed
GET /routinesrouting.Response shape
{ "routines": [ { "id": "routine-uuid", "name": "Upper Body", "description": null, "exerciseCount": 3, "scheduledDays": [1, 3, 5], "createdAt": "2026-08-24T18:00:00.000Z", "updatedAt": "2026-08-24T19:00:00.000Z" } ] }A user without routines receives:
{ "routines": [] }Authorization
The user ID is read from the authenticated server-side session. The database query filters by
routines.user_id, so clients cannot request another user's routine collection.Anonymous requests receive
401 authentication_required.Query behavior
The query:
0through Saturday6;countDistinctprevents the schedule join from inflating exercise counts.Scope boundary
This is a lightweight collection endpoint. It intentionally excludes full exercise configuration, sets, reps, weights, rest periods, and notes. Those belong in routine detail and mutation endpoints.
Verification
Out of scope