fitlog-tarek.vercel.app

About the project
A dark, no-nonsense workout library. You can browse twelve lifts, open any of them for sets, reps and step-by-step instructions, build a plan for today with up to five lifts, and keep a separate list of lifts to try later. Both lists survive a page reload.
Key features
- Workout cards with muscle groups, equipment, duration, calories and rating
- A details page for every workout with numbered instructions
- Today's plan capped at five lifts, plus a separate Save for later list
- Live stats for total exercises, minutes and calories in the plan
- Sorting the plan by duration, calories or rating
Challenges I faced
- 1
The plan and saved lists live in localStorage, which only exists in the browser. The effect that saves the lists also ran on the very first render, while they were still empty, and wiped the stored data. An isLoaded flag now stops it from saving until the stored lists have been read.
- 2
Adding a lift can fail in two ways: it's already in the plan, or the plan already has five. The add function returns which case happened so each one gets its own toast message.
- 3
If the workout API is down or rate limited, the app falls back to a local copy of the data instead of showing an empty page.
Future plans
- A workout history that records completed lifts by date.
- User accounts so the plan syncs across devices instead of living in one browser.
- Custom workouts that users can add themselves.
- A rest timer between sets.