theebank / FITNIS

0 stars 0 forks source link

Workouts Tab #10

Open theebank opened 9 months ago

theebank commented 9 months ago

Workouts

|--My Routines |--|--Button to create new routine |--|--List of Routines |--Past Workouts |--|--Diary of Past workouts

API Endpoints needed: GET - all workout routines associated with user - Need to implement users first GET - details of each exercise associated with routine

POST - create new workout routine POST - create set of program exercises associated with new workout routine

theebank commented 9 months ago

[](url)

theebank commented 9 months ago
image

These arrows should only be rendered if there is something to expand

theebank commented 6 months ago

Need to remodel how data is being set to backend

Front-End:

Collects and structures the data in an easily manageable format:

data: {
    programname: "...",
    exercises: [
    {
        exerciseid: "...",
        exercisename: "...",
        sets: [
            { set: 1, reps: 8, RPE: 7, Notes: "Felt good" },
            { set: 2, reps: 8, RPE: 8, Notes: "Tough but manageable" },
        ]
    },
   ]
}

Back-End:

Receives the data and processes it to fit the relational database schema: Extracts the programname and creates a new workout program entry if needed. Iterates through each exercise in the exercises array: Checks if the exerciseid already exists or if a new record should be created. For each set in the sets array, creates a new entry in the Sets Table with the corresponding exerciseid, reps, RPE, and Notes.

Database Operations:

The workout plan, exercises, and sets are all stored in their respective tables, with relationships defined by foreign keys. This could involve multiple insert queries, potentially within a transaction to ensure data consistency.

theebank commented 5 months ago

Front-end:

Step 1: Add exercises to workout cart Step 2: Add desired amount of sets + info (reps, rpe, notes) to each exercise

Step 3: name workout