Closed EmmaDir closed 2 months ago
If you set up a database at this point you need to think about your exact data structure in the database. Is there one collection workouts and one collection exercises? I would highly recommend making it two different collections and reference the ids of the exercises in an array within each workout object in the collection. If you add the workouts to the database you also need to move the exercises to the database. You need to specify all of that in the userstory including the schema for mongoose. Therefore I recommend to make the database access a single US and use Lcoal Storage to make them persistent for nowö
Value proposition
As a user I want to create and store new workouts, so that I can have a personalised workout plan that suits my fitness goals.
Description
Acceptance criteria
Tasks
use-local-storage-state
pages/workouts/index.js
import useLocalStorageState from "use-local-storage-state" and create a local storage state for "workouts"pages/workouts/index.js
, write a functionhandleAddWorkout
which accepts a new workout object as parameter and adds this object to the workouts state