sagreine / homeGym

homeGym mobile app
2 stars 0 forks source link

Weight-PRs in and display #134

Closed sagreine closed 3 years ago

sagreine commented 3 years ago

think about setup in firestore.

Squat -> weights (long) -> weight, reps, date or Squat -> reps -> weight, date

main activities: 1) add a new weight (if doing option 1) 2) update reps and date of an old activity (either one)

would probably only need to keep the most recent 10? distinct weights we hit for a given lift? or, keep but only query for the most recent 10, in case we later want to add in historical graphing or something.

leading towards 2.

how best to track over time?

document -> collection (each rep num is a collection) -> each lift is a document with two fields in it. when querying to just show current, order by weight and pull just the most recent document. when we want to show over time, they pick which collection, then we pull all and graph weight on Y and date on X. these are PRs only of course, so won't increase that frequently.

or have a collection called PRs, each document is e.g. 5repPR -> this is inefficient pattern in firestore unless we took it further and had a collection with subdocuments within that again... which might be better? we could update a max or something that way? not sure if that's efficient, not lazy in the least anyway but would prevent recalculating it a lot in any case

squat -> reps (long, 1-20 or something) -> weight, date

keeping just 0-20 reps makes the second setup more appealing we can get historical lifts from the more general items anyway, though those reads will be more expensive

sagreine commented 3 years ago

historical rep PRs are in. bones for weight-PRs are in, though not being done yet. nothing about showing PR progress over time is in yet. separating those two out now.

sagreine commented 3 years ago

need to add -Rep and -Weight specific things into both Rep and Weight firestore schemas for current and all.

sagreine commented 3 years ago

schemas in things: 1) test it 2) does it hanlde "xPR" ? - see there, there is another thing with edits on submit updating to put xPR back in.. 3) need to sort list either when displaying or up front on creation

sagreine commented 3 years ago

3 is in

sagreine commented 3 years ago

2 is done automatically 1 lol this is a fun-only project so ... no