From 3f08ce404a4a15be1b0739aad21dd4fd63cf6d6d Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 27 Apr 2025 13:27:38 +0400 Subject: [PATCH 01/22] add exercises --- exercises.json | 610 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 610 insertions(+) create mode 100644 exercises.json diff --git a/exercises.json b/exercises.json new file mode 100644 index 0000000..d3d453f --- /dev/null +++ b/exercises.json @@ -0,0 +1,610 @@ +[ + { + "name": "Kettlebell Windmill", + "type": "Strength", + "level": "Intermediate", + "description": "The single-kettlebell windmill is a dynamic kettlebell exercise emphasizing core strength and shoulder and hip mobility and stability. It is often used as a functional warm-up or for multi-directional strength work. It doesn't work as well in a metcon or conditioning setting, and shouldn't be performed under intense fatigue.", + "body_part": "Abdominals", + "equipment": "Kettlebells" + }, + { + "name": "Kettlebell swing", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell swing is a popular lower-body exercise emphasizing the hamstrings, glutes, and back muscles. It is often used to train explosive power, for aerobic or cardiovascular conditioning, in circuit training, or as an accessory movement for the deadlift.", + "body_part": "Abdominals", + "equipment": "Kettlebells" + }, + { + "name": "Dumbbell side bend", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell side bend is a popular exercise for targeting the oblique muscles of the abdomen. It is usually performed for relatively high reps, at least 8-12 reps per set or more. It can be performed one side at a time or alternating sides.", + "body_part": "Abdominals", + "equipment": "Dumbbell" + }, + { + "name": "Barbell press sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell press sit-up is a weighted exercise focusing on the abdominal muscles, as well as the shoulders to a lesser degree. It primarily targets the rectus abdominis or \"six-pack\" muscles, but also involves the obliques and deep core muscles. It can be performed on the floor with the feet anchored or unanchored, or on a decline or other bench. It is similar to the Otis-up, which is performed with a weight plate.", + "body_part": "Abdominals", + "equipment": "Other" + }, + { + "name": "Cable reverse crunch", + "type": "Strength", + "level": "Beginner", + "description": "The cable reverse crunch is performed on the ground facing away from a high pulley, which helps target the lower abdominals specifically.", + "body_part": "Abdominals", + "equipment": "Cable" + }, + { + "name": "Cocoons", + "type": "Strength", + "level": "Intermediate", + "description": "The cocoon crunch is a bodyweight exercise targeting the ab muscles, the rectus abdominis or \"six-pack\" muscles in particular. It involves bringing your knees to your chest and your arms from overhead to center. It can be performed for time or reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Decline Crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The decline crunch is an effective core exercise targeting the rectus abdominis.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Hanging Oblique Knee Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging oblique crunch an abdominal exercise that targets both the rectus abdominus or “six-pack” muscles, and the oblique muscles. It can be performed hanging from a bar, or if grip strength is a limitation, by placing the elbows in ab straps. If hanging from a straight bar is uncomfortable to the wrists or shoulder, you can also perform them hanging with a neutral grip (palms facing one another)", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Hanging leg raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging leg raise is an exercise targeting the abs, but which also works the lats and hip flexors. Instead of resting your forearms on the pads of a captain's chair, you perform these hanging from a bar. Experienced lifters make these look easy, but beginners may need time to build up to sets of 8-12 reps.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Mountain climber", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The mountain climber is a popular bodyweight exercise targeting the muscles of the core, as well as the shoulders, hips, and cardiovascular system. It involves lifting one knee to the chest at a time from a straight-arm plank position. It can be performed for time or reps as part of a dynamic warm-up, for bodyweight cardio or conditioning, or as no-equipment dynamic core training.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "3/4 sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The 3/4 sit-up is a bodyweight exercise focused on the muscles of the core. It is similar to a sit-up, but stops short of the top position. This keeps constant tension on the abs, making it more difficult than traditional sit-ups. It can be performed for time or for reps, with the feet anchored or free, as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Reverse crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The reverse crunch is a popular exercise targeting the abdominals, particularly the lower half. It’s easy to perform on either the floor or a flat bench. Many lifters think of this as a companion to the crunch, which targets the upper abdominals more than the lower.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Russian twist", + "type": "Strength", + "level": "Intermediate", + "description": "The Russian twist is an exercise targeting the abdominals and the obliques. Beginning from a position that resembles stopping midway through a sit-up, it involves twisting side to side. It can be performed with body weight alone or while holding a weight plate or other object. It is performed by alternating sides with each rep and can be done for time or for a specific number of reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Bear crawl", + "type": "Strength", + "level": "Intermediate", + "description": "The bear crawl is a popular bodyweight crawling exercise. While it looks simple, the bear crawl is an intense full-body movement that targets the cardiovascular system as well as a wide range of muscle groups, the shoulders, core, and legs in particular. It can be done as a full-body warm-up, in short bursts for power or circuit training, or for longer durations as cardiovascular conditioning.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Shoulder tap", + "type": "Strength", + "level": "Intermediate", + "description": "The shoulder tap is an exercise targeting the abdominals and core. The basic stance matches the top of a push-up position. From there, one hand is raised to tap its opposing shoulder. A tap with each hand to each opposing shoulder equals one rep.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Push-up to side plank", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up to side plank is an upper-body and core-focused exercise combining two popular bodyweight movements. It targets the chest, triceps, and shoulders with the push-up, and the obliques and hip external rotator muscles with the side plank. It can be performed as part of a dynamic warm-up or any bodyweight strength-training workout.", + "body_part": "Abdominals", + "equipment": "Body Only" + }, + { + "name": "Decline sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The decline sit-up is a bodyweight core exercise that works the rectus abdominis or \"six pack\" muscles. Sit-up variations are usually performed for moderate to high reps, such as 10-15 reps per set or more, as part of the core-focused portion of a workout.", + "body_part": "Abdominals", + "equipment": "None" + }, + { + "name": "Barbell Curl", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell curl is an arm exercise that is also one of the most recognizable movements in all of bodybuilding and fitness. It helps build sleeve-popping biceps and allows heavier loading than many other curl variations. It is usually performed in moderate to high reps, such as 8-12 reps per set, as part of the arm-focused portion of any workout.", + "body_part": "Biceps", + "equipment": "Barbell" + }, + { + "name": "Dumbbell preacher curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell preacher curl is an exercise that focuses on building the biceps, particularly the biceps peak. All you need is a pair of dumbbells and a preacher bench. It's usually performed for moderate to high reps as part of an upper-body or arms-focused workout.", + "body_part": "Biceps", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell biceps curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell biceps curl is a single-joint exercise for building bigger and stronger biceps. Popular among gym goers of all experience levels, this move can be done seated or standing. It is generally performed for moderate to high reps, such as 8-12 reps or higher, as part of the arm-focused portion of a workout.", + "body_part": "Biceps", + "equipment": "Dumbbell" + }, + { + "name": "Weighted donkey calf raise", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted donkey calk raise is a strength and muscle-building exercise focused on the muscles of the lower leg, most prominently the gastrocnemius muscle. While traditional donkey calf raises involved either a specific machine or carrying another person on one's back, this method uses a weight belt. It can be done in traditional muscle-building rep ranges, or for higher reps as part of lower-body training.", + "body_part": "Calves", + "equipment": "Other" + }, + { + "name": "Kettlebell plyo push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell plyo push-up is an explosive upper-body movement that uses a kettlebell primarily as a platform for the hands. A short step, dumbbell, or other stationary object could also be used in place of the kettlebell. It can be performed for reps or time, either for low reps to build explosive power or for higher reps for conditioning.", + "body_part": "Chest", + "equipment": "Kettlebells" + }, + { + "name": "Incline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The hands-elevated push-up is a variation on the push-up, a body-weight standard. The hands are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Decline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The feet-elevated push-up is a variation on the push-up, a body-weight standard. The feet are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Isometric Wipers", + "type": "Strength", + "level": "Beginner", + "description": "The typewriter push-up is an advanced push-up variation where the hands are extra wide and you lower toward each hand in alternating reps. It is more challenging to each working arm than traditional push-ups and also stretches and challenges the chest.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Clock push-up", + "type": "Strength", + "level": "Beginner", + "description": "The clock push-up is a series of regular push-ups performed one at a time, moving your hands one step to the side between each one until you've completed a full circle. It targets the same muscles as traditional push-ups, such as the chest, triceps, and shoulders, but adds an endurance and core challenge to traditional push-ups.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Suspended push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended push-up is a bodyweight pushing exercise performed on a suspension strap system or gymnastic rings. It targets the chest, shoulders, and triceps, but is also challenging to the core and upper back. It can work in traditional strength and muscle-building rep ranges or for higher reps.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Diamond push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The diamond push-up is an advanced variation of the push-up exercise performed with the hands in a diamond shape. It increases the challenge to the triceps, but also targets the chest and shoulders.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up is a popular bodyweight exercise that is commonly used in military and tactical physical fitness tests. It’s a classic movement to build upper-body muscle and strength, emphasizing the chest, triceps, and shoulders, but also working the upper back and core.", + "body_part": "Chest", + "equipment": "Body Only" + }, + { + "name": "Medicine Ball Chest Pass", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The medicine ball pass is a simple partner-based exercise that involves throwing a weighted ball back-and-forth. It can be part of a dynamic warm-up for lifting or athletics, but can also work as active rest or as a component of circuit training.", + "body_part": "Chest", + "equipment": "Medicine Ball" + }, + { + "name": "Dumbbell Bench Press", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell bench press is a mainstay of workout enthusiasts worldwide. It’s a classic move for building a bigger, stronger chest. As such, it’s often placed first in mass-building chest workouts.", + "body_part": "Chest", + "equipment": "Dumbbell" + }, + { + "name": "Chest dip", + "type": "Strength", + "level": "Intermediate", + "description": "The chest dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the chest, triceps, and shoulders. Dips with a chest focus are usually performed with the torso leaning forward and the elbows angled out from the torso. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Chest", + "equipment": "Other" + }, + { + "name": "Barbell glute bridge", + "type": "Powerlifting", + "level": "Intermediate", + "description": "The barbell glute bridge is a popular exercise targeting the muscles of the glutes and hamstrings. It can be done as a strength movement on its own, as an activation drill or warm-up for lower-body training, or as a burnout at the end of a lower-body workout.", + "body_part": "Glutes", + "equipment": "Barbell" + }, + { + "name": "Kettlebell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell thruster is a popular kettlebell movement that combines a kettlebell front squat with a kettlebell press, while holding the bell in a goblet or bottoms-up grip. It is preceded by a clean at the start of each set, and you can perform a clean between each rep if you choose. It can be trained in traditional strength or muscle-building rep ranges, in circuit or fat-loss training, or as part of a larger kettlebell combination or complex.", + "body_part": "Glutes", + "equipment": "Kettlebells" + }, + { + "name": "Walking lunge", + "type": "Strength", + "level": "Intermediate", + "description": "The walking lunge is a lower-body exercise that targets the glutes, quads, and hamstrings while challenging stability and balance. It can be performed for reps, time, or distance in the lower-body portion of any workout.", + "body_part": "Glutes", + "equipment": "Body Only" + }, + { + "name": "Barbell Deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell deadlift is a compound exercise used to develop overall strength and size in the posterior chain. It is a competition lift in the sport of powerlifting, but is also considered a classic benchmark of overall strength. When performed with the hands outside the knees, it is often called a \"conventional\" deadlift. When the feet are wide and the hands are inside the knees, it is a sumo deadlift.", + "body_part": "Hamstrings", + "equipment": "Barbell" + }, + { + "name": "Power clean", + "type": "Strength", + "level": "Intermediate", + "description": "The power clean is a full-body movement in which the bar is pulled from the floor and caught in the front rack position in three pulls or phases. The bar is received in the \"power\" position, with the hips higher than a full-depth squat position. The power clean can be used as a component of the clean and press or clean and jerk, but is also a valuable lift to build explosive power and strength.", + "body_part": "Hamstrings", + "equipment": "Barbell" + }, + { + "name": "Inchworm", + "type": "Stretching", + "level": "Beginner", + "description": "The inchworm is a popular bodyweight exercise that involves “walking” the hands on the floor from a bent-over toe-touch position into a straight-arm plank. It is usually performed as part of a dynamic warm-up to help raise core body temperature and “limber up” the body from head to toe.", + "body_part": "Hamstrings", + "equipment": "Body Only" + }, + { + "name": "Weighted pull-up", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted pull-up is a more advanced variation of the pull-up exercise in which the lifter adds extra weight to their body. Options for adding weight include a dip belt, weighted vest, chains, a dumbbell placed between the feet or legs, or looping a kettlebell over the foot. Like other pull-up variations, the weighted pull-up builds strength and muscle in the upper back, biceps, and core.", + "body_part": "Lats", + "equipment": "Other" + }, + { + "name": "Pull-up", + "type": "Strength", + "level": "Beginner", + "description": "The pull-up is a multijoint bodyweight exercise that builds strength and muscle in the upper back, biceps, and core. It is often used as a measurement tool in military or tactical fitness tests, and is an excellent gauge of \"relative strength\" which is strength in relation to body weight.", + "body_part": "Lats", + "equipment": "Body Only" + }, + { + "name": "Rope climb", + "type": "Strength", + "level": "Intermediate", + "description": "The rope climb is an exercise that is used commonly in CrossFit workouts and as a test of upper-body strength. It was even contested at the Olympics in the early 20th century. It targets a wide range of upper-body musculature, including the hands and forearms, shoulders, biceps, lats (latissimus dorsi), and core.", + "body_part": "Lats", + "equipment": "Body Only" + }, + { + "name": "Chin-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The a chin-up is a variation of the pull-up exercise in which the reps are performed with the palms facing toward the body, in an underhand position, with a grip that is narrower than shoulder-width. Like other pull-up variations, it builds strength and muscle in the upper back, biceps, and core, but it utilizes the biceps slightly more than overhand pull-ups. It can be used as a more shoulder-friendly alternative to straight-bar pull-ups, or to help perform more reps than you can perform overhand.", + "body_part": "Lats", + "equipment": "Body Only" + }, + { + "name": "Iron cross stretch", + "type": "Strength", + "level": "Intermediate", + "description": "The iron cross stretch is a bodyweight stretch that focuses on hip and thoracic spine mobility.", + "body_part": "Lats", + "equipment": "Body Only" + }, + { + "name": "Barbell good morning", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell good morning is an exercise that targets glute, hamstring, and lower back development. It is often trained as an accessory movement to the deadlift, but also has value on its own. It is sometimes performed for reps in traditional strength-focused rep ranges such as 5-8 reps per set, but due to the risk posed to the lower back, is rarely treated as a max-effort single-rep lift.", + "body_part": "Lower Back", + "equipment": "Barbell" + }, + { + "name": "Kettlebell alternating renegade row", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell alternating renegade row combines rowing and core training into a single difficult movement. It's popular in time-efficient strength and muscle-building workouts, as well as in circuit-style training.", + "body_part": "Middle Back", + "equipment": "Kettlebells" + }, + { + "name": "Suspended row", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended row is a bodyweight pulling exercise that focuses on the muscles of the middle and upper back, as well as the biceps. It can be trained in traditional muscle-building rep ranges or for higher reps. It can also work as part of a dynamic warm-up for a pressing or pulling-focused workout.", + "body_part": "Middle Back", + "equipment": "Other" + }, + { + "name": "Barbell shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell shrug is an exercise targeting the traps (trapezius muscles). It is popular in strength and muscle-focused upper-body training, and is often trained on a shoulder day. With the assistance of straps, it can be loaded heavily, but it is still usually performed for moderate to high reps, such as 8-10 reps per set.", + "body_part": "Traps", + "equipment": "Barbell" + }, + { + "name": "Cable shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The cable shrug is an exercise targeting the traps, as well as hitting the shoulders and upper back. Cables allow for lighter loading which is beneficial for higher-rep sets.", + "body_part": "Traps", + "equipment": "Cable" + }, + { + "name": "Barbell Full Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell back squat is a popular compound movement that emphasizes building the lower-body muscle groups and overall strength. It's the classic way to start a leg day, and is a worthy centerpiece to a lower-body training program. The squat is a competitive lift in the sport of powerlifting, but is also a classic measurement of lower-body strength. With the barbell racked on the traps or upper back, the emphasis is placed on the posterior chain but the entire body gets worked. The back squat can be trained in everything from heavy singles to sets of 20 reps or higher.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell front squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front squat is a compound movement that emphasizes building the lower-body muscle groups. With the barbell racked in front of the body on the anterior delts, the front squat emphasizes the quads and glutes, but also upper back and core strength to remain upright. Front squats can be trained as an alternative to back squats, as an accessory movement for either squats or deadlifts, or for strength and muscle on their own. Many lifters and athletes prefer them to back squats, although they can be uncomfortable and difficult to learn at first.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell hack squat", + "type": "Strength", + "level": "Expert", + "description": "The barbell hack squat is a variety of deadlift performed with the barbell behind the legs. This forces the lifter into a body position similar to a squat and targets the quads and glutes. It is named after famed strongman George Hackenschmidt, who performed it as an overall leg-building exercise. The barbell hack squat can be used as a substitute for the machine hack squat, or as a lower-body strength and size movement on its own.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell thruster is a full-body exercise that incorporates both squatting and pressing in one functional movement. It's especially common in contemporary CrossFit workouts, but also in general strength training. The barbell is usually cleaned into place first, but it could be performed taken from a squat rack in a front-rack position. The thruster can be performed in traditional strength-focused rep ranges to build strength in the press, or in higher reps for full-body conditioning.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell side split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell side split squat is a variation of the split squat that targets the lower body, specifically the quads, and requires good hip mobility.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Barbell speed squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell speed squat targets the lower-body muscle groups using lighter weights to perform fast-paced back squats. Speed squats are popular in certain powerlifting training methodologies as a way to engrain form and lifting speed that can carry over to max-effort lifts. In this approach, they are usually performed in numerous sets of 3-5 reps with adequate rest in between. Speed squats are also sometimes performed with bands or chains adding extra resistance to the top half of the lift.", + "body_part": "Quadriceps", + "equipment": "Barbell" + }, + { + "name": "Dumbbell Goblet Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The goblet squat is a common exercise used in the early stages of learning to squat, or as a movement in general training programs for building size to the quads, glutes, and hamstrings.", + "body_part": "Quadriceps", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell squat", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell squat is a classic lower-body exercise that targets the quadriceps, hamstrings, and glutes. While this variation is usually performed with relatively light weights for high reps, it can also be used as a substitute for squats or the trap-bar deadlift in any workout.", + "body_part": "Quadriceps", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell deadlift is a movement that targets the hamstrings, glutes, and back muscles. While it can be performed all the way from the ground, in the style of a barbell deadlift, it is more often performed from the top down as a Romanian deadlift. The dumbbell deadlift can be performed in low rep ranges to build posterior strength, or for moderate to high reps to build muscle and endurance.", + "body_part": "Quadriceps", + "equipment": "Dumbbell" + }, + { + "name": "Tire flip", + "type": "Strongman", + "level": "Intermediate", + "description": "The tire flip is an exercise that works the entire body, starting from a deadlift position and ending with a giant tire being flipped over. Each flip moves the tire farther in one direction until a set has been completed. It can be performed for time or reps as part of a functional fitness or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Other" + }, + { + "name": "Weighted sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted sissy squat is an exercise primarily targeting the quadriceps. In sissy squats, the knees travel over the toes, placing the quads under a fairly extreme stretch. They are usually performed for moderate to high reps as part of a lower-body training session.", + "body_part": "Quadriceps", + "equipment": "Other" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell" + }, + { + "name": "Suspended split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended split squat is a single-leg squat variation performed with the rear leg in a suspension strap system. This allows the rear leg to move slightly more naturally than it would be able to on a bench. The exercise targets the quads, hamstring, and glute muscles on the front leg, but also taxes and stretches the quads on the rear leg.", + "body_part": "Quadriceps", + "equipment": "Other" + }, + { + "name": "Burpee", + "type": "Cardio", + "level": "Intermediate", + "description": "The burpee is a high-intensity exercise that recruits the entire body to build strength and aerobic capacity. It is common in CrossFit workouts and group fitness classes, but can also be performed for time or reps in any fat-loss or athleticism-focused circuit or workout.", + "body_part": "Quadriceps", + "equipment": "Body Only" + }, + { + "name": "Jump Squat", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The jump squat is an explosive bodyweight exercise targeting the quads, hamstrings, and glutes. It is also a serious cardiovascular challenge when done for reps. It can be performed as a power exercise to build jumping power, or in any fat-loss or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Body Only" + }, + { + "name": "Sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The sissy squat is a bodyweight squat variation that involves letting the knees travel far over the toes, placing an extreme stretch on the quads. This movement targets the quad muscles directly and can be performed in partial or full ranges of motion based on knee health and pain.", + "body_part": "Quadriceps", + "equipment": "None" + }, + { + "name": "Band shoulder press", + "type": "Strength", + "level": "Intermediate", + "description": "The band shoulder press is a deltoid exercise and an alternative to the classic dumbbell shoulder press. The dynamic tension of the band forces the core to stabilize the body and more closely matches the strength curve of the shoulder press. It can be performed in low reps, such as 5-8 reps per set, to build shoulder strength, or for higher reps to build muscle and for conditioning. It can work as the main focus of a shoulder day but is also popular as an accessory movement to the bench press or barbell military press.", + "body_part": "Shoulders", + "equipment": "Bands" + }, + { + "name": "Barbell upright row", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell upright row is a barbell exercise that builds stronger and bigger traps. Many lifters combine this move with either their back or shoulder workout since it involves both body parts.", + "body_part": "Shoulders", + "equipment": "Barbell" + }, + { + "name": "Barbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front raise is an upper-body isolation exercise that targets the shoulders. It is usually performed for moderate to high reps, such as 8-12 reps or higher, as part of the shoulder-focused part of any workout.", + "body_part": "Shoulders", + "equipment": "Barbell" + }, + { + "name": "Dumbbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell front raise is a single-joint exercise targeting the shoulder muscles, particularly the front or anterior deltoids. It is usually performed for moderate to high reps, at least 8-12 reps per set, as part of an upper-body or shoulder-focused workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell Lying Rear Lateral Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The incline dumbbell reverse fly is an upper-body exercise targeting the posterior or rear deltoids, as well as the postural muscles of the upper back. Because it targets such small muscles, this exercise is usually performed with light weight for high reps, such as 10-15 reps per set or more.", + "body_part": "Shoulders", + "equipment": "Dumbbell" + }, + { + "name": "Dumbbell lateral raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell lateral raise is a shoulder exercise that targets the medial or middle head of the deltoid muscle. It's a staple strength-training move and is a great option for accessory work on upper-body training days. It is usually performed for moderate to high reps, at least 8-12 reps, as part of the upper-body or shoulder-focused portion of a workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell" + }, + { + "name": "Cable seated row", + "type": "Strength", + "level": "Intermediate", + "description": "The cable seated row is a popular exercise to train the muscles of the upper back, including the lats (latissimus dorsi), traps, rhomboids, and rear deltoids, using a cable stack. It also targets the biceps to a lesser degree. The cable row can work well in a variety of rep ranges but is most popular in muscle-building workouts or as an accessory movement for strength workouts.", + "body_part": "Shoulders", + "equipment": "Cable" + }, + { + "name": "Handstand push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The handstand push-up is an exercise targeting the shoulders, although other muscles assist in the completion of the reps. It is common in both CrossFit workouts and advanced bodyweight or calisthenics training. Given the degree of difficulty, beginners will need to progress to this move.", + "body_part": "Shoulders", + "equipment": "Body Only" + }, + { + "name": "Triceps dip", + "type": "Strength", + "level": "Intermediate", + "description": "The triceps dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the triceps first, but also stretches and strengthens the chest and shoulders. Dips with a triceps focus are usually performed with an upright torso, the knees bent and crossed, and the arms close to the body. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Triceps", + "equipment": "Body Only" + }, + { + "name": "Weighted bench dip", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted bench dip is a highly effective exercise for building the triceps. The resistance comes from a combination of body weight and added weight—usually a weight plate.", + "body_part": "Triceps", + "equipment": "Body Only" + } +] \ No newline at end of file From 773ce6f246c8381649d3b0c380bee7a48e18e4a1 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 27 Apr 2025 14:04:26 +0400 Subject: [PATCH 02/22] mix format and fly.io setup --- .dockerignore | 45 ++++++++ Dockerfile | 92 +++++++++++++++ config/config.exs | 7 +- fly.toml | 30 +++++ lib/fitness/accounts.ex | 2 +- lib/fitness/accounts/services/chart_data.ex | 1 - .../accounts/services/player_scores.ex | 23 +++- lib/fitness/accounts/user.ex | 13 ++- lib/fitness/exercises.ex | 4 +- lib/fitness/exercises/finder/search_term.ex | 4 - lib/fitness/release.ex | 28 +++++ lib/fitness/workout_templates.ex | 1 - .../services/workout_item_logic.ex | 22 ++-- lib/fitness/workout_templates/workout_item.ex | 10 +- .../controllers/user_session_controller.ex | 1 - lib/fitness_web/live/exercise_live/index.ex | 3 +- .../live/profile_live/score_board_live.ex | 9 +- .../profile_live/update_user_profile_form.ex | 12 +- .../live/profile_live/user_profile_live.ex | 5 +- lib/fitness_web/live/user_auth_live.ex | 4 +- .../check_boxes_live_component.ex | 16 ++- .../workout_template_live/form_component.ex | 25 ++-- .../workout_item_form.ex | 2 +- .../workout_template_live/workout_zone.ex | 8 +- lib/fitness_web/router.ex | 10 +- .../20230417211058_create_workout_items.exs | 4 +- priv/repo/seeds.exs | 108 ++++++++++++++++-- rel/env.sh.eex | 8 ++ rel/overlays/bin/migrate | 3 + rel/overlays/bin/migrate.bat | 1 + rel/overlays/bin/server | 3 + rel/overlays/bin/server.bat | 2 + test/fitness/accounts_test.exs | 16 ++- test/fitness/exercises_test.exs | 19 ++- test/fitness/workout_templates_test.exs | 4 +- .../user_reset_password_controller_test.exs | 2 +- test/fitness_web/live/exercise_live_test.exs | 13 ++- .../live/workout_template_live_test.exs | 60 +++++++--- 38 files changed, 498 insertions(+), 122 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 fly.toml create mode 100644 lib/fitness/release.ex create mode 100755 rel/env.sh.eex create mode 100755 rel/overlays/bin/migrate create mode 100755 rel/overlays/bin/migrate.bat create mode 100755 rel/overlays/bin/server create mode 100755 rel/overlays/bin/server.bat diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..61a7393 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,45 @@ +# This file excludes paths from the Docker build context. +# +# By default, Docker's build context includes all files (and folders) in the +# current directory. Even if a file isn't copied into the container it is still sent to +# the Docker daemon. +# +# There are multiple reasons to exclude files from the build context: +# +# 1. Prevent nested folders from being copied into the container (ex: exclude +# /assets/node_modules when copying /assets) +# 2. Reduce the size of the build context and improve build time (ex. /build, /deps, /doc) +# 3. Avoid sending files containing sensitive information +# +# More information on using .dockerignore is available here: +# https://docs.docker.com/engine/reference/builder/#dockerignore-file + +.dockerignore + +# Ignore git, but keep git HEAD and refs to access current commit hash if needed: +# +# $ cat .git/HEAD | awk '{print ".git/"$2}' | xargs cat +# d0b8727759e1e0e7aa3d41707d12376e373d5ecc +.git +!.git/HEAD +!.git/refs + +# Common development/test artifacts +/cover/ +/doc/ +/test/ +/tmp/ +.elixir_ls + +# Mix artifacts +/_build/ +/deps/ +*.ez + +# Generated on crash by the VM +erl_crash.dump + +# Static artifacts - These should be fetched and built inside the Docker image +/assets/node_modules/ +/priv/static/assets/ +/priv/static/cache_manifest.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9adb765 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,92 @@ +# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of +# Alpine to avoid DNS resolution issues in production. +# +# https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=ubuntu +# https://hub.docker.com/_/ubuntu?tab=tags +# +# +# This file is based on these images: +# +# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image +# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20240130-slim - for the release image +# - https://pkgs.org/ - resource for finding needed packages +# - Ex: hexpm/elixir:1.16.1-erlang-26.1.2-debian-bullseye-20240130-slim +# +ARG ELIXIR_VERSION=1.16.1 +ARG OTP_VERSION=26.1.2 +ARG DEBIAN_VERSION=bullseye-20240130-slim + +ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}" +ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" + +FROM ${BUILDER_IMAGE} as builder + +# install build dependencies +RUN apt-get update -y && apt-get install -y build-essential git \ + && apt-get clean && rm -f /var/lib/apt/lists/*_* + +# prepare build dir +WORKDIR /app + +# install hex + rebar +RUN mix local.hex --force && \ + mix local.rebar --force + +# set build ENV +ENV MIX_ENV="prod" + +# install mix dependencies +COPY mix.exs mix.lock ./ +RUN mix deps.get --only $MIX_ENV +RUN mkdir config + +# copy compile-time config files before we compile dependencies +# to ensure any relevant config change will trigger the dependencies +# to be re-compiled. +COPY config/config.exs config/${MIX_ENV}.exs config/ +RUN mix deps.compile + +COPY priv priv + +COPY lib lib + +COPY assets assets + +# compile assets +RUN mix assets.deploy + +# Compile the release +RUN mix compile + +# Changes to config/runtime.exs don't require recompiling the code +COPY config/runtime.exs config/ + +COPY rel rel +RUN mix release + +# start a new build stage so that the final image will only contain +# the compiled release and other runtime necessities +FROM ${RUNNER_IMAGE} + +RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales \ + && apt-get clean && rm -f /var/lib/apt/lists/*_* + +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen + +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +WORKDIR "/app" +RUN chown nobody /app + +# set runner ENV +ENV MIX_ENV="prod" + +# Only copy the final release from the build stage +COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/fitness ./ + +USER nobody + +CMD ["/app/bin/server"] \ No newline at end of file diff --git a/config/config.exs b/config/config.exs index 7d9ed28..6142657 100644 --- a/config/config.exs +++ b/config/config.exs @@ -17,8 +17,9 @@ config :fitness, FitnessWeb.Endpoint, pubsub_server: Fitness.PubSub, live_view: [signing_salt: "vOF6D4CD"] - - config :tailwind, version: "3.3.1", default: [ +config :tailwind, + version: "3.3.1", + default: [ args: ~w( --config=tailwind.config.js --input=css/app.css @@ -27,7 +28,7 @@ config :fitness, FitnessWeb.Endpoint, cd: Path.expand("../assets", __DIR__) ] - config :chartkick, json_serializer: Jason +config :chartkick, json_serializer: Jason # Configures the mailer # diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..b030bba --- /dev/null +++ b/fly.toml @@ -0,0 +1,30 @@ +# fly.toml app configuration file generated for muscle-mind on 2025-04-27T13:39:00+04:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = "muscle-mind" +primary_region = "lax" +kill_signal = "SIGTERM" +swap_size_mb = 512 + +[build] + +[deploy] + release_command = "/app/bin/migrate" + +[env] + PHX_HOST = "muscle-mind.fly.dev" + PORT = "8080" + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ["app"] + [http_service.concurrency] + type = "connections" + hard_limit = 1000 + soft_limit = 1000 diff --git a/lib/fitness/accounts.ex b/lib/fitness/accounts.ex index 769a869..07de7c1 100644 --- a/lib/fitness/accounts.ex +++ b/lib/fitness/accounts.ex @@ -8,7 +8,6 @@ defmodule Fitness.Accounts do alias Fitness.Accounts.{User, UserToken, UserNotifier} - def is_admin?(user) do user.is_admin end @@ -16,6 +15,7 @@ defmodule Fitness.Accounts do def list_of_users do Repo.all(User) end + ## Database getters @doc """ diff --git a/lib/fitness/accounts/services/chart_data.ex b/lib/fitness/accounts/services/chart_data.ex index 3a16c3b..7797d1f 100644 --- a/lib/fitness/accounts/services/chart_data.ex +++ b/lib/fitness/accounts/services/chart_data.ex @@ -1,5 +1,4 @@ defmodule Fitness.Accounts.Services.ChartData do - alias Fitness.WorkoutTemplates def all_complete_workout_chart_data(current_user_id) do diff --git a/lib/fitness/accounts/services/player_scores.ex b/lib/fitness/accounts/services/player_scores.ex index 8fb3510..76def8f 100644 --- a/lib/fitness/accounts/services/player_scores.ex +++ b/lib/fitness/accounts/services/player_scores.ex @@ -3,16 +3,19 @@ defmodule Fitness.Accounts.Services.PlayerScores do alias Fitness.WorkoutTemplates def update_new_player_score_and_broadcast_score_board(current_user, workout_templates) do - list_of_workout_template_is_finish_and_is_belong_to_user = - Enum.filter(workout_templates, fn each -> each.is_finished == true and each.user_id == current_user.id end) + Enum.filter(workout_templates, fn each -> + each.is_finished == true and each.user_id == current_user.id + end) total_workout_template_score = Enum.reduce(list_of_workout_template_is_finish_and_is_belong_to_user, 0, fn each, acc -> acc + each.workout_template_score end) - Accounts.update_user_player_score(current_user, %{"player_score" => "#{total_workout_template_score}"}) + Accounts.update_user_player_score(current_user, %{ + "player_score" => "#{total_workout_template_score}" + }) update_users = Accounts.list_of_users() update_workout_template = WorkoutTemplates.list_workout_templates() @@ -23,8 +26,16 @@ defmodule Fitness.Accounts.Services.PlayerScores do end) end - defp broadcast_score_board(updated_users, update_workout_template, updated_player_score, user_id) do - Phoenix.PubSub.broadcast(Fitness.PubSub, "score_board", - {:update_users, {updated_users, update_workout_template, updated_player_score, user_id}}) + defp broadcast_score_board( + updated_users, + update_workout_template, + updated_player_score, + user_id + ) do + Phoenix.PubSub.broadcast( + Fitness.PubSub, + "score_board", + {:update_users, {updated_users, update_workout_template, updated_player_score, user_id}} + ) end end diff --git a/lib/fitness/accounts/user.ex b/lib/fitness/accounts/user.ex index a6dee61..5670b22 100644 --- a/lib/fitness/accounts/user.ex +++ b/lib/fitness/accounts/user.ex @@ -55,7 +55,10 @@ defmodule Fitness.Accounts.User do defp validate_username(changeset) do changeset |> validate_required([:username]) - |> validate_format(:username, ~r/^[a-zA-Z0-9!#$_:+-?]+$/, message: "A username should consist of both letters and numbers, and should not contain any spaces") + |> validate_format(:username, ~r/^[a-zA-Z0-9!#$_:+-?]+$/, + message: + "A username should consist of both letters and numbers, and should not contain any spaces" + ) |> validate_length(:username, min: 5, max: 40) |> unsafe_validate_unique(:username, Fitness.Repo) |> unique_constraint(:username) @@ -64,7 +67,10 @@ defmodule Fitness.Accounts.User do defp validate_name(changeset) do changeset |> validate_required([:name]) - |> validate_format(:name, ~r/\A[a-zA-Z ]+\z/, message: "A name must be made up of only letters and should not include any symbols or numbers.") + |> validate_format(:name, ~r/\A[a-zA-Z ]+\z/, + message: + "A name must be made up of only letters and should not include any symbols or numbers." + ) |> validate_length(:name, max: 40) end @@ -109,7 +115,6 @@ defmodule Fitness.Accounts.User do end def name_changeset(user, attrs) do - user |> cast(attrs, [:name]) |> validate_name() @@ -126,11 +131,9 @@ defmodule Fitness.Accounts.User do %{changes: %{image: _}} = changeset -> changeset %{} = changeset -> add_error(changeset, :image, "did not change") end - end def player_score_changeset(user, attrs) do - user |> cast(attrs, [:player_score]) |> case do diff --git a/lib/fitness/exercises.ex b/lib/fitness/exercises.ex index ff3602a..46b0c27 100644 --- a/lib/fitness/exercises.ex +++ b/lib/fitness/exercises.ex @@ -19,8 +19,8 @@ defmodule Fitness.Exercises do """ def list_exercises(search_query) do - exercises = Repo.all(Exercise) - SearchTerm.filter_by_search_term(exercises, search_query) + exercises = Repo.all(Exercise) + SearchTerm.filter_by_search_term(exercises, search_query) end def list_exercises do diff --git a/lib/fitness/exercises/finder/search_term.ex b/lib/fitness/exercises/finder/search_term.ex index 7d3dc40..7d62dc3 100644 --- a/lib/fitness/exercises/finder/search_term.ex +++ b/lib/fitness/exercises/finder/search_term.ex @@ -1,8 +1,5 @@ defmodule Fitness.Exercises.Finder.SearchTerm do - def filter_by_search_term(exercises, search_query) do - - found_search_query = case search_query do "" -> @@ -31,5 +28,4 @@ defmodule Fitness.Exercises.Finder.SearchTerm do found_search_query end - end diff --git a/lib/fitness/release.ex b/lib/fitness/release.ex new file mode 100644 index 0000000..8458b7d --- /dev/null +++ b/lib/fitness/release.ex @@ -0,0 +1,28 @@ +defmodule Fitness.Release do + @moduledoc """ + Used for executing DB release tasks when run in production without Mix + installed. + """ + @app :fitness + + def migrate do + load_app() + + for repo <- repos() do + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) + end + end + + def rollback(repo, version) do + load_app() + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) + end + + defp repos do + Application.fetch_env!(@app, :ecto_repos) + end + + defp load_app do + Application.load(@app) + end +end diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index 54277e7..7dc8acf 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -45,7 +45,6 @@ defmodule Fitness.WorkoutTemplates do Repo.get!(WorkoutItem, id) end - @doc """ Creates a workout_template. diff --git a/lib/fitness/workout_templates/services/workout_item_logic.ex b/lib/fitness/workout_templates/services/workout_item_logic.ex index fb59e98..f1f9e03 100644 --- a/lib/fitness/workout_templates/services/workout_item_logic.ex +++ b/lib/fitness/workout_templates/services/workout_item_logic.ex @@ -1,10 +1,8 @@ defmodule Fitness.WorkoutTemplates.Services.WorkoutItemLogic do alias Fitness.WorkoutTemplates - # calculate single workout template score def update_workout_template_score(workout_template) do - list_of_complete_workout_items = Enum.filter(workout_template.workout_items, fn each -> each.check_box == true @@ -13,21 +11,21 @@ defmodule Fitness.WorkoutTemplates.Services.WorkoutItemLogic do if length(list_of_complete_workout_items) == length(workout_template.workout_items) do total_score = Enum.reduce(list_of_complete_workout_items, 0, fn _each, acc -> acc + 20 end) - WorkoutTemplates.update_workout_template(workout_template, %{ - "workout_template_score" => "#{total_score + 50}", - "is_finished" => "true" - }) + WorkoutTemplates.update_workout_template(workout_template, %{ + "workout_template_score" => "#{total_score + 50}", + "is_finished" => "true" + }) - true + true else total_score = Enum.reduce(list_of_complete_workout_items, 0, fn _each, acc -> acc + 20 end) - WorkoutTemplates.update_workout_template(workout_template, %{ - "workout_template_score" => "#{total_score}", - "is_finished" => "true" - }) + WorkoutTemplates.update_workout_template(workout_template, %{ + "workout_template_score" => "#{total_score}", + "is_finished" => "true" + }) - false + false end end diff --git a/lib/fitness/workout_templates/workout_item.ex b/lib/fitness/workout_templates/workout_item.ex index acfc15d..82d6118 100644 --- a/lib/fitness/workout_templates/workout_item.ex +++ b/lib/fitness/workout_templates/workout_item.ex @@ -17,7 +17,15 @@ defmodule Fitness.WorkoutTemplates.WorkoutItem do @doc false def changeset(workout, attrs) do workout - |> cast(attrs, [:sets, :weight, :weight_unit, :check_box, :reps, :exercise_id, :workout_template_id]) + |> cast(attrs, [ + :sets, + :weight, + :weight_unit, + :check_box, + :reps, + :exercise_id, + :workout_template_id + ]) |> validate_required([:sets, :weight, :weight_unit, :reps, :workout_template_id, :exercise_id]) end end diff --git a/lib/fitness_web/controllers/user_session_controller.ex b/lib/fitness_web/controllers/user_session_controller.ex index 6f6e159..7afae3b 100644 --- a/lib/fitness_web/controllers/user_session_controller.ex +++ b/lib/fitness_web/controllers/user_session_controller.ex @@ -12,7 +12,6 @@ defmodule FitnessWeb.UserSessionController do %{"email" => email, "password" => password} = user_params if user = Accounts.get_user_by_email_and_password(email, password) do - conn |> UserAuth.log_in_user(user, user_params) else diff --git a/lib/fitness_web/live/exercise_live/index.ex b/lib/fitness_web/live/exercise_live/index.ex index d4b83d3..6b05be8 100644 --- a/lib/fitness_web/live/exercise_live/index.ex +++ b/lib/fitness_web/live/exercise_live/index.ex @@ -7,10 +7,9 @@ defmodule FitnessWeb.ExerciseLive.Index do @impl true def mount(_params, session, socket) do - if session["user_token"] do current_user = Accounts.get_user_by_session_token(session["user_token"]) - + case current_user do nil -> {:ok, assign(socket, exercises: Exercises.list_exercises(), search: "")} diff --git a/lib/fitness_web/live/profile_live/score_board_live.ex b/lib/fitness_web/live/profile_live/score_board_live.ex index 09d8516..2ab38dc 100644 --- a/lib/fitness_web/live/profile_live/score_board_live.ex +++ b/lib/fitness_web/live/profile_live/score_board_live.ex @@ -16,7 +16,6 @@ defmodule FitnessWeb.ScoreBoardLive do |> assign(:user_id, 0) |> assign(:workout_templates, WorkoutTemplates.list_workout_templates()) - {:ok, socket} end @@ -75,8 +74,11 @@ defmodule FitnessWeb.ScoreBoardLive do end @impl true - def handle_info({:update_users, {updated_users, update_workout_template, updated_player_score, updated_user_id}}, socket) do - + def handle_info( + {:update_users, + {updated_users, update_workout_template, updated_player_score, updated_user_id}}, + socket + ) do socket = socket |> assign(player_score: updated_player_score) @@ -84,7 +86,6 @@ defmodule FitnessWeb.ScoreBoardLive do |> assign(users: updated_users) |> assign(user_id: updated_user_id) - {:noreply, socket} end end diff --git a/lib/fitness_web/live/profile_live/update_user_profile_form.ex b/lib/fitness_web/live/profile_live/update_user_profile_form.ex index 5248215..4a24c5f 100644 --- a/lib/fitness_web/live/profile_live/update_user_profile_form.ex +++ b/lib/fitness_web/live/profile_live/update_user_profile_form.ex @@ -62,7 +62,10 @@ defmodule FitnessWeb.ProfileLive.UpdateUserProfileForm do @impl true def handle_event("remove", _params, socket) do - Accounts.update_user_image(socket.assigns.current_user, %{"image" => "/images/user-profile.svg"}) + Accounts.update_user_image(socket.assigns.current_user, %{ + "image" => "/images/user-profile.svg" + }) + {:noreply, socket} end @@ -77,10 +80,9 @@ defmodule FitnessWeb.ProfileLive.UpdateUserProfileForm do end) |> List.to_string() - - if uploaded_file != "" do - Accounts.update_user_image(socket.assigns.current_user, %{"image" => uploaded_file}) - end + if uploaded_file != "" do + Accounts.update_user_image(socket.assigns.current_user, %{"image" => uploaded_file}) + end Accounts.update_user_name(socket.assigns.current_user, %{"name" => updated_name}) diff --git a/lib/fitness_web/live/profile_live/user_profile_live.ex b/lib/fitness_web/live/profile_live/user_profile_live.ex index 708b3ab..f60e802 100644 --- a/lib/fitness_web/live/profile_live/user_profile_live.ex +++ b/lib/fitness_web/live/profile_live/user_profile_live.ex @@ -9,7 +9,10 @@ defmodule FitnessWeb.UserProfileLive do socket |> assign(:page_title, "User Profile") |> assign(:kebab_menu, :off) - |> assign(:chart_data, ChartData.all_complete_workout_chart_data(socket.assigns[:current_user].id)) + |> assign( + :chart_data, + ChartData.all_complete_workout_chart_data(socket.assigns[:current_user].id) + ) {:ok, socket} end diff --git a/lib/fitness_web/live/user_auth_live.ex b/lib/fitness_web/live/user_auth_live.ex index 9844bc9..3e52d88 100644 --- a/lib/fitness_web/live/user_auth_live.ex +++ b/lib/fitness_web/live/user_auth_live.ex @@ -3,12 +3,10 @@ defmodule FitnessWeb.UserAuthLive do alias Fitness.Accounts def on_mount(:user, _params, %{"user_token" => user_token} = _session, socket) do - socket = socket |> assign(:current_user, Accounts.get_user_by_session_token(user_token)) - - {:cont, socket} + {:cont, socket} end end diff --git a/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex b/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex index 3f8fc28..50c79ae 100644 --- a/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex +++ b/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex @@ -7,15 +7,14 @@ defmodule FitnessWeb.WorkoutTemplateLive.CheckBoxesLiveComponent do @impl true def update(assigns, socket) do - {:ok, - socket - |> assign(:workout_template, assigns.workout_template) - |> assign(:changeset, assigns.changeset) - |> assign(:update_param, %{}) - |> assign(:time, ~T[00:00:00]) - |> assign(:timer_status, assigns.timer_status) - |> assign(:workout_start, assigns.workout_start)} + socket + |> assign(:workout_template, assigns.workout_template) + |> assign(:changeset, assigns.changeset) + |> assign(:update_param, %{}) + |> assign(:time, ~T[00:00:00]) + |> assign(:timer_status, assigns.timer_status) + |> assign(:workout_start, assigns.workout_start)} end def render(assigns) do @@ -94,5 +93,4 @@ defmodule FitnessWeb.WorkoutTemplateLive.CheckBoxesLiveComponent do """ end - end diff --git a/lib/fitness_web/live/workout_template_live/form_component.ex b/lib/fitness_web/live/workout_template_live/form_component.ex index e6e9680..eefbe0d 100644 --- a/lib/fitness_web/live/workout_template_live/form_component.ex +++ b/lib/fitness_web/live/workout_template_live/form_component.ex @@ -15,7 +15,7 @@ defmodule FitnessWeb.WorkoutTemplateLive.FormComponent do end @impl true - def handle_event("validate", %{"workout_template" => workout_template_params} , socket) do + def handle_event("validate", %{"workout_template" => workout_template_params}, socket) do changeset = socket.assigns.workout_template |> WorkoutTemplates.change_workout_template(workout_template_params) @@ -25,34 +25,37 @@ defmodule FitnessWeb.WorkoutTemplateLive.FormComponent do end def handle_event("save", %{"workout_template" => workout_template_params}, socket) do - save_workout_template(socket, socket.assigns.action, workout_template_params) end - defp save_workout_template(socket, :edit, workout_template_params) do - case WorkoutTemplates.update_workout_template(socket.assigns.workout_template, workout_template_params) do + case WorkoutTemplates.update_workout_template( + socket.assigns.workout_template, + workout_template_params + ) do {:ok, workout_template} -> {:noreply, socket |> put_flash(:info, "Workout template updated successfully") |> push_redirect(to: "/workout_templates/#{workout_template.id}")} - {:error, %Ecto.Changeset{} = changeset} -> + {:error, %Ecto.Changeset{} = changeset} -> {:noreply, assign(socket, :changeset, changeset)} - end end + end defp save_workout_template(socket, :new, workout_template_params) do - case WorkoutTemplates.create_workout_template(Map.put(workout_template_params,"user_id", socket.assigns.user_id)) do + case WorkoutTemplates.create_workout_template( + Map.put(workout_template_params, "user_id", socket.assigns.user_id) + ) do {:ok, workout_template} -> {:noreply, - socket - |> put_flash(:info, "Workout template created successfully") - |> push_redirect(to: "/workout_templates/#{workout_template.id}")} + socket + |> put_flash(:info, "Workout template created successfully") + |> push_redirect(to: "/workout_templates/#{workout_template.id}")} {:error, %Ecto.Changeset{} = changeset} -> - {:noreply, assign(socket, changeset: changeset)} + {:noreply, assign(socket, changeset: changeset)} end end end diff --git a/lib/fitness_web/live/workout_template_live/workout_item_form.ex b/lib/fitness_web/live/workout_template_live/workout_item_form.ex index b48d9b4..2716db4 100644 --- a/lib/fitness_web/live/workout_template_live/workout_item_form.ex +++ b/lib/fitness_web/live/workout_template_live/workout_item_form.ex @@ -87,7 +87,7 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutItemForm do [current | _tail] = WorkoutItemLogic.updated_workout_items_list(current_exercise_id, workout_items_list) - + {:noreply, assign(socket, sets_number: current.sets_number, diff --git a/lib/fitness_web/live/workout_template_live/workout_zone.ex b/lib/fitness_web/live/workout_template_live/workout_zone.ex index 6cc8803..ec27655 100644 --- a/lib/fitness_web/live/workout_template_live/workout_zone.ex +++ b/lib/fitness_web/live/workout_template_live/workout_zone.ex @@ -142,14 +142,17 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do current_user = socket.assigns.current_user WorkoutItemLogic.duplicate_workout_template(workout_template) - PlayerScores.update_new_player_score_and_broadcast_score_board(current_user, workout_templates) + + PlayerScores.update_new_player_score_and_broadcast_score_board( + current_user, + workout_templates + ) redirect_value = WorkoutItemLogic.update_workout_template_score(workout_template) socket = case redirect_value do true -> - socket |> put_flash( :bonus, @@ -158,7 +161,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do |> push_redirect(to: "/activity_history") false -> - socket |> put_flash( :loss, diff --git a/lib/fitness_web/router.ex b/lib/fitness_web/router.ex index ee1a2a8..1cd9fe6 100644 --- a/lib/fitness_web/router.ex +++ b/lib/fitness_web/router.ex @@ -23,7 +23,6 @@ defmodule FitnessWeb.Router do pipe_through [:browser, :require_authenticated_user] live_session :user, on_mount: {UserAuthLive, :user} do - live "/exercises/new", ExerciseLive.Index, :new live "/exercises/:id/edit", ExerciseLive.Index, :edit live "/exercises/:id/show/edit", ExerciseLive.Show, :edit @@ -36,9 +35,12 @@ defmodule FitnessWeb.Router do live "/workout_templates/new", WorkoutTemplateLive.Index, :new live "/workout_templates/:id", WorkoutTemplateLive.Show, :show live "/workout_templates/:id/edit", WorkoutTemplateLive.Index, :edit - live "/workout_templates/:id/show/workout_zone", WorkoutTemplateLive.WorkoutZone, :workout_zone - live "/workout_templates/:id/show/edit", WorkoutTemplateLive.Show, :edit + live "/workout_templates/:id/show/workout_zone", + WorkoutTemplateLive.WorkoutZone, + :workout_zone + + live "/workout_templates/:id/show/edit", WorkoutTemplateLive.Show, :edit end end @@ -53,8 +55,6 @@ defmodule FitnessWeb.Router do live "/exercises/:id", ExerciseLive.Show, :show end - - # Other scopes may use custom stacks. # scope "/api", FitnessWeb do # pipe_through :api diff --git a/priv/repo/migrations/20230417211058_create_workout_items.exs b/priv/repo/migrations/20230417211058_create_workout_items.exs index e7caa0e..a32c109 100644 --- a/priv/repo/migrations/20230417211058_create_workout_items.exs +++ b/priv/repo/migrations/20230417211058_create_workout_items.exs @@ -9,7 +9,9 @@ defmodule Fitness.Repo.Migrations.CreateWorkoutItems do add :reps, :integer add :check_box, :boolean, default: false, null: false add :exercise_id, references(:exercises, on_delete: :delete_all), null: false - add :workout_template_id, references(:workout_templates, on_delete: :delete_all), null: false + + add :workout_template_id, references(:workout_templates, on_delete: :delete_all), + null: false timestamps() end diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index b066dcc..c89db31 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -13,21 +13,105 @@ alias Fitness.Exercises alias Fitness.Accounts - File.read!("priv/repo/list_of_exercises.txt") |> :erlang.binary_to_term() |> Enum.uniq() |> Enum.each(fn workout -> Exercises.create_exercise(workout) end) +Accounts.register_user(%{ + email: "test@test.com", + password: "test@test.com", + is_admin: true, + username: "Admin001", + name: "Admin" +}) + +Accounts.register_user(%{ + email: "test@test1.com", + password: "mak12345", + is_admin: false, + username: "puppies-lover", + name: "Andervrs", + player_score: "1001" +}) + +Accounts.register_user(%{ + email: "test@test2.com", + password: "mak12345", + is_admin: false, + username: "Full-stack-developer", + name: "Alfred", + player_score: "800" +}) + +Accounts.register_user(%{ + email: "test@test3.com", + password: "mak12345", + is_admin: false, + username: "Captain-America", + name: "john", + player_score: "1000" +}) + +Accounts.register_user(%{ + email: "test@test4.com", + password: "mak12345", + is_admin: false, + username: "Rhythm-Rider", + name: "Einer", + player_score: "700" +}) + +Accounts.register_user(%{ + email: "test@test5.com", + password: "mak12345", + is_admin: false, + username: "Richie-Rich", + name: "yusef", + player_score: "900" +}) + +Accounts.register_user(%{ + email: "test@test6.com", + password: "mak12345", + is_admin: false, + username: "The-Label-Man", + name: "eddie", + player_score: "10000" +}) + +Accounts.register_user(%{ + email: "test@test7.com", + password: "mak12345", + is_admin: false, + username: "The-Wizard", + name: "brook", + player_score: "5000" +}) + +Accounts.register_user(%{ + email: "test@test8.com", + password: "mak12345", + is_admin: false, + username: "Albert-Einstein", + name: "steve", + player_score: "600" +}) + +Accounts.register_user(%{ + email: "test@test9.com", + password: "mak12345", + is_admin: false, + username: "The-Bird-Man", + name: "marko", + player_score: "500" +}) -Accounts.register_user(%{email: "test@test.com", password: "test@test.com", is_admin: true, username: "Admin001", name: "Admin"}) -Accounts.register_user(%{email: "test@test1.com", password: "mak12345", is_admin: false, username: "puppies-lover", name: "Andervrs", player_score: "1001"}) -Accounts.register_user(%{email: "test@test2.com", password: "mak12345", is_admin: false, username: "Full-stack-developer", name: "Alfred", player_score: "800"}) -Accounts.register_user(%{email: "test@test3.com", password: "mak12345", is_admin: false, username: "Captain-America", name: "john", player_score: "1000"}) -Accounts.register_user(%{email: "test@test4.com", password: "mak12345", is_admin: false, username: "Rhythm-Rider", name: "Einer", player_score: "700"}) -Accounts.register_user(%{email: "test@test5.com", password: "mak12345", is_admin: false, username: "Richie-Rich", name: "yusef", player_score: "900"}) -Accounts.register_user(%{email: "test@test6.com", password: "mak12345", is_admin: false, username: "The-Label-Man", name: "eddie", player_score: "10000"}) -Accounts.register_user(%{email: "test@test7.com", password: "mak12345", is_admin: false, username: "The-Wizard", name: "brook", player_score: "5000"}) -Accounts.register_user(%{email: "test@test8.com", password: "mak12345", is_admin: false, username: "Albert-Einstein", name: "steve", player_score: "600"}) -Accounts.register_user(%{email: "test@test9.com", password: "mak12345", is_admin: false, username: "The-Bird-Man", name: "marko", player_score: "500"}) -Accounts.register_user(%{email: "test@test10.com", password: "mak12345", is_admin: false, username: "Elixir-Newbie", name: "mohsin",player_score: "2000"}) +Accounts.register_user(%{ + email: "test@test10.com", + password: "mak12345", + is_admin: false, + username: "Elixir-Newbie", + name: "mohsin", + player_score: "2000" +}) diff --git a/rel/env.sh.eex b/rel/env.sh.eex new file mode 100755 index 0000000..2bdface --- /dev/null +++ b/rel/env.sh.eex @@ -0,0 +1,8 @@ +#!/bin/sh + +# configure node for distributed erlang with IPV6 support +export ERL_AFLAGS="-proto_dist inet6_tcp" +export ECTO_IPV6="true" +export DNS_CLUSTER_QUERY="${FLY_APP_NAME}.internal" +export RELEASE_DISTRIBUTION="name" +export RELEASE_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}" diff --git a/rel/overlays/bin/migrate b/rel/overlays/bin/migrate new file mode 100755 index 0000000..f2644bf --- /dev/null +++ b/rel/overlays/bin/migrate @@ -0,0 +1,3 @@ +#!/bin/sh +cd -P -- "$(dirname -- "$0")" +exec ./fitness eval Fitness.Release.migrate diff --git a/rel/overlays/bin/migrate.bat b/rel/overlays/bin/migrate.bat new file mode 100755 index 0000000..b017109 --- /dev/null +++ b/rel/overlays/bin/migrate.bat @@ -0,0 +1 @@ +call "%~dp0\fitness" eval Fitness.Release.migrate diff --git a/rel/overlays/bin/server b/rel/overlays/bin/server new file mode 100755 index 0000000..82f19d9 --- /dev/null +++ b/rel/overlays/bin/server @@ -0,0 +1,3 @@ +#!/bin/sh +cd -P -- "$(dirname -- "$0")" +PHX_SERVER=true exec ./fitness start diff --git a/rel/overlays/bin/server.bat b/rel/overlays/bin/server.bat new file mode 100755 index 0000000..217bb26 --- /dev/null +++ b/rel/overlays/bin/server.bat @@ -0,0 +1,2 @@ +set PHX_SERVER=true +call "%~dp0\fitness" start diff --git a/test/fitness/accounts_test.exs b/test/fitness/accounts_test.exs index b5868fc..ea5db29 100644 --- a/test/fitness/accounts_test.exs +++ b/test/fitness/accounts_test.exs @@ -59,13 +59,23 @@ defmodule Fitness.AccountsTest do end test "validates email and password when given" do - {:error, changeset} = Accounts.register_user(%{email: "not valid", password: "1", name: "not valid123", username: "not valid"}) + {:error, changeset} = + Accounts.register_user(%{ + email: "not valid", + password: "1", + name: "not valid123", + username: "not valid" + }) assert %{ email: ["must have the @ sign and no spaces"], password: ["should be at least 6 character(s)"], - name: ["A name must be made up of only letters and should not include any symbols or numbers."], - username: ["A username should consist of both letters and numbers, and should not contain any spaces"] + name: [ + "A name must be made up of only letters and should not include any symbols or numbers." + ], + username: [ + "A username should consist of both letters and numbers, and should not contain any spaces" + ] } = errors_on(changeset) end diff --git a/test/fitness/exercises_test.exs b/test/fitness/exercises_test.exs index 7349a76..7f0a6b0 100644 --- a/test/fitness/exercises_test.exs +++ b/test/fitness/exercises_test.exs @@ -21,7 +21,15 @@ defmodule Fitness.ExercisesTest do end test "create_exercise/1 with valid data creates a exercise" do - valid_attrs = %{description: "some description", gif_url: "some gif_url", level: "some level", name: "some name", type: "some type", equipment: "some equipment",body_part: "some body part"} + valid_attrs = %{ + description: "some description", + gif_url: "some gif_url", + level: "some level", + name: "some name", + type: "some type", + equipment: "some equipment", + body_part: "some body part" + } assert {:ok, %Exercise{} = exercise} = Exercises.create_exercise(valid_attrs) assert exercise.description == "some description" @@ -39,7 +47,14 @@ defmodule Fitness.ExercisesTest do test "update_exercise/2 with valid data updates the exercise" do exercise = exercise_fixture() - update_attrs = %{description: "some updated description", gif_url: "some updated gif_url", level: "some updated level", name: "some updated name", type: "some updated type"} + + update_attrs = %{ + description: "some updated description", + gif_url: "some updated gif_url", + level: "some updated level", + name: "some updated name", + type: "some updated type" + } assert {:ok, %Exercise{} = exercise} = Exercises.update_exercise(exercise, update_attrs) assert exercise.description == "some updated description" diff --git a/test/fitness/workout_templates_test.exs b/test/fitness/workout_templates_test.exs index 5cba24d..b75b21b 100644 --- a/test/fitness/workout_templates_test.exs +++ b/test/fitness/workout_templates_test.exs @@ -30,10 +30,10 @@ defmodule Fitness.WorkoutTemplatesTest do user = user_fixture() valid_attrs = %{name: "some name", user_id: user.id} - assert {:ok, %WorkoutTemplate{} = workout_template} = + assert {:ok, %WorkoutTemplate{} = workout_template} = WorkoutTemplates.create_workout_template(valid_attrs) - assert workout_template.name == "some name" + assert workout_template.name == "some name" end test "create_workout_template/1 with invalid data returns error changeset" do diff --git a/test/fitness_web/controllers/user_reset_password_controller_test.exs b/test/fitness_web/controllers/user_reset_password_controller_test.exs index 0d40786..5ae4ac1 100644 --- a/test/fitness_web/controllers/user_reset_password_controller_test.exs +++ b/test/fitness_web/controllers/user_reset_password_controller_test.exs @@ -12,7 +12,7 @@ defmodule FitnessWeb.UserResetPasswordControllerTest do describe "GET /users/reset_password" do test "renders the reset password page", %{conn: conn} do conn = get(conn, Routes.user_reset_password_path(conn, :new)) - response = html_response(conn, 200) + response = html_response(conn, 200) assert response =~ "Forgot your password?" end end diff --git a/test/fitness_web/live/exercise_live_test.exs b/test/fitness_web/live/exercise_live_test.exs index f357042..6c56061 100644 --- a/test/fitness_web/live/exercise_live_test.exs +++ b/test/fitness_web/live/exercise_live_test.exs @@ -25,7 +25,15 @@ defmodule FitnessWeb.ExerciseLiveTest do equipment: "Others", body_part: "Others" } - @invalid_attrs %{description: nil, gif_url: nil, level: "Others", name: nil, type: "Others", equipment: "Others", body_part: "Others"} + @invalid_attrs %{ + description: nil, + gif_url: nil, + level: "Others", + name: nil, + type: "Others", + equipment: "Others", + body_part: "Others" + } setup %{conn: conn} do conn = @@ -83,7 +91,6 @@ defmodule FitnessWeb.ExerciseLiveTest do {:ok, index_live, _html} = live(conn, Routes.exercise_index_path(conn, :index)) - assert index_live |> element("#exercise-#{exercise.id} a", "Edit") |> render_click() =~ "Edit Exercise" @@ -104,7 +111,6 @@ defmodule FitnessWeb.ExerciseLiveTest do end test "deletes exercise in listing", %{conn: conn, exercise: exercise, user: user} do - conn = conn |> log_in_user(user) {:ok, index_live, _html} = live(conn, Routes.exercise_index_path(conn, :index)) @@ -127,7 +133,6 @@ defmodule FitnessWeb.ExerciseLiveTest do {:ok, show_live, _html} = live(conn, Routes.exercise_show_path(conn, :show, exercise)) - assert show_live |> element("a", "Edit") |> render_click() =~ "Edit Exercise" diff --git a/test/fitness_web/live/workout_template_live_test.exs b/test/fitness_web/live/workout_template_live_test.exs index 2da4a5a..f260ba6 100644 --- a/test/fitness_web/live/workout_template_live_test.exs +++ b/test/fitness_web/live/workout_template_live_test.exs @@ -18,7 +18,11 @@ defmodule FitnessWeb.WorkoutTemplateLiveTest do describe "Index" do setup [:create_workout_template] - test "lists all workout_templates", %{conn: conn, workout_template: workout_template, user: user} do + test "lists all workout_templates", %{ + conn: conn, + workout_template: workout_template, + user: user + } do conn = conn |> log_in_user(user) {:ok, _index_live, html} = live(conn, Routes.workout_template_index_path(conn, :index)) @@ -33,30 +37,36 @@ defmodule FitnessWeb.WorkoutTemplateLiveTest do {:ok, index_live, _html} = live(conn, Routes.workout_template_index_path(conn, :index)) assert index_live |> element("a", "New Workout") |> render_click() =~ - "New Workout template" + "New Workout template" assert_patch(index_live, Routes.workout_template_index_path(conn, :new)) assert index_live - |> form("#workout_template-form", workout_template: @invalid_attrs) - |> render_change() =~ "can't be blank" + |> form("#workout_template-form", workout_template: @invalid_attrs) + |> render_change() =~ "can't be blank" {:error, {:live_redirect, %{to: location}}} = index_live |> form("#workout_template-form", workout_template: @create_attrs) |> render_submit() - {:ok, _, html} = live(conn, location) + {:ok, _, html} = live(conn, location) assert html =~ "SOME NAME" end - test "updates workout_template in listing", %{conn: conn, workout_template: workout_template, user: user} do + test "updates workout_template in listing", %{ + conn: conn, + workout_template: workout_template, + user: user + } do conn = conn |> log_in_user(user) {:ok, index_live, _html} = live(conn, Routes.workout_template_index_path(conn, :index)) - assert index_live |> element("#workout_template-#{workout_template.id} a", "Edit") |> render_click() =~ + assert index_live + |> element("#workout_template-#{workout_template.id} a", "Edit") + |> render_click() =~ "Edit Workout template" assert_patch(index_live, Routes.workout_template_index_path(conn, :edit, workout_template)) @@ -75,12 +85,19 @@ defmodule FitnessWeb.WorkoutTemplateLiveTest do assert html =~ "SOME UPDATED NAME" end - test "deletes workout_template in listing", %{conn: conn, workout_template: workout_template, user: user} do + test "deletes workout_template in listing", %{ + conn: conn, + workout_template: workout_template, + user: user + } do conn = conn |> log_in_user(user) {:ok, index_live, _html} = live(conn, Routes.workout_template_index_path(conn, :index)) - assert index_live |> element("#workout_template-#{workout_template.id} a", "Delete") |> render_click() + assert index_live + |> element("#workout_template-#{workout_template.id} a", "Delete") + |> render_click() + refute has_element?(index_live, "#workout_template-#{workout_template.id}") end end @@ -88,22 +105,33 @@ defmodule FitnessWeb.WorkoutTemplateLiveTest do describe "Show" do setup [:create_workout_template] - test "displays workout_template", %{conn: conn, workout_template: workout_template, user: user} do + test "displays workout_template", %{ + conn: conn, + workout_template: workout_template, + user: user + } do conn = conn |> log_in_user(user) - {:ok, _show_live, html} = live(conn, Routes.workout_template_show_path(conn, :show, workout_template)) + + {:ok, _show_live, html} = + live(conn, Routes.workout_template_show_path(conn, :show, workout_template)) assert html =~ "Show Workout template" assert html =~ String.upcase(workout_template.name) end - test "Add workout_items within modal", %{conn: conn, workout_template: workout_template, user: user} do - conn = conn |> log_in_user(user) + test "Add workout_items within modal", %{ + conn: conn, + workout_template: workout_template, + user: user + } do + conn = conn |> log_in_user(user) - {:ok, show_live, _html} = live(conn, Routes.workout_template_show_path(conn, :show, workout_template)) + {:ok, show_live, _html} = + live(conn, Routes.workout_template_show_path(conn, :show, workout_template)) - assert show_live |> element("a", "ADD EXERCISE") |> render_click() =~ "Add New Exercises" + assert show_live |> element("a", "ADD EXERCISE") |> render_click() =~ "Add New Exercises" - assert_patch(show_live, Routes.workout_template_show_path(conn, :edit, workout_template)) + assert_patch(show_live, Routes.workout_template_show_path(conn, :edit, workout_template)) # assert show_live # |> form("#workout_items_form", workout_items: @invalid_attrs_workout_items) From 683e3605f5c8510c05ba2195c0b9cf95f9587665 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 27 Apr 2025 14:19:15 +0400 Subject: [PATCH 03/22] cleanup --- .../live/workout_template_live/index.ex | 1 - .../live/workout_template_live/workout_zone.ex | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/fitness_web/live/workout_template_live/index.ex b/lib/fitness_web/live/workout_template_live/index.ex index c402c50..266a50e 100644 --- a/lib/fitness_web/live/workout_template_live/index.ex +++ b/lib/fitness_web/live/workout_template_live/index.ex @@ -3,7 +3,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.Index do alias Fitness.WorkoutTemplates alias Fitness.WorkoutTemplates.WorkoutTemplate - alias Fitness.Accounts @impl true def mount(_params, _session, socket) do diff --git a/lib/fitness_web/live/workout_template_live/workout_zone.ex b/lib/fitness_web/live/workout_template_live/workout_zone.ex index ec27655..ec05c06 100644 --- a/lib/fitness_web/live/workout_template_live/workout_zone.ex +++ b/lib/fitness_web/live/workout_template_live/workout_zone.ex @@ -3,14 +3,12 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do alias Fitness.WorkoutTemplates alias Fitness.WorkoutTemplates.WorkoutItem - alias Fitness.Exercises alias FitnessWeb.WorkoutTemplateLive.CheckBoxesLiveComponent - alias Fitness.Accounts alias Fitness.WorkoutTemplates.Services.WorkoutItemLogic alias Fitness.Accounts.Services.PlayerScores @impl true - def mount(params, session, socket) do + def mount(params, _session, socket) do changeset = WorkoutTemplates.change_workout_item(%WorkoutItem{}) workout_template = WorkoutTemplates.get_workout_template!(params["id"]) @@ -27,6 +25,7 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do |> assign(:check_complete_checkbox_list, check_complete_checkbox_list)} end + @impl true def render(assigns) do ~H""" @@ -103,8 +102,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do @impl true def handle_params(%{"id" => id}, _, socket) do - changeset = WorkoutTemplates.change_workout_item(%WorkoutItem{}) - {:noreply, socket |> assign(:workout_template, WorkoutTemplates.get_workout_template!(id))} @@ -113,7 +110,11 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do # update my checkboxes @impl true - def handle_event("workout_complete", %{"id" => id, "value" => check_box_value} = params, socket) do + def handle_event( + "workout_complete", + %{"id" => id, "value" => check_box_value} = _params, + socket + ) do id = String.to_integer(id) check_box_value = String.to_atom(check_box_value) @@ -123,7 +124,7 @@ defmodule FitnessWeb.WorkoutTemplateLive.WorkoutZone do end @impl true - def handle_event("workout_complete", %{"id" => id} = params, socket) do + def handle_event("workout_complete", %{"id" => id} = _params, socket) do id = String.to_integer(id) check_box_value = false From 8c94658985f09a32f6ae5c6a85cb928a7a164f42 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 27 Apr 2025 14:31:43 +0400 Subject: [PATCH 04/22] update --- lib/fitness_web/router.ex | 6 ++++ lib/fitness_web/schema.ex | 62 +++++++++++++++++++++++++++++++++++++++ mix.exs | 5 ++++ mix.lock | 2 ++ 4 files changed, 75 insertions(+) create mode 100644 lib/fitness_web/schema.ex diff --git a/lib/fitness_web/router.ex b/lib/fitness_web/router.ex index 1cd9fe6..d7ff1d0 100644 --- a/lib/fitness_web/router.ex +++ b/lib/fitness_web/router.ex @@ -19,6 +19,12 @@ defmodule FitnessWeb.Router do plug :accepts, ["json"] end + scope "/api" do + pipe_through :api + + forward "/graphql", Absinthe.Plug, schema: FitnessWeb.Schema + end + scope "/", FitnessWeb do pipe_through [:browser, :require_authenticated_user] diff --git a/lib/fitness_web/schema.ex b/lib/fitness_web/schema.ex new file mode 100644 index 0000000..f079985 --- /dev/null +++ b/lib/fitness_web/schema.ex @@ -0,0 +1,62 @@ +defmodule FitnessWeb.Schema do + use Absinthe.Schema + + alias Fitness.Exercises.Exercise + alias Fitness.WorkoutTemplates.WorkoutItem + alias Fitness.WorkoutTemplates.WorkoutTemplate + + # Query entry point + query do + @desc "List all exercises" + field :exercises, list_of(:exercise) do + resolve(fn _, _, _ -> + {:ok, Fitness.Repo.all(Exercise)} + end) + end + + @desc "List all workout templates" + field :workout_templates, list_of(:workout_template) do + resolve(fn _, _, _ -> + {:ok, Fitness.Repo.all(WorkoutTemplate)} + end) + end + end + + # Types + object :exercise do + field :id, non_null(:id) + field :name, non_null(:string) + field :type, :string + field :level, :string + field :description, :string + field :body_part, :string + field :equipment, :string + end + + object :workout_item do + field :id, non_null(:id) + field :sets, :integer + field :reps, :integer + field :weight, :float + field :weight_unit, :string + + field :exercise, :exercise do + resolve(fn workout_item, _, _ -> + {:ok, Fitness.Repo.get(Exercise, workout_item.exercise_id)} + end) + end + end + + object :workout_template do + field :id, non_null(:id) + field :name, :string + field :workout_template_score, :integer + field :is_finished, :boolean + + field :workout_items, list_of(:workout_item) do + resolve(fn template, _, _ -> + {:ok, Fitness.Repo.preload(template, :workout_items).workout_items} + end) + end + end +end diff --git a/mix.exs b/mix.exs index 4113d88..3cb33c7 100644 --- a/mix.exs +++ b/mix.exs @@ -33,6 +33,11 @@ defmodule Fitness.MixProject do # Type `mix help deps` for examples and options. defp deps do [ + # graphql + {:absinthe_plug, "~> 1.5"}, + {:absinthe, "~> 1.7"}, + + # core {:bcrypt_elixir, "~> 3.0"}, {:phoenix, "~> 1.6.15"}, {:phoenix_ecto, "~> 4.4"}, diff --git a/mix.lock b/mix.lock index 2ced981..ca6c4b8 100644 --- a/mix.lock +++ b/mix.lock @@ -1,4 +1,6 @@ %{ + "absinthe": {:hex, :absinthe, "1.7.9", "85c5bc9dfcb984fadf632d6e9a9f6daa7770c68d4f751f20cd5f9e77c57be4a1", [:mix], [{:dataloader, "~> 1.0.0 or ~> 2.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2.1 or ~> 0.3", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "08ae6339b05252b98e859ccd76614c94325c991f85aa325edde30027b7b044fc"}, + "absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"}, "bcrypt_elixir": {:hex, :bcrypt_elixir, "3.0.1", "9be815469e6bfefec40fa74658ecbbe6897acfb57614df1416eeccd4903f602c", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "486bb95efb645d1efc6794c1ddd776a186a9a713abf06f45708a6ce324fb96cf"}, "castore": {:hex, :castore, "1.0.1", "240b9edb4e9e94f8f56ab39d8d2d0a57f49e46c56aced8f873892df8ff64ff5a", [:mix], [], "hexpm", "b4951de93c224d44fac71614beabd88b71932d0b1dea80d2f80fb9044e01bbb3"}, "chartkick": {:hex, :chartkick, "1.0.0", "8f640a746ebb90f5975ad0096da872023bc5c9ccf5d6d5654c4fed11c32b9686", [:mix], [{:elixir_uuid, "~> 1.2", [hex: :elixir_uuid, repo: "hexpm", optional: false]}], "hexpm", "219e4b95a9b89723a2155ba0f4928c4789a6f67a49d478f3fa9f92793c37231a"}, From cdba4889ca42e61dc0ad77fade3d7401244374ea Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 10:21:30 +0400 Subject: [PATCH 05/22] update --- lib/fitness/workout_templates.ex | 11 +++++++++-- lib/fitness_web/schema.ex | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index 7dc8acf..28cd166 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -4,10 +4,10 @@ defmodule Fitness.WorkoutTemplates do """ import Ecto.Query, warn: false - alias Fitness.WorkoutTemplates.WorkoutItem - alias Fitness.Repo + alias Fitness.WorkoutTemplates.WorkoutItem alias Fitness.WorkoutTemplates.WorkoutTemplate + alias Fitness.Repo @doc """ Returns the list of workout_templates. @@ -129,4 +129,11 @@ defmodule Fitness.WorkoutTemplates do def change_workout_item(%WorkoutItem{} = workout_item, attrs \\ %{}) do WorkoutItem.changeset(workout_item, attrs) end + + @doc "Fetch list of workout Item by workout template" + @spec fetch_workout_items_by_workout_template(WorkoutTemplate.t()) :: [WorkoutItem.t()] + def fetch_workout_items_by_workout_template(workout_template) do + from(workout_item in WorkoutItem, where: workout_item == ^workout_template.id) + |> Repo.all() + end end diff --git a/lib/fitness_web/schema.ex b/lib/fitness_web/schema.ex index f079985..153ce2a 100644 --- a/lib/fitness_web/schema.ex +++ b/lib/fitness_web/schema.ex @@ -33,6 +33,7 @@ defmodule FitnessWeb.Schema do field :equipment, :string end + object :workout_item do field :id, non_null(:id) field :sets, :integer @@ -47,6 +48,7 @@ defmodule FitnessWeb.Schema do end end + object :workout_template do field :id, non_null(:id) field :name, :string @@ -54,8 +56,11 @@ defmodule FitnessWeb.Schema do field :is_finished, :boolean field :workout_items, list_of(:workout_item) do - resolve(fn template, _, _ -> - {:ok, Fitness.Repo.preload(template, :workout_items).workout_items} + resolve(fn workout_template, _, _ -> + + + + {:ok, Fitness.WorkoutTemplates.fetch_workout_items_by_workout_template(workout_template)} end) end end From b9a099eb1ccf52cf3fe618279a047df91704003d Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 10:34:38 +0400 Subject: [PATCH 06/22] fetch a single workout template bad --- lib/fitness/workout_templates.ex | 8 ++++---- lib/fitness_web/schema.ex | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index 28cd166..ec94345 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -130,10 +130,10 @@ defmodule Fitness.WorkoutTemplates do WorkoutItem.changeset(workout_item, attrs) end - @doc "Fetch list of workout Item by workout template" - @spec fetch_workout_items_by_workout_template(WorkoutTemplate.t()) :: [WorkoutItem.t()] - def fetch_workout_items_by_workout_template(workout_template) do - from(workout_item in WorkoutItem, where: workout_item == ^workout_template.id) + def fetch_workout_items_by_workout_template(%{id: workout_template_id} = _workout_template) do + from(workout_item in WorkoutItem, + where: workout_item.workout_template_id == ^workout_template_id + ) |> Repo.all() end end diff --git a/lib/fitness_web/schema.ex b/lib/fitness_web/schema.ex index 153ce2a..6b6a29c 100644 --- a/lib/fitness_web/schema.ex +++ b/lib/fitness_web/schema.ex @@ -2,7 +2,6 @@ defmodule FitnessWeb.Schema do use Absinthe.Schema alias Fitness.Exercises.Exercise - alias Fitness.WorkoutTemplates.WorkoutItem alias Fitness.WorkoutTemplates.WorkoutTemplate # Query entry point @@ -20,6 +19,14 @@ defmodule FitnessWeb.Schema do {:ok, Fitness.Repo.all(WorkoutTemplate)} end) end + + @desc "Fetch a specific workout template" + field :get_workout_template, :workout_template do + resolve(fn workout_template, _, _ -> + {:ok, + Fitness.WorkoutTemplates.fetch_workout_items_by_workout_template(workout_template.id)} + end) + end end # Types @@ -33,7 +40,6 @@ defmodule FitnessWeb.Schema do field :equipment, :string end - object :workout_item do field :id, non_null(:id) field :sets, :integer @@ -48,7 +54,6 @@ defmodule FitnessWeb.Schema do end end - object :workout_template do field :id, non_null(:id) field :name, :string @@ -57,10 +62,7 @@ defmodule FitnessWeb.Schema do field :workout_items, list_of(:workout_item) do resolve(fn workout_template, _, _ -> - - - - {:ok, Fitness.WorkoutTemplates.fetch_workout_items_by_workout_template(workout_template)} + {:ok, Fitness.WorkoutTemplates.fetch_workout_items_by_workout_template(workout_template)} end) end end From 381be9f7fbc739d69d108e0868111d8aba8aecf2 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 10:49:28 +0400 Subject: [PATCH 07/22] added bad query --- lib/fitness_web/schema.ex | 62 ++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/lib/fitness_web/schema.ex b/lib/fitness_web/schema.ex index 6b6a29c..b4f1877 100644 --- a/lib/fitness_web/schema.ex +++ b/lib/fitness_web/schema.ex @@ -4,33 +4,8 @@ defmodule FitnessWeb.Schema do alias Fitness.Exercises.Exercise alias Fitness.WorkoutTemplates.WorkoutTemplate - # Query entry point - query do - @desc "List all exercises" - field :exercises, list_of(:exercise) do - resolve(fn _, _, _ -> - {:ok, Fitness.Repo.all(Exercise)} - end) - end - - @desc "List all workout templates" - field :workout_templates, list_of(:workout_template) do - resolve(fn _, _, _ -> - {:ok, Fitness.Repo.all(WorkoutTemplate)} - end) - end - - @desc "Fetch a specific workout template" - field :get_workout_template, :workout_template do - resolve(fn workout_template, _, _ -> - {:ok, - Fitness.WorkoutTemplates.fetch_workout_items_by_workout_template(workout_template.id)} - end) - end - end - - # Types - object :exercise do + # Types + object :exercise do field :id, non_null(:id) field :name, non_null(:string) field :type, :string @@ -66,4 +41,37 @@ defmodule FitnessWeb.Schema do end) end end + + input_object :workout_template_get_input do + field :workout_template_id, non_null(:integer) + end + + # Query entry point + query do + @desc "List all exercises" + field :exercises, list_of(:exercise) do + resolve(fn _, _, _ -> + {:ok, Fitness.Repo.all(Exercise)} + end) + end + + @desc "List all workout templates" + field :workout_templates, list_of(:workout_template) do + resolve(fn _, _, _ -> + {:ok, Fitness.Repo.all(WorkoutTemplate)} + end) + end + + @desc "Fetch a specific workout template" + field :get_workout_template, :workout_template do + arg(:input, type: non_null(:workout_template_get_input)) + + resolve(fn _, %{input: %{workout_template_id: workout_template_id}}, _res -> + {:ok, + Fitness.WorkoutTemplates.get_workout_template!(workout_template_id)} + end) + end + end + + end From 0db3a2c4e625406d8fb9674926091ac809976ee6 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 12:05:00 -0400 Subject: [PATCH 08/22] update --- lib/fitness/workout_templates.ex | 10 ++++++++++ mix.exs | 1 + mix.lock | 1 + priv/repo/seeds.exs | 2 ++ 4 files changed, 14 insertions(+) diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index ec94345..4c019ae 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -136,4 +136,14 @@ defmodule Fitness.WorkoutTemplates do ) |> Repo.all() end + + def data() do + Dataloader.Ecto.new(Repo, query: &query/2) + end + + def query(queryable, _) do + queryable + end + + end diff --git a/mix.exs b/mix.exs index 3cb33c7..d12c699 100644 --- a/mix.exs +++ b/mix.exs @@ -36,6 +36,7 @@ defmodule Fitness.MixProject do # graphql {:absinthe_plug, "~> 1.5"}, {:absinthe, "~> 1.7"}, + {:dataloader, "~> 2.0.0"}, # core {:bcrypt_elixir, "~> 3.0"}, diff --git a/mix.lock b/mix.lock index ca6c4b8..9aa69c9 100644 --- a/mix.lock +++ b/mix.lock @@ -9,6 +9,7 @@ "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"}, + "dataloader": {:hex, :dataloader, "2.0.2", "c45075e0692e68638a315e14f747bd8d7065fb5f38705cf980f62d4cd344401f", [:mix], [{:ecto, ">= 3.4.3 and < 4.0.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:opentelemetry_process_propagator, "~> 0.2.1 or ~> 0.3", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4c6cabc0b55e96e7de74d14bf37f4a5786f0ab69aa06764a1f39dda40079b098"}, "db_connection": {:hex, :db_connection, "2.4.3", "3b9aac9f27347ec65b271847e6baeb4443d8474289bd18c1d6f4de655b70c94d", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c127c15b0fa6cfb32eed07465e05da6c815b032508d4ed7c116122871df73c12"}, "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, "earmark": {:hex, :earmark, "1.4.37", "56ce845c543393aa3f9b294c818c3d783452a4a67e4ab18c4303a954a8b59363", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "d86d5e12868db86d5321b00e62a4bbcb4150346e4acc9a90a041fb188a5cb106"}, diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index c89db31..f4a1717 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -115,3 +115,5 @@ Accounts.register_user(%{ name: "mohsin", player_score: "2000" }) + +# just use generator to generate the bunch of workout templates From c4a59adc074000816459e77818633141372c328d Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 13:05:14 -0400 Subject: [PATCH 09/22] update --- lib/fitness/workout_templates.ex | 2 - lib/fitness_web/schema.ex | 9 +- priv/repo/seeds.exs | 713 ++++++++++++++++++++++++++++++- 3 files changed, 701 insertions(+), 23 deletions(-) diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index 4c019ae..499ef31 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -144,6 +144,4 @@ defmodule Fitness.WorkoutTemplates do def query(queryable, _) do queryable end - - end diff --git a/lib/fitness_web/schema.ex b/lib/fitness_web/schema.ex index b4f1877..0cf4180 100644 --- a/lib/fitness_web/schema.ex +++ b/lib/fitness_web/schema.ex @@ -4,8 +4,8 @@ defmodule FitnessWeb.Schema do alias Fitness.Exercises.Exercise alias Fitness.WorkoutTemplates.WorkoutTemplate - # Types - object :exercise do + # Types + object :exercise do field :id, non_null(:id) field :name, non_null(:string) field :type, :string @@ -67,11 +67,8 @@ defmodule FitnessWeb.Schema do arg(:input, type: non_null(:workout_template_get_input)) resolve(fn _, %{input: %{workout_template_id: workout_template_id}}, _res -> - {:ok, - Fitness.WorkoutTemplates.get_workout_template!(workout_template_id)} + {:ok, Fitness.WorkoutTemplates.get_workout_template!(workout_template_id)} end) end end - - end diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index f4a1717..7b58665 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -12,6 +12,10 @@ alias Fitness.Exercises alias Fitness.Accounts +alias Fitness.Repo +alias Fitness.Exercises.Exercise +alias Fitness.WorkoutTemplates.WorkoutTemplate +alias Fitness.WorkoutTemplates.WorkoutItem File.read!("priv/repo/list_of_exercises.txt") |> :erlang.binary_to_term() @@ -98,22 +102,701 @@ Accounts.register_user(%{ player_score: "600" }) -Accounts.register_user(%{ - email: "test@test9.com", - password: "mak12345", - is_admin: false, - username: "The-Bird-Man", - name: "marko", - player_score: "500" +{:ok, user1} = + Accounts.register_user(%{ + email: "test@test9.com", + password: "mak12345", + is_admin: false, + username: "The-Bird-Man", + name: "marko", + player_score: "500" + }) + +{:ok, user2} = + Accounts.register_user(%{ + email: "test@test10.com", + password: "mak12345", + is_admin: false, + username: "Elixir-Newbie", + name: "mohsin", + player_score: "2000" + }) + +# Create exercises +exercises = %{ + # Chest exercises + "bench_press" => + Repo.insert!(%Exercise{ + name: "Barbell Bench Press", + description: "A compound exercise that targets the chest, shoulders, and triceps", + gif_url: "https://example.com/bench-press.gif", + level: "beginner", + type: "strength", + equipment: "barbell", + body_part: "chest" + }), + "incline_press" => + Repo.insert!(%Exercise{ + name: "Incline Dumbbell Press", + description: "Targets the upper chest with an angled press", + gif_url: "https://example.com/incline-press.gif", + level: "beginner", + type: "strength", + equipment: "dumbbell", + body_part: "chest" + }), + "chest_fly" => + Repo.insert!(%Exercise{ + name: "Dumbbell Chest Fly", + description: "An isolation exercise for the chest", + gif_url: "https://example.com/chest-fly.gif", + level: "intermediate", + type: "isolation", + equipment: "dumbbell", + body_part: "chest" + }), + + # Back exercises + "pull_up" => + Repo.insert!(%Exercise{ + name: "Pull-up", + description: "A compound exercise that targets the back and biceps", + gif_url: "https://example.com/pullup.gif", + level: "intermediate", + type: "strength", + equipment: "bodyweight", + body_part: "back" + }), + "bent_row" => + Repo.insert!(%Exercise{ + name: "Bent Over Row", + description: "A compound pulling exercise for back thickness", + gif_url: "https://example.com/bent-row.gif", + level: "beginner", + type: "strength", + equipment: "barbell", + body_part: "back" + }), + "lat_pulldown" => + Repo.insert!(%Exercise{ + name: "Lat Pulldown", + description: "A machine exercise targeting the latissimus dorsi", + gif_url: "https://example.com/lat-pulldown.gif", + level: "beginner", + type: "strength", + equipment: "cable", + body_part: "back" + }), + "face_pull" => + Repo.insert!(%Exercise{ + name: "Face Pull", + description: "An exercise that targets the rear deltoids and upper back", + gif_url: "https://example.com/face-pull.gif", + level: "beginner", + type: "isolation", + equipment: "cable", + body_part: "back" + }), + + # Shoulder exercises + "overhead_press" => + Repo.insert!(%Exercise{ + name: "Overhead Press", + description: "A compound exercise for the shoulders and triceps", + gif_url: "https://example.com/overhead-press.gif", + level: "intermediate", + type: "strength", + equipment: "barbell", + body_part: "shoulders" + }), + "lateral_raise" => + Repo.insert!(%Exercise{ + name: "Lateral Raise", + description: "An isolation exercise for the lateral deltoids", + gif_url: "https://example.com/lateral-raise.gif", + level: "beginner", + type: "isolation", + equipment: "dumbbell", + body_part: "shoulders" + }), + + # Arms exercises + "bicep_curl" => + Repo.insert!(%Exercise{ + name: "Bicep Curl", + description: "An isolation exercise for the biceps", + gif_url: "https://example.com/bicep-curl.gif", + level: "beginner", + type: "isolation", + equipment: "dumbbell", + body_part: "arms" + }), + "hammer_curl" => + Repo.insert!(%Exercise{ + name: "Hammer Curl", + description: "Targets the brachialis and brachioradialis muscles", + gif_url: "https://example.com/hammer-curl.gif", + level: "beginner", + type: "isolation", + equipment: "dumbbell", + body_part: "arms" + }), + "tricep_extension" => + Repo.insert!(%Exercise{ + name: "Tricep Extension", + description: "An isolation exercise for the triceps", + gif_url: "https://example.com/tricep-extension.gif", + level: "beginner", + type: "isolation", + equipment: "cable", + body_part: "arms" + }), + "skull_crusher" => + Repo.insert!(%Exercise{ + name: "Skull Crusher", + description: "A lying tricep extension exercise", + gif_url: "https://example.com/skull-crusher.gif", + level: "intermediate", + type: "isolation", + equipment: "barbell", + body_part: "arms" + }), + + # Leg exercises + "squat" => + Repo.insert!(%Exercise{ + name: "Squat", + description: "A compound exercise that targets the quadriceps, hamstrings, and glutes", + gif_url: "https://example.com/squat.gif", + level: "beginner", + type: "strength", + equipment: "barbell", + body_part: "legs" + }), + "deadlift" => + Repo.insert!(%Exercise{ + name: "Deadlift", + description: "A compound exercise that targets the back, glutes, and hamstrings", + gif_url: "https://example.com/deadlift.gif", + level: "intermediate", + type: "strength", + equipment: "barbell", + body_part: "legs" + }), + "leg_press" => + Repo.insert!(%Exercise{ + name: "Leg Press", + description: "A machine compound exercise for the lower body", + gif_url: "https://example.com/leg-press.gif", + level: "beginner", + type: "strength", + equipment: "machine", + body_part: "legs" + }), + "romanian_deadlift" => + Repo.insert!(%Exercise{ + name: "Romanian Deadlift", + description: "A hip-hinge movement targeting the hamstrings and glutes", + gif_url: "https://example.com/romanian-deadlift.gif", + level: "intermediate", + type: "strength", + equipment: "barbell", + body_part: "legs" + }), + "leg_curl" => + Repo.insert!(%Exercise{ + name: "Leg Curl", + description: "An isolation exercise for the hamstrings", + gif_url: "https://example.com/leg-curl.gif", + level: "beginner", + type: "isolation", + equipment: "machine", + body_part: "legs" + }), + "calf_raise" => + Repo.insert!(%Exercise{ + name: "Calf Raise", + description: "An isolation exercise for the calves", + gif_url: "https://example.com/calf-raise.gif", + level: "beginner", + type: "isolation", + equipment: "machine", + body_part: "legs" + }), + + # Core exercises + "ab_crunch" => + Repo.insert!(%Exercise{ + name: "Ab Crunch", + description: "A basic abdominal exercise", + gif_url: "https://example.com/ab-crunch.gif", + level: "beginner", + type: "isolation", + equipment: "bodyweight", + body_part: "core" + }), + "leg_raise" => + Repo.insert!(%Exercise{ + name: "Hanging Leg Raise", + description: "An advanced core exercise", + gif_url: "https://example.com/hanging-leg-raise.gif", + level: "advanced", + type: "isolation", + equipment: "bodyweight", + body_part: "core" + }) +} + +# ==================== PUSH/PULL/LEGS SPLIT ==================== + +# Push Day (Chest, Shoulders, Triceps) +push_template = + Repo.insert!(%WorkoutTemplate{ + name: "Push Day", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["bench_press"].id, + workout_template_id: push_template.id }) -Accounts.register_user(%{ - email: "test@test10.com", - password: "mak12345", - is_admin: false, - username: "Elixir-Newbie", - name: "mohsin", - player_score: "2000" +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["incline_press"].id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["chest_fly"].id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 40.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["overhead_press"].id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["lateral_raise"].id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["skull_crusher"].id, + workout_template_id: push_template.id +}) + +# Pull Day (Back, Biceps) +pull_template = + Repo.insert!(%WorkoutTemplate{ + name: "Pull Day", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + # Bodyweight + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["pull_up"].id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 60.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["bent_row"].id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["lat_pulldown"].id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: exercises["face_pull"].id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["bicep_curl"].id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["hammer_curl"].id, + workout_template_id: pull_template.id +}) + +# Leg Day +leg_template = + Repo.insert!(%WorkoutTemplate{ + name: "Leg Day", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 100.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["squat"].id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["leg_press"].id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["romanian_deadlift"].id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["leg_curl"].id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 100.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: exercises["calf_raise"].id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + # Bodyweight + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: exercises["ab_crunch"].id, + workout_template_id: leg_template.id +}) + +# ==================== UPPER/LOWER SPLIT ==================== + +# Upper Body Day +upper_template = + Repo.insert!(%WorkoutTemplate{ + name: "Upper Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 75.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["bench_press"].id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 70.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["bent_row"].id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 45.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["overhead_press"].id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["lat_pulldown"].id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["bicep_curl"].id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["tricep_extension"].id, + workout_template_id: upper_template.id +}) + +# Lower Body Day +lower_template = + Repo.insert!(%WorkoutTemplate{ + name: "Lower Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 110.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["squat"].id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 130.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: exercises["deadlift"].id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 140.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["leg_press"].id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["leg_curl"].id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: exercises["calf_raise"].id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: exercises["leg_raise"].id, + workout_template_id: lower_template.id +}) + +# ==================== BRO SPLIT ==================== + +# Chest Day +chest_template = + Repo.insert!(%WorkoutTemplate{ + name: "Chest Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 85.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["bench_press"].id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["incline_press"].id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["chest_fly"].id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["tricep_extension"].id, + workout_template_id: chest_template.id +}) + +# Back Day +back_template = + Repo.insert!(%WorkoutTemplate{ + name: "Back Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +Repo.insert!(%WorkoutItem{ + sets: 4, + # Bodyweight + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: exercises["pull_up"].id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 65.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: exercises["bent_row"].id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 55.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["lat_pulldown"].id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: exercises["bicep_curl"].id, + workout_template_id: back_template.id }) -# just use generator to generate the bunch of workout templates +IO.puts("Database seeded successfully with popular workout splits!") From 816b9705af5cbc3855efd580f05b0fbeb1127d97 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 13:24:15 -0400 Subject: [PATCH 10/22] update --- priv/repo/exercises.json | 686 ++++++++++++++++++++++++++++ priv/repo/seeds.exs | 944 ++++++++++++++++++++------------------- 2 files changed, 1175 insertions(+), 455 deletions(-) create mode 100644 priv/repo/exercises.json diff --git a/priv/repo/exercises.json b/priv/repo/exercises.json new file mode 100644 index 0000000..7616822 --- /dev/null +++ b/priv/repo/exercises.json @@ -0,0 +1,686 @@ +[ + { + "name": "Kettlebell Windmill", + "type": "Strength", + "level": "Intermediate", + "description": "The single-kettlebell windmill is a dynamic kettlebell exercise emphasizing core strength and shoulder and hip mobility and stability. It is often used as a functional warm-up or for multi-directional strength work. It doesn't work as well in a metcon or conditioning setting, and shouldn't be performed under intense fatigue.", + "body_part": "Abdominals", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0554.gif" + }, + { + "name": "Kettlebell swing", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell swing is a popular lower-body exercise emphasizing the hamstrings, glutes, and back muscles. It is often used to train explosive power, for aerobic or cardiovascular conditioning, in circuit training, or as an accessory movement for the deadlift.", + "body_part": "Abdominals", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0549.gif" + }, + { + "name": "Dumbbell side bend", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell side bend is a popular exercise for targeting the oblique muscles of the abdomen. It is usually performed for relatively high reps, at least 8-12 reps per set or more. It can be performed one side at a time or alternating sides.", + "body_part": "Abdominals", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0407.gif" + }, + { + "name": "Barbell press sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell press sit-up is a weighted exercise focusing on the abdominal muscles, as well as the shoulders to a lesser degree. It primarily targets the rectus abdominis or \"six-pack\" muscles, but also involves the obliques and deep core muscles. It can be performed on the floor with the feet anchored or unanchored, or on a decline or other bench. It is similar to the Otis-up, which is performed with a weight plate.", + "body_part": "Abdominals", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0071.gif" + }, + { + "name": "Cable reverse crunch", + "type": "Strength", + "level": "Beginner", + "description": "The cable reverse crunch is performed on the ground facing away from a high pulley, which helps target the lower abdominals specifically.", + "body_part": "Abdominals", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0873.gif" + }, + { + "name": "Cocoons", + "type": "Strength", + "level": "Intermediate", + "description": "The cocoon crunch is a bodyweight exercise targeting the ab muscles, the rectus abdominis or \"six-pack\" muscles in particular. It involves bringing your knees to your chest and your arms from overhead to center. It can be performed for time or reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0260.gif" + }, + { + "name": "Decline Crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The decline crunch is an effective core exercise targeting the rectus abdominis.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0277.gif" + }, + { + "name": "Hanging Oblique Knee Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging oblique crunch an abdominal exercise that targets both the rectus abdominus or “six-pack” muscles, and the oblique muscles. It can be performed hanging from a bar, or if grip strength is a limitation, by placing the elbows in ab straps. If hanging from a straight bar is uncomfortable to the wrists or shoulder, you can also perform them hanging with a neutral grip (palms facing one another)", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1761.gif" + }, + { + "name": "Hanging leg raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging leg raise is an exercise targeting the abs, but which also works the lats and hip flexors. Instead of resting your forearms on the pads of a captain's chair, you perform these hanging from a bar. Experienced lifters make these look easy, but beginners may need time to build up to sets of 8-12 reps.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0472.gif" + }, + { + "name": "Mountain climber", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The mountain climber is a popular bodyweight exercise targeting the muscles of the core, as well as the shoulders, hips, and cardiovascular system. It involves lifting one knee to the chest at a time from a straight-arm plank position. It can be performed for time or reps as part of a dynamic warm-up, for bodyweight cardio or conditioning, or as no-equipment dynamic core training.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0630.gif" + }, + { + "name": "3/4 sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The 3/4 sit-up is a bodyweight exercise focused on the muscles of the core. It is similar to a sit-up, but stops short of the top position. This keeps constant tension on the abs, making it more difficult than traditional sit-ups. It can be performed for time or for reps, with the feet anchored or free, as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0001.gif" + }, + { + "name": "Reverse crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The reverse crunch is a popular exercise targeting the abdominals, particularly the lower half. It’s easy to perform on either the floor or a flat bench. Many lifters think of this as a companion to the crunch, which targets the upper abdominals more than the lower.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0872.gif" + }, + { + "name": "Russian twist", + "type": "Strength", + "level": "Intermediate", + "description": "The Russian twist is an exercise targeting the abdominals and the obliques. Beginning from a position that resembles stopping midway through a sit-up, it involves twisting side to side. It can be performed with body weight alone or while holding a weight plate or other object. It is performed by alternating sides with each rep and can be done for time or for a specific number of reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0687.gif" + }, + { + "name": "Bear crawl", + "type": "Strength", + "level": "Intermediate", + "description": "The bear crawl is a popular bodyweight crawling exercise. While it looks simple, the bear crawl is an intense full-body movement that targets the cardiovascular system as well as a wide range of muscle groups, the shoulders, core, and legs in particular. It can be done as a full-body warm-up, in short bursts for power or circuit training, or for longer durations as cardiovascular conditioning.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3360.gif" + }, + { + "name": "Shoulder tap", + "type": "Strength", + "level": "Intermediate", + "description": "The shoulder tap is an exercise targeting the abdominals and core. The basic stance matches the top of a push-up position. From there, one hand is raised to tap its opposing shoulder. A tap with each hand to each opposing shoulder equals one rep.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3699.gif" + }, + { + "name": "Push-up to side plank", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up to side plank is an upper-body and core-focused exercise combining two popular bodyweight movements. It targets the chest, triceps, and shoulders with the push-up, and the obliques and hip external rotator muscles with the side plank. It can be performed as part of a dynamic warm-up or any bodyweight strength-training workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0664.gif" + }, + { + "name": "Decline sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The decline sit-up is a bodyweight core exercise that works the rectus abdominis or \"six pack\" muscles. Sit-up variations are usually performed for moderate to high reps, such as 10-15 reps per set or more, as part of the core-focused portion of a workout.", + "body_part": "Abdominals", + "equipment": "None", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0282.gif" + }, + { + "name": "Barbell Curl", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell curl is an arm exercise that is also one of the most recognizable movements in all of bodybuilding and fitness. It helps build sleeve-popping biceps and allows heavier loading than many other curl variations. It is usually performed in moderate to high reps, such as 8-12 reps per set, as part of the arm-focused portion of any workout.", + "body_part": "Biceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0031.gif" + }, + { + "name": "Dumbbell preacher curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell preacher curl is an exercise that focuses on building the biceps, particularly the biceps peak. All you need is a pair of dumbbells and a preacher bench. It's usually performed for moderate to high reps as part of an upper-body or arms-focused workout.", + "body_part": "Biceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0372.gif" + }, + { + "name": "Dumbbell biceps curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell biceps curl is a single-joint exercise for building bigger and stronger biceps. Popular among gym goers of all experience levels, this move can be done seated or standing. It is generally performed for moderate to high reps, such as 8-12 reps or higher, as part of the arm-focused portion of a workout.", + "body_part": "Biceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0294.gif" + }, + { + "name": "Weighted donkey calf raise", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted donkey calk raise is a strength and muscle-building exercise focused on the muscles of the lower leg, most prominently the gastrocnemius muscle. While traditional donkey calf raises involved either a specific machine or carrying another person on one's back, this method uses a weight belt. It can be done in traditional muscle-building rep ranges, or for higher reps as part of lower-body training.", + "body_part": "Calves", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0833.gif" + }, + { + "name": "Kettlebell plyo push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell plyo push-up is an explosive upper-body movement that uses a kettlebell primarily as a platform for the hands. A short step, dumbbell, or other stationary object could also be used in place of the kettlebell. It can be performed for reps or time, either for low reps to build explosive power or for higher reps for conditioning.", + "body_part": "Chest", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0545.gif" + }, + { + "name": "Incline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The hands-elevated push-up is a variation on the push-up, a body-weight standard. The hands are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0493.gif" + }, + { + "name": "Decline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The feet-elevated push-up is a variation on the push-up, a body-weight standard. The feet are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0279.gif" + }, + { + "name": "Isometric Wipers", + "type": "Strength", + "level": "Beginner", + "description": "The typewriter push-up is an advanced push-up variation where the hands are extra wide and you lower toward each hand in alternating reps. It is more challenging to each working arm than traditional push-ups and also stretches and challenges the chest.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0500.gif" + }, + { + "name": "Clock push-up", + "type": "Strength", + "level": "Beginner", + "description": "The clock push-up is a series of regular push-ups performed one at a time, moving your hands one step to the side between each one until you've completed a full circle. It targets the same muscles as traditional push-ups, such as the chest, triceps, and shoulders, but adds an endurance and core challenge to traditional push-ups.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0258.gif" + }, + { + "name": "Suspended push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended push-up is a bodyweight pushing exercise performed on a suspension strap system or gymnastic rings. It targets the chest, shoulders, and triceps, but is also challenging to the core and upper back. It can work in traditional strength and muscle-building rep ranges or for higher reps.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0806.gif" + }, + { + "name": "Diamond push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The diamond push-up is an advanced variation of the push-up exercise performed with the hands in a diamond shape. It increases the challenge to the triceps, but also targets the chest and shoulders.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0283.gif" + }, + { + "name": "Push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up is a popular bodyweight exercise that is commonly used in military and tactical physical fitness tests. It’s a classic movement to build upper-body muscle and strength, emphasizing the chest, triceps, and shoulders, but also working the upper back and core.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0662.gif" + }, + { + "name": "Medicine Ball Chest Pass", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The medicine ball pass is a simple partner-based exercise that involves throwing a weighted ball back-and-forth. It can be part of a dynamic warm-up for lifting or athletics, but can also work as active rest or as a component of circuit training.", + "body_part": "Chest", + "equipment": "Medicine Ball", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1302.gif" + }, + { + "name": "Dumbbell Bench Press", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell bench press is a mainstay of workout enthusiasts worldwide. It’s a classic move for building a bigger, stronger chest. As such, it’s often placed first in mass-building chest workouts.", + "body_part": "Chest", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0289.gif" + }, + { + "name": "Chest dip", + "type": "Strength", + "level": "Intermediate", + "description": "The chest dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the chest, triceps, and shoulders. Dips with a chest focus are usually performed with the torso leaning forward and the elbows angled out from the torso. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Chest", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0251.gif" + }, + { + "name": "Barbell glute bridge", + "type": "Powerlifting", + "level": "Intermediate", + "description": "The barbell glute bridge is a popular exercise targeting the muscles of the glutes and hamstrings. It can be done as a strength movement on its own, as an activation drill or warm-up for lower-body training, or as a burnout at the end of a lower-body workout.", + "body_part": "Glutes", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1409.gif" + }, + { + "name": "Kettlebell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell thruster is a popular kettlebell movement that combines a kettlebell front squat with a kettlebell press, while holding the bell in a goblet or bottoms-up grip. It is preceded by a clean at the start of each set, and you can perform a clean between each rep if you choose. It can be trained in traditional strength or muscle-building rep ranges, in circuit or fat-loss training, or as part of a larger kettlebell combination or complex.", + "body_part": "Glutes", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0550.gif" + }, + { + "name": "Walking lunge", + "type": "Strength", + "level": "Intermediate", + "description": "The walking lunge is a lower-body exercise that targets the glutes, quads, and hamstrings while challenging stability and balance. It can be performed for reps, time, or distance in the lower-body portion of any workout.", + "body_part": "Glutes", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1460.gif" + }, + { + "name": "Barbell Deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell deadlift is a compound exercise used to develop overall strength and size in the posterior chain. It is a competition lift in the sport of powerlifting, but is also considered a classic benchmark of overall strength. When performed with the hands outside the knees, it is often called a \"conventional\" deadlift. When the feet are wide and the hands are inside the knees, it is a sumo deadlift.", + "body_part": "Hamstrings", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0032.gif" + }, + { + "name": "Power clean", + "type": "Strength", + "level": "Intermediate", + "description": "The power clean is a full-body movement in which the bar is pulled from the floor and caught in the front rack position in three pulls or phases. The bar is received in the \"power\" position, with the hips higher than a full-depth squat position. The power clean can be used as a component of the clean and press or clean and jerk, but is also a valuable lift to build explosive power and strength.", + "body_part": "Hamstrings", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0648.gif" + }, + { + "name": "Inchworm", + "type": "Stretching", + "level": "Beginner", + "description": "The inchworm is a popular bodyweight exercise that involves “walking” the hands on the floor from a bent-over toe-touch position into a straight-arm plank. It is usually performed as part of a dynamic warm-up to help raise core body temperature and “limber up” the body from head to toe.", + "body_part": "Hamstrings", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1471.gif" + }, + { + "name": "Weighted pull-up", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted pull-up is a more advanced variation of the pull-up exercise in which the lifter adds extra weight to their body. Options for adding weight include a dip belt, weighted vest, chains, a dumbbell placed between the feet or legs, or looping a kettlebell over the foot. Like other pull-up variations, the weighted pull-up builds strength and muscle in the upper back, biceps, and core.", + "body_part": "Lats", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0841.gif" + }, + { + "name": "Pull-up", + "type": "Strength", + "level": "Beginner", + "description": "The pull-up is a multijoint bodyweight exercise that builds strength and muscle in the upper back, biceps, and core. It is often used as a measurement tool in military or tactical fitness tests, and is an excellent gauge of \"relative strength\" which is strength in relation to body weight.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0652.gif" + }, + { + "name": "Rope climb", + "type": "Strength", + "level": "Intermediate", + "description": "The rope climb is an exercise that is used commonly in CrossFit workouts and as a test of upper-body strength. It was even contested at the Olympics in the early 20th century. It targets a wide range of upper-body musculature, including the hands and forearms, shoulders, biceps, lats (latissimus dorsi), and core.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0680.gif" + }, + { + "name": "Chin-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The a chin-up is a variation of the pull-up exercise in which the reps are performed with the palms facing toward the body, in an underhand position, with a grip that is narrower than shoulder-width. Like other pull-up variations, it builds strength and muscle in the upper back, biceps, and core, but it utilizes the biceps slightly more than overhand pull-ups. It can be used as a more shoulder-friendly alternative to straight-bar pull-ups, or to help perform more reps than you can perform overhand.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1326.gif" + }, + { + "name": "Iron cross stretch", + "type": "Strength", + "level": "Intermediate", + "description": "The iron cross stretch is a bodyweight stretch that focuses on hip and thoracic spine mobility.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1419.gif" + }, + { + "name": "Barbell good morning", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell good morning is an exercise that targets glute, hamstring, and lower back development. It is often trained as an accessory movement to the deadlift, but also has value on its own. It is sometimes performed for reps in traditional strength-focused rep ranges such as 5-8 reps per set, but due to the risk posed to the lower back, is rarely treated as a max-effort single-rep lift.", + "body_part": "Lower Back", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0044.gif" + }, + { + "name": "Kettlebell alternating renegade row", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell alternating renegade row combines rowing and core training into a single difficult movement. It's popular in time-efficient strength and muscle-building workouts, as well as in circuit-style training.", + "body_part": "Middle Back", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0521.gif" + }, + { + "name": "Suspended row", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended row is a bodyweight pulling exercise that focuses on the muscles of the middle and upper back, as well as the biceps. It can be trained in traditional muscle-building rep ranges or for higher reps. It can also work as part of a dynamic warm-up for a pressing or pulling-focused workout.", + "body_part": "Middle Back", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0808.gif" + }, + { + "name": "Barbell shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell shrug is an exercise targeting the traps (trapezius muscles). It is popular in strength and muscle-focused upper-body training, and is often trained on a shoulder day. With the assistance of straps, it can be loaded heavily, but it is still usually performed for moderate to high reps, such as 8-10 reps per set.", + "body_part": "Traps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0095.gif" + }, + { + "name": "Cable shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The cable shrug is an exercise targeting the traps, as well as hitting the shoulders and upper back. Cables allow for lighter loading which is beneficial for higher-rep sets.", + "body_part": "Traps", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0220.gif" + }, + { + "name": "Barbell Full Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell back squat is a popular compound movement that emphasizes building the lower-body muscle groups and overall strength. It's the classic way to start a leg day, and is a worthy centerpiece to a lower-body training program. The squat is a competitive lift in the sport of powerlifting, but is also a classic measurement of lower-body strength. With the barbell racked on the traps or upper back, the emphasis is placed on the posterior chain but the entire body gets worked. The back squat can be trained in everything from heavy singles to sets of 20 reps or higher.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0043.gif" + }, + { + "name": "Barbell front squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front squat is a compound movement that emphasizes building the lower-body muscle groups. With the barbell racked in front of the body on the anterior delts, the front squat emphasizes the quads and glutes, but also upper back and core strength to remain upright. Front squats can be trained as an alternative to back squats, as an accessory movement for either squats or deadlifts, or for strength and muscle on their own. Many lifters and athletes prefer them to back squats, although they can be uncomfortable and difficult to learn at first.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0042.gif" + }, + { + "name": "Barbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0114.gif" + }, + { + "name": "Barbell hack squat", + "type": "Strength", + "level": "Expert", + "description": "The barbell hack squat is a variety of deadlift performed with the barbell behind the legs. This forces the lifter into a body position similar to a squat and targets the quads and glutes. It is named after famed strongman George Hackenschmidt, who performed it as an overall leg-building exercise. The barbell hack squat can be used as a substitute for the machine hack squat, or as a lower-body strength and size movement on its own.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0046.gif" + }, + { + "name": "Barbell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell thruster is a full-body exercise that incorporates both squatting and pressing in one functional movement. It's especially common in contemporary CrossFit workouts, but also in general strength training. The barbell is usually cleaned into place first, but it could be performed taken from a squat rack in a front-rack position. The thruster can be performed in traditional strength-focused rep ranges to build strength in the press, or in higher reps for full-body conditioning.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3305.gif" + }, + { + "name": "Barbell side split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell side split squat is a variation of the split squat that targets the lower body, specifically the quads, and requires good hip mobility.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0098.gif" + }, + { + "name": "Barbell speed squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell speed squat targets the lower-body muscle groups using lighter weights to perform fast-paced back squats. Speed squats are popular in certain powerlifting training methodologies as a way to engrain form and lifting speed that can carry over to max-effort lifts. In this approach, they are usually performed in numerous sets of 3-5 reps with adequate rest in between. Speed squats are also sometimes performed with bands or chains adding extra resistance to the top half of the lift.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0101.gif" + }, + { + "name": "Dumbbell Goblet Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The goblet squat is a common exercise used in the early stages of learning to squat, or as a movement in general training programs for building size to the quads, glutes, and hamstrings.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1760.gif" + }, + { + "name": "Dumbbell squat", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell squat is a classic lower-body exercise that targets the quadriceps, hamstrings, and glutes. While this variation is usually performed with relatively light weights for high reps, it can also be used as a substitute for squats or the trap-bar deadlift in any workout.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0413.gif" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0431.gif" + }, + { + "name": "Dumbbell deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell deadlift is a movement that targets the hamstrings, glutes, and back muscles. While it can be performed all the way from the ground, in the style of a barbell deadlift, it is more often performed from the top down as a Romanian deadlift. The dumbbell deadlift can be performed in low rep ranges to build posterior strength, or for moderate to high reps to build muscle and endurance.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0300.gif" + }, + { + "name": "Tire flip", + "type": "Strongman", + "level": "Intermediate", + "description": "The tire flip is an exercise that works the entire body, starting from a deadlift position and ending with a giant tire being flipped over. Each flip moves the tire farther in one direction until a set has been completed. It can be performed for time or reps as part of a functional fitness or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/2459.gif" + }, + { + "name": "Weighted sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted sissy squat is an exercise primarily targeting the quadriceps. In sissy squats, the knees travel over the toes, placing the quads under a fairly extreme stretch. They are usually performed for moderate to high reps as part of a lower-body training session.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0851.gif" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0431.gif" + }, + { + "name": "Suspended split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended split squat is a single-leg squat variation performed with the rear leg in a suspension strap system. This allows the rear leg to move slightly more naturally than it would be able to on a bench. The exercise targets the quads, hamstring, and glute muscles on the front leg, but also taxes and stretches the quads on the rear leg.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0809.gif" + }, + { + "name": "Burpee", + "type": "Cardio", + "level": "Intermediate", + "description": "The burpee is a high-intensity exercise that recruits the entire body to build strength and aerobic capacity. It is common in CrossFit workouts and group fitness classes, but can also be performed for time or reps in any fat-loss or athleticism-focused circuit or workout.", + "body_part": "Quadriceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1160.gif" + }, + { + "name": "Jump Squat", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The jump squat is an explosive bodyweight exercise targeting the quads, hamstrings, and glutes. It is also a serious cardiovascular challenge when done for reps. It can be performed as a power exercise to build jumping power, or in any fat-loss or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0514.gif" + }, + { + "name": "Sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The sissy squat is a bodyweight squat variation that involves letting the knees travel far over the toes, placing an extreme stretch on the quads. This movement targets the quad muscles directly and can be performed in partial or full ranges of motion based on knee health and pain.", + "body_part": "Quadriceps", + "equipment": "None", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1489.gif" + }, + { + "name": "Band shoulder press", + "type": "Strength", + "level": "Intermediate", + "description": "The band shoulder press is a deltoid exercise and an alternative to the classic dumbbell shoulder press. The dynamic tension of the band forces the core to stabilize the body and more closely matches the strength curve of the shoulder press. It can be performed in low reps, such as 5-8 reps per set, to build shoulder strength, or for higher reps to build muscle and for conditioning. It can work as the main focus of a shoulder day but is also popular as an accessory movement to the bench press or barbell military press.", + "body_part": "Shoulders", + "equipment": "Bands", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0997.gif" + }, + { + "name": "Barbell upright row", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell upright row is a barbell exercise that builds stronger and bigger traps. Many lifters combine this move with either their back or shoulder workout since it involves both body parts.", + "body_part": "Shoulders", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0120.gif" + }, + { + "name": "Barbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front raise is an upper-body isolation exercise that targets the shoulders. It is usually performed for moderate to high reps, such as 8-12 reps or higher, as part of the shoulder-focused part of any workout.", + "body_part": "Shoulders", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0041.gif" + }, + { + "name": "Dumbbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell front raise is a single-joint exercise targeting the shoulder muscles, particularly the front or anterior deltoids. It is usually performed for moderate to high reps, at least 8-12 reps per set, as part of an upper-body or shoulder-focused workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0310.gif" + }, + { + "name": "Dumbbell Lying Rear Lateral Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The incline dumbbell reverse fly is an upper-body exercise targeting the posterior or rear deltoids, as well as the postural muscles of the upper back. Because it targets such small muscles, this exercise is usually performed with light weight for high reps, such as 10-15 reps per set or more.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0348.gif" + }, + { + "name": "Dumbbell lateral raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell lateral raise is a shoulder exercise that targets the medial or middle head of the deltoid muscle. It's a staple strength-training move and is a great option for accessory work on upper-body training days. It is usually performed for moderate to high reps, at least 8-12 reps, as part of the upper-body or shoulder-focused portion of a workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0334.gif" + }, + { + "name": "Cable seated row", + "type": "Strength", + "level": "Intermediate", + "description": "The cable seated row is a popular exercise to train the muscles of the upper back, including the lats (latissimus dorsi), traps, rhomboids, and rear deltoids, using a cable stack. It also targets the biceps to a lesser degree. The cable row can work well in a variety of rep ranges but is most popular in muscle-building workouts or as an accessory movement for strength workouts.", + "body_part": "Shoulders", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0861.gif" + }, + { + "name": "Handstand push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The handstand push-up is an exercise targeting the shoulders, although other muscles assist in the completion of the reps. It is common in both CrossFit workouts and advanced bodyweight or calisthenics training. Given the degree of difficulty, beginners will need to progress to this move.", + "body_part": "Shoulders", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0471.gif" + }, + { + "name": "Triceps dip", + "type": "Strength", + "level": "Intermediate", + "description": "The triceps dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the triceps first, but also stretches and strengthens the chest and shoulders. Dips with a triceps focus are usually performed with an upright torso, the knees bent and crossed, and the arms close to the body. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Triceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0814.gif" + }, + { + "name": "Weighted bench dip", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted bench dip is a highly effective exercise for building the triceps. The resistance comes from a combination of body weight and added weight—usually a weight plate.", + "body_part": "Triceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0830.gif" + } +] \ No newline at end of file diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 7b58665..8146901 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -1,107 +1,13 @@ -# Script for populating the database. You can run it as: -# -# mix run priv/repo/seeds.exs -# -# Inside the script, you can read and write to any of your -# repositories directly: -# -# Fitness.Repo.insert!(%Fitness.SomeSchema{}) -# -# We recommend using the bang functions (`insert!`, `update!` -# and so on) as they will fail if something goes wrong. - -alias Fitness.Exercises -alias Fitness.Accounts +# Script to generate workout templates from JSON exercise data +# Run with: mix run priv/repo/workout_templates_generator.exs + alias Fitness.Repo +alias Fitness.Accounts alias Fitness.Exercises.Exercise alias Fitness.WorkoutTemplates.WorkoutTemplate alias Fitness.WorkoutTemplates.WorkoutItem -File.read!("priv/repo/list_of_exercises.txt") -|> :erlang.binary_to_term() -|> Enum.uniq() -|> Enum.each(fn workout -> Exercises.create_exercise(workout) end) - -Accounts.register_user(%{ - email: "test@test.com", - password: "test@test.com", - is_admin: true, - username: "Admin001", - name: "Admin" -}) - -Accounts.register_user(%{ - email: "test@test1.com", - password: "mak12345", - is_admin: false, - username: "puppies-lover", - name: "Andervrs", - player_score: "1001" -}) - -Accounts.register_user(%{ - email: "test@test2.com", - password: "mak12345", - is_admin: false, - username: "Full-stack-developer", - name: "Alfred", - player_score: "800" -}) - -Accounts.register_user(%{ - email: "test@test3.com", - password: "mak12345", - is_admin: false, - username: "Captain-America", - name: "john", - player_score: "1000" -}) - -Accounts.register_user(%{ - email: "test@test4.com", - password: "mak12345", - is_admin: false, - username: "Rhythm-Rider", - name: "Einer", - player_score: "700" -}) - -Accounts.register_user(%{ - email: "test@test5.com", - password: "mak12345", - is_admin: false, - username: "Richie-Rich", - name: "yusef", - player_score: "900" -}) - -Accounts.register_user(%{ - email: "test@test6.com", - password: "mak12345", - is_admin: false, - username: "The-Label-Man", - name: "eddie", - player_score: "10000" -}) - -Accounts.register_user(%{ - email: "test@test7.com", - password: "mak12345", - is_admin: false, - username: "The-Wizard", - name: "brook", - player_score: "5000" -}) - -Accounts.register_user(%{ - email: "test@test8.com", - password: "mak12345", - is_admin: false, - username: "Albert-Einstein", - name: "steve", - player_score: "600" -}) - +# Create users or get existing ones {:ok, user1} = Accounts.register_user(%{ email: "test@test9.com", @@ -122,329 +28,142 @@ Accounts.register_user(%{ player_score: "2000" }) -# Create exercises -exercises = %{ - # Chest exercises - "bench_press" => - Repo.insert!(%Exercise{ - name: "Barbell Bench Press", - description: "A compound exercise that targets the chest, shoulders, and triceps", - gif_url: "https://example.com/bench-press.gif", - level: "beginner", - type: "strength", - equipment: "barbell", - body_part: "chest" - }), - "incline_press" => - Repo.insert!(%Exercise{ - name: "Incline Dumbbell Press", - description: "Targets the upper chest with an angled press", - gif_url: "https://example.com/incline-press.gif", - level: "beginner", - type: "strength", - equipment: "dumbbell", - body_part: "chest" - }), - "chest_fly" => - Repo.insert!(%Exercise{ - name: "Dumbbell Chest Fly", - description: "An isolation exercise for the chest", - gif_url: "https://example.com/chest-fly.gif", - level: "intermediate", - type: "isolation", - equipment: "dumbbell", - body_part: "chest" - }), - - # Back exercises - "pull_up" => - Repo.insert!(%Exercise{ - name: "Pull-up", - description: "A compound exercise that targets the back and biceps", - gif_url: "https://example.com/pullup.gif", - level: "intermediate", - type: "strength", - equipment: "bodyweight", - body_part: "back" - }), - "bent_row" => - Repo.insert!(%Exercise{ - name: "Bent Over Row", - description: "A compound pulling exercise for back thickness", - gif_url: "https://example.com/bent-row.gif", - level: "beginner", - type: "strength", - equipment: "barbell", - body_part: "back" - }), - "lat_pulldown" => - Repo.insert!(%Exercise{ - name: "Lat Pulldown", - description: "A machine exercise targeting the latissimus dorsi", - gif_url: "https://example.com/lat-pulldown.gif", - level: "beginner", - type: "strength", - equipment: "cable", - body_part: "back" - }), - "face_pull" => - Repo.insert!(%Exercise{ - name: "Face Pull", - description: "An exercise that targets the rear deltoids and upper back", - gif_url: "https://example.com/face-pull.gif", - level: "beginner", - type: "isolation", - equipment: "cable", - body_part: "back" - }), - - # Shoulder exercises - "overhead_press" => - Repo.insert!(%Exercise{ - name: "Overhead Press", - description: "A compound exercise for the shoulders and triceps", - gif_url: "https://example.com/overhead-press.gif", - level: "intermediate", - type: "strength", - equipment: "barbell", - body_part: "shoulders" - }), - "lateral_raise" => - Repo.insert!(%Exercise{ - name: "Lateral Raise", - description: "An isolation exercise for the lateral deltoids", - gif_url: "https://example.com/lateral-raise.gif", - level: "beginner", - type: "isolation", - equipment: "dumbbell", - body_part: "shoulders" - }), - - # Arms exercises - "bicep_curl" => - Repo.insert!(%Exercise{ - name: "Bicep Curl", - description: "An isolation exercise for the biceps", - gif_url: "https://example.com/bicep-curl.gif", - level: "beginner", - type: "isolation", - equipment: "dumbbell", - body_part: "arms" - }), - "hammer_curl" => - Repo.insert!(%Exercise{ - name: "Hammer Curl", - description: "Targets the brachialis and brachioradialis muscles", - gif_url: "https://example.com/hammer-curl.gif", - level: "beginner", - type: "isolation", - equipment: "dumbbell", - body_part: "arms" - }), - "tricep_extension" => - Repo.insert!(%Exercise{ - name: "Tricep Extension", - description: "An isolation exercise for the triceps", - gif_url: "https://example.com/tricep-extension.gif", - level: "beginner", - type: "isolation", - equipment: "cable", - body_part: "arms" - }), - "skull_crusher" => - Repo.insert!(%Exercise{ - name: "Skull Crusher", - description: "A lying tricep extension exercise", - gif_url: "https://example.com/skull-crusher.gif", - level: "intermediate", - type: "isolation", - equipment: "barbell", - body_part: "arms" - }), - - # Leg exercises - "squat" => - Repo.insert!(%Exercise{ - name: "Squat", - description: "A compound exercise that targets the quadriceps, hamstrings, and glutes", - gif_url: "https://example.com/squat.gif", - level: "beginner", - type: "strength", - equipment: "barbell", - body_part: "legs" - }), - "deadlift" => - Repo.insert!(%Exercise{ - name: "Deadlift", - description: "A compound exercise that targets the back, glutes, and hamstrings", - gif_url: "https://example.com/deadlift.gif", - level: "intermediate", - type: "strength", - equipment: "barbell", - body_part: "legs" - }), - "leg_press" => - Repo.insert!(%Exercise{ - name: "Leg Press", - description: "A machine compound exercise for the lower body", - gif_url: "https://example.com/leg-press.gif", - level: "beginner", - type: "strength", - equipment: "machine", - body_part: "legs" - }), - "romanian_deadlift" => - Repo.insert!(%Exercise{ - name: "Romanian Deadlift", - description: "A hip-hinge movement targeting the hamstrings and glutes", - gif_url: "https://example.com/romanian-deadlift.gif", - level: "intermediate", - type: "strength", - equipment: "barbell", - body_part: "legs" - }), - "leg_curl" => - Repo.insert!(%Exercise{ - name: "Leg Curl", - description: "An isolation exercise for the hamstrings", - gif_url: "https://example.com/leg-curl.gif", - level: "beginner", - type: "isolation", - equipment: "machine", - body_part: "legs" - }), - "calf_raise" => - Repo.insert!(%Exercise{ - name: "Calf Raise", - description: "An isolation exercise for the calves", - gif_url: "https://example.com/calf-raise.gif", - level: "beginner", - type: "isolation", - equipment: "machine", - body_part: "legs" - }), - - # Core exercises - "ab_crunch" => - Repo.insert!(%Exercise{ - name: "Ab Crunch", - description: "A basic abdominal exercise", - gif_url: "https://example.com/ab-crunch.gif", - level: "beginner", - type: "isolation", - equipment: "bodyweight", - body_part: "core" - }), - "leg_raise" => - Repo.insert!(%Exercise{ - name: "Hanging Leg Raise", - description: "An advanced core exercise", - gif_url: "https://example.com/hanging-leg-raise.gif", - level: "advanced", - type: "isolation", - equipment: "bodyweight", - body_part: "core" - }) -} - -# ==================== PUSH/PULL/LEGS SPLIT ==================== +# Parse the JSON exercise data +exercise_data = File.read!("priv/repo/exercises.json") +|> Jason.decode!() + +# Create all exercises from the JSON data and build a map for easy lookup +exercises_map = %{} +exercises_map = Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> + # Create a unique key for each exercise + key = exercise_json["name"] + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + # Create the exercise in the database + exercise = Repo.insert!(%Exercise{ + name: exercise_json["name"], + description: exercise_json["description"], + gif_url: exercise_json["gif_url"], + level: String.downcase(exercise_json["level"]), + type: String.downcase(exercise_json["type"]), + equipment: String.downcase(exercise_json["equipment"]), + body_part: String.downcase(exercise_json["body_part"]) + }) + + # Add the exercise to our map + Map.put(acc, key, exercise) +end) + +# Helper function to get exercise by name +get_exercise = fn name -> + key = name + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + Map.get(exercises_map, key) +end + +# ==================== 1. PUSH/PULL/LEGS SPLIT ==================== # Push Day (Chest, Shoulders, Triceps) push_template = Repo.insert!(%WorkoutTemplate{ - name: "Push Day", + name: "Push Day (Chest, Shoulders, Triceps)", user_id: user1.id, is_finished: false, workout_template_score: 0 }) +# Add exercises to the push day template Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 80.0, + sets: 1, + weight: 25.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["bench_press"].id, + exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 20.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, - exercise_id: exercises["incline_press"].id, + exercise_id: get_exercise.("push-up").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 12.0, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 10, check_box: false, - exercise_id: exercises["chest_fly"].id, + exercise_id: get_exercise.("chest dip").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ sets: 4, - weight: 40.0, + weight: 15.0, weight_unit: "kg", - reps: 8, + reps: 10, check_box: false, - exercise_id: exercises["overhead_press"].id, + exercise_id: get_exercise.("band shoulder press").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 10.0, + sets: 5, + weight: 8.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["lateral_raise"].id, + exercise_id: get_exercise.("dumbbell lateral raise").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 25.0, + sets: 6, + weight: 0.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: exercises["skull_crusher"].id, + exercise_id: get_exercise.("triceps dip").id, workout_template_id: push_template.id }) -# Pull Day (Back, Biceps) +# Pull Day (Back and Biceps) pull_template = Repo.insert!(%WorkoutTemplate{ - name: "Pull Day", + name: "Pull Day (Back & Biceps)", user_id: user1.id, is_finished: false, workout_template_score: 0 }) +# Add exercises to the pull day template Repo.insert!(%WorkoutItem{ - sets: 4, - # Bodyweight + sets: 1, weight: 0.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["pull_up"].id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: pull_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 60.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 8, check_box: false, - exercise_id: exercises["bent_row"].id, + exercise_id: get_exercise.("chin-up").id, workout_template_id: pull_template.id }) @@ -452,115 +171,115 @@ Repo.insert!(%WorkoutItem{ sets: 3, weight: 50.0, weight_unit: "kg", - reps: 12, + reps: 10, check_box: false, - exercise_id: exercises["lat_pulldown"].id, + exercise_id: get_exercise.("cable seated row").id, workout_template_id: pull_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 20.0, + sets: 4, + weight: 50.0, weight_unit: "kg", - reps: 15, + reps: 12, check_box: false, - exercise_id: exercises["face_pull"].id, + exercise_id: get_exercise.("barbell shrug").id, workout_template_id: pull_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, + sets: 5, + weight: 12.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, - exercise_id: exercises["bicep_curl"].id, + exercise_id: get_exercise.("dumbbell biceps curl").id, workout_template_id: pull_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, + sets: 6, + weight: 20.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: exercises["hammer_curl"].id, + exercise_id: get_exercise.("barbell curl").id, workout_template_id: pull_template.id }) # Leg Day leg_template = Repo.insert!(%WorkoutTemplate{ - name: "Leg Day", + name: "Leg Day (Quads, Hamstrings, Glutes)", user_id: user1.id, is_finished: false, workout_template_score: 0 }) +# Add exercises to the leg day template Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 100.0, + sets: 1, + weight: 80.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["squat"].id, + exercise_id: get_exercise.("barbell full squat").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 120.0, + sets: 2, + weight: 100.0, weight_unit: "kg", - reps: 10, + reps: 6, check_box: false, - exercise_id: exercises["leg_press"].id, + exercise_id: get_exercise.("barbell deadlift").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 80.0, + weight: 20.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, - exercise_id: exercises["romanian_deadlift"].id, + exercise_id: get_exercise.("dumbbell goblet squat").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 40.0, + sets: 4, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 20, check_box: false, - exercise_id: exercises["leg_curl"].id, + exercise_id: get_exercise.("walking lunge").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 100.0, + sets: 5, + weight: 60.0, weight_unit: "kg", - reps: 15, + reps: 12, check_box: false, - exercise_id: exercises["calf_raise"].id, + exercise_id: get_exercise.("barbell glute bridge").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - # Bodyweight - weight: 0.0, + sets: 6, + weight: 40.0, weight_unit: "kg", reps: 15, check_box: false, - exercise_id: exercises["ab_crunch"].id, + exercise_id: get_exercise.("weighted donkey calf raise").id, workout_template_id: leg_template.id }) -# ==================== UPPER/LOWER SPLIT ==================== +# ==================== 2. UPPER/LOWER SPLIT ==================== -# Upper Body Day +# Upper Body Workout upper_template = Repo.insert!(%WorkoutTemplate{ name: "Upper Body Day", @@ -569,67 +288,78 @@ upper_template = workout_template_score: 0 }) +# Add exercises to upper body template Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 75.0, + sets: 1, + weight: 25.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["bench_press"].id, + exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 70.0, + sets: 2, + weight: 0.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["bent_row"].id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 45.0, + weight: 15.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: exercises["overhead_press"].id, + exercise_id: get_exercise.("band shoulder press").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 60.0, + sets: 4, + weight: 50.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: exercises["lat_pulldown"].id, + exercise_id: get_exercise.("cable seated row").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, + sets: 5, + weight: 8.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["bicep_curl"].id, + exercise_id: get_exercise.("dumbbell lateral raise").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 25.0, + sets: 6, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 7, + weight: 20.0, + weight_unit: "kg", + reps: 10, check_box: false, - exercise_id: exercises["tricep_extension"].id, + exercise_id: get_exercise.("barbell curl").id, workout_template_id: upper_template.id }) -# Lower Body Day +# Lower Body Workout lower_template = Repo.insert!(%WorkoutTemplate{ name: "Lower Body Day", @@ -638,165 +368,469 @@ lower_template = workout_template_score: 0 }) +# Add exercises to lower body template Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 110.0, + sets: 1, + weight: 80.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["squat"].id, + exercise_id: get_exercise.("barbell full squat").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 130.0, + sets: 2, + weight: 100.0, weight_unit: "kg", reps: 6, check_box: false, - exercise_id: exercises["deadlift"].id, + exercise_id: get_exercise.("barbell deadlift").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 140.0, + weight: 60.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 30.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["leg_press"].id, + exercise_id: get_exercise.("barbell step-up").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 50.0, + sets: 5, + weight: 60.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["leg_curl"].id, + exercise_id: get_exercise.("barbell glute bridge").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 80.0, + sets: 6, + weight: 40.0, weight_unit: "kg", reps: 15, check_box: false, - exercise_id: exercises["calf_raise"].id, + exercise_id: get_exercise.("weighted donkey calf raise").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, + sets: 7, weight: 0.0, weight_unit: "kg", - reps: 15, + reps: 12, check_box: false, - exercise_id: exercises["leg_raise"].id, + exercise_id: get_exercise.("hanging leg raise").id, workout_template_id: lower_template.id }) -# ==================== BRO SPLIT ==================== +# ==================== 3. FULL BODY WORKOUT ==================== + +full_body_template = + Repo.insert!(%WorkoutTemplate{ + name: "Full Body Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Add exercises to full body template +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 6, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 7, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 8, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: full_body_template.id +}) + +# ==================== 4. BRO SPLIT ==================== # Chest Day chest_template = Repo.insert!(%WorkoutTemplate{ - name: "Chest Day", + name: "Chest Day (Bro Split)", user_id: user2.id, is_finished: false, workout_template_score: 0 }) +# Add exercises to chest day template Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 85.0, + sets: 1, + weight: 25.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["bench_press"].id, + exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: chest_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 25.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, - exercise_id: exercises["incline_press"].id, + exercise_id: get_exercise.("push-up").id, workout_template_id: chest_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 15.0, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["chest_fly"].id, + exercise_id: get_exercise.("decline push-up").id, workout_template_id: chest_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 25.0, + sets: 5, + weight: 0.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["tricep_extension"].id, + exercise_id: get_exercise.("incline push-up").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 6, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("suspended push-up").id, workout_template_id: chest_template.id }) # Back Day back_template = Repo.insert!(%WorkoutTemplate{ - name: "Back Day", + name: "Back Day (Bro Split)", user_id: user2.id, is_finished: false, workout_template_score: 0 }) +# Add exercises to back day template Repo.insert!(%WorkoutItem{ - sets: 4, - # Bodyweight + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 0.0, weight_unit: "kg", reps: 8, check_box: false, - exercise_id: exercises["pull_up"].id, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ sets: 4, - weight: 65.0, + weight: 0.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: exercises["bent_row"].id, + exercise_id: get_exercise.("suspended row").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 55.0, + sets: 5, + weight: 50.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["lat_pulldown"].id, + exercise_id: get_exercise.("barbell shrug").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, + sets: 6, + weight: 10.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: exercises["bicep_curl"].id, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, workout_template_id: back_template.id }) -IO.puts("Database seeded successfully with popular workout splits!") +# Arms Day +arms_template = + Repo.insert!(%WorkoutTemplate{ + name: "Arms Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Add exercises to arms day template +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("weighted bench dip").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 6, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id +}) + +# ==================== 5. FUNCTIONAL FITNESS WORKOUT ==================== + +functional_template = + Repo.insert!(%WorkoutTemplate{ + name: "Functional Fitness Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Add exercises to functional fitness template +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 6, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 7, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 8, + weight: 10.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id +}) + +IO.puts("Successfully created 5 workout templates with all exercises from the provided JSON data") From ece94ac334a9fc98580cbaf8d545d52d7e0b72ba Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 13:37:46 -0400 Subject: [PATCH 11/22] update --- priv/repo/seeds.exs | 949 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 804 insertions(+), 145 deletions(-) diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 8146901..5315fa6 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -29,39 +29,46 @@ alias Fitness.WorkoutTemplates.WorkoutItem }) # Parse the JSON exercise data -exercise_data = File.read!("priv/repo/exercises.json") -|> Jason.decode!() +exercise_data = + File.read!("priv/repo/exercises.json") + |> Jason.decode!() # Create all exercises from the JSON data and build a map for easy lookup exercises_map = %{} -exercises_map = Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> - # Create a unique key for each exercise - key = exercise_json["name"] - |> String.downcase() - |> String.replace(~r/[^a-z0-9]+/, "_") - |> String.trim("_") - - # Create the exercise in the database - exercise = Repo.insert!(%Exercise{ - name: exercise_json["name"], - description: exercise_json["description"], - gif_url: exercise_json["gif_url"], - level: String.downcase(exercise_json["level"]), - type: String.downcase(exercise_json["type"]), - equipment: String.downcase(exercise_json["equipment"]), - body_part: String.downcase(exercise_json["body_part"]) - }) - # Add the exercise to our map - Map.put(acc, key, exercise) -end) +exercises_map = + Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> + # Create a unique key for each exercise + key = + exercise_json["name"] + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + # Create the exercise in the database + exercise = + Repo.insert!(%Exercise{ + name: exercise_json["name"], + description: exercise_json["description"], + gif_url: exercise_json["gif_url"], + level: String.downcase(exercise_json["level"]), + type: String.downcase(exercise_json["type"]), + equipment: String.downcase(exercise_json["equipment"]), + body_part: String.downcase(exercise_json["body_part"]) + }) + + # Add the exercise to our map + Map.put(acc, key, exercise) + end) # Helper function to get exercise by name get_exercise = fn name -> - key = name - |> String.downcase() - |> String.replace(~r/[^a-z0-9]+/, "_") - |> String.trim("_") + key = + name + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + Map.get(exercises_map, key) end @@ -76,9 +83,19 @@ push_template = workout_template_score: 0 }) -# Add exercises to the push day template +# Multiple sets of bench press with pyramid weights Repo.insert!(%WorkoutItem{ sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 25.0, weight_unit: "kg", reps: 8, @@ -87,6 +104,27 @@ Repo.insert!(%WorkoutItem{ workout_template_id: push_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id +}) + +# Multiple sets of push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: push_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 2, weight: 0.0, @@ -97,28 +135,30 @@ Repo.insert!(%WorkoutItem{ workout_template_id: push_template.id }) +# Multiple sets of overhead press Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, + sets: 1, + weight: 12.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("chest dip").id, + exercise_id: get_exercise.("band shoulder press").id, workout_template_id: push_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 2, weight: 15.0, weight_unit: "kg", - reps: 10, + reps: 8, check_box: false, exercise_id: get_exercise.("band shoulder press").id, workout_template_id: push_template.id }) +# Multiple sets of lateral raises Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 1, weight: 8.0, weight_unit: "kg", reps: 12, @@ -128,7 +168,28 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 2, + weight: 6.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell lateral raise").id, + workout_template_id: push_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 0.0, weight_unit: "kg", reps: 10, @@ -146,12 +207,12 @@ pull_template = workout_template_score: 0 }) -# Add exercises to the pull day template +# Multiple sets of pull-ups Repo.insert!(%WorkoutItem{ sets: 1, weight: 0.0, weight_unit: "kg", - reps: 8, + reps: 10, check_box: false, exercise_id: get_exercise.("pull-up").id, workout_template_id: pull_template.id @@ -163,12 +224,33 @@ Repo.insert!(%WorkoutItem{ weight_unit: "kg", reps: 8, check_box: false, - exercise_id: get_exercise.("chin-up").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: pull_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id +}) + +# Multiple sets of seated rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 50.0, weight_unit: "kg", reps: 10, @@ -178,7 +260,28 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 3, + weight: 55.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id +}) + +# Multiple sets of barbell shrugs +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 50.0, weight_unit: "kg", reps: 12, @@ -187,8 +290,19 @@ Repo.insert!(%WorkoutItem{ workout_template_id: pull_template.id }) +# Multiple sets of bicep curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id +}) + Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 2, weight: 12.0, weight_unit: "kg", reps: 12, @@ -198,12 +312,12 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 6, - weight: 20.0, + sets: 3, + weight: 15.0, weight_unit: "kg", - reps: 10, + reps: 8, check_box: false, - exercise_id: get_exercise.("barbell curl").id, + exercise_id: get_exercise.("dumbbell biceps curl").id, workout_template_id: pull_template.id }) @@ -216,17 +330,58 @@ leg_template = workout_template_score: 0 }) -# Add exercises to the leg day template +# Multiple sets of squats Repo.insert!(%WorkoutItem{ sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 80.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", reps: 8, check_box: false, exercise_id: get_exercise.("barbell full squat").id, workout_template_id: leg_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +# Multiple sets of deadlifts +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 2, weight: 100.0, @@ -239,16 +394,17 @@ Repo.insert!(%WorkoutItem{ Repo.insert!(%WorkoutItem{ sets: 3, - weight: 20.0, + weight: 120.0, weight_unit: "kg", - reps: 12, + reps: 4, check_box: false, - exercise_id: get_exercise.("dumbbell goblet squat").id, + exercise_id: get_exercise.("barbell deadlift").id, workout_template_id: leg_template.id }) +# Multiple sets of walking lunges Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 20, @@ -258,17 +414,28 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 60.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 20, check_box: false, - exercise_id: get_exercise.("barbell glute bridge").id, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: leg_template.id +}) + +# Multiple sets of calf raises +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 30.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, workout_template_id: leg_template.id }) Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 2, weight: 40.0, weight_unit: "kg", reps: 15, @@ -277,6 +444,16 @@ Repo.insert!(%WorkoutItem{ workout_template_id: leg_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id +}) + # ==================== 2. UPPER/LOWER SPLIT ==================== # Upper Body Workout @@ -288,19 +465,40 @@ upper_template = workout_template_score: 0 }) -# Add exercises to upper body template +# Multiple sets of bench press Repo.insert!(%WorkoutItem{ sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 25.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", reps: 8, check_box: false, exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: upper_template.id }) +# Multiple sets of pull-ups Repo.insert!(%WorkoutItem{ - sets: 2, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 8, @@ -310,75 +508,139 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 8, check_box: false, - exercise_id: get_exercise.("band shoulder press").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 50.0, + sets: 3, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 8, check_box: false, - exercise_id: get_exercise.("cable seated row").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: upper_template.id }) +# Multiple sets of shoulder press Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 8.0, + sets: 1, + weight: 12.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: get_exercise.("dumbbell lateral raise").id, + exercise_id: get_exercise.("band shoulder press").id, workout_template_id: upper_template.id }) Repo.insert!(%WorkoutItem{ - sets: 6, - weight: 0.0, + sets: 2, + weight: 15.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("triceps dip").id, + exercise_id: get_exercise.("band shoulder press").id, workout_template_id: upper_template.id }) +# Multiple sets of bicep curls Repo.insert!(%WorkoutItem{ - sets: 7, - weight: 20.0, + sets: 1, + weight: 15.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, exercise_id: get_exercise.("barbell curl").id, workout_template_id: upper_template.id }) -# Lower Body Workout -lower_template = - Repo.insert!(%WorkoutTemplate{ - name: "Lower Body Day", - user_id: user2.id, +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: upper_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id +}) + +# Lower Body Workout +lower_template = + Repo.insert!(%WorkoutTemplate{ + name: "Lower Body Day", + user_id: user2.id, is_finished: false, workout_template_score: 0 }) -# Add exercises to lower body template +# Multiple sets of squats Repo.insert!(%WorkoutItem{ sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 80.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", reps: 8, check_box: false, exercise_id: get_exercise.("barbell full squat").id, workout_template_id: lower_template.id }) +# Multiple sets of deadlifts +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 2, weight: 100.0, @@ -391,6 +653,27 @@ Repo.insert!(%WorkoutItem{ Repo.insert!(%WorkoutItem{ sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id +}) + +# Multiple sets of front squats +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 60.0, weight_unit: "kg", reps: 10, @@ -399,41 +682,43 @@ Repo.insert!(%WorkoutItem{ workout_template_id: lower_template.id }) +# Multiple sets of lunges Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 30.0, + sets: 1, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 20, check_box: false, - exercise_id: get_exercise.("barbell step-up").id, + exercise_id: get_exercise.("walking lunge").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 60.0, + sets: 2, + weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 20, check_box: false, - exercise_id: get_exercise.("barbell glute bridge").id, + exercise_id: get_exercise.("walking lunge").id, workout_template_id: lower_template.id }) +# Core exercises Repo.insert!(%WorkoutItem{ - sets: 6, - weight: 40.0, + sets: 1, + weight: 0.0, weight_unit: "kg", reps: 15, check_box: false, - exercise_id: get_exercise.("weighted donkey calf raise").id, + exercise_id: get_exercise.("hanging leg raise").id, workout_template_id: lower_template.id }) Repo.insert!(%WorkoutItem{ - sets: 7, + sets: 2, weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 15, check_box: false, exercise_id: get_exercise.("hanging leg raise").id, workout_template_id: lower_template.id @@ -449,22 +734,53 @@ full_body_template = workout_template_score: 0 }) -# Add exercises to full body template +# Multiple sets of squats Repo.insert!(%WorkoutItem{ sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 80.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", reps: 8, check_box: false, exercise_id: get_exercise.("barbell full squat").id, workout_template_id: full_body_template.id }) +# Multiple sets of bench press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 2, weight: 25.0, weight_unit: "kg", - reps: 8, + reps: 10, check_box: false, exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: full_body_template.id @@ -472,26 +788,27 @@ Repo.insert!(%WorkoutItem{ Repo.insert!(%WorkoutItem{ sets: 3, - weight: 90.0, + weight: 30.0, weight_unit: "kg", - reps: 6, + reps: 8, check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, + exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: full_body_template.id }) +# Multiple sets of pull-ups Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 15.0, + sets: 1, + weight: 0.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("band shoulder press").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: full_body_template.id }) Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 2, weight: 0.0, weight_unit: "kg", reps: 8, @@ -500,8 +817,30 @@ Repo.insert!(%WorkoutItem{ workout_template_id: full_body_template.id }) +# Multiple sets of shoulder press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id +}) + +# Arm exercises Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 1, weight: 12.0, weight_unit: "kg", reps: 12, @@ -511,7 +850,7 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 7, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 12, @@ -520,8 +859,9 @@ Repo.insert!(%WorkoutItem{ workout_template_id: full_body_template.id }) +# Core exercise Repo.insert!(%WorkoutItem{ - sets: 8, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 20, @@ -541,17 +881,58 @@ chest_template = workout_template_score: 0 }) -# Add exercises to chest day template +# Multiple sets of bench press Repo.insert!(%WorkoutItem{ sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 25.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", reps: 8, check_box: false, exercise_id: get_exercise.("dumbbell bench press").id, workout_template_id: chest_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +# Multiple sets of push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: chest_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 2, weight: 0.0, @@ -562,8 +943,19 @@ Repo.insert!(%WorkoutItem{ workout_template_id: chest_template.id }) +# Multiple sets of chest dips Repo.insert!(%WorkoutItem{ - sets: 3, + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, weight: 0.0, weight_unit: "kg", reps: 10, @@ -572,18 +964,19 @@ Repo.insert!(%WorkoutItem{ workout_template_id: chest_template.id }) +# Multiple sets of incline push-ups Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 1, weight: 0.0, weight_unit: "kg", - reps: 12, + reps: 15, check_box: false, - exercise_id: get_exercise.("decline push-up").id, + exercise_id: get_exercise.("incline push-up").id, workout_template_id: chest_template.id }) Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 2, weight: 0.0, weight_unit: "kg", reps: 12, @@ -592,13 +985,24 @@ Repo.insert!(%WorkoutItem{ workout_template_id: chest_template.id }) +# Multiple sets of decline push-ups Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 1, weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline push-up").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, check_box: false, - exercise_id: get_exercise.("suspended push-up").id, + exercise_id: get_exercise.("decline push-up").id, workout_template_id: chest_template.id }) @@ -611,12 +1015,12 @@ back_template = workout_template_score: 0 }) -# Add exercises to back day template +# Multiple sets of pull-ups Repo.insert!(%WorkoutItem{ sets: 1, weight: 0.0, weight_unit: "kg", - reps: 8, + reps: 10, check_box: false, exercise_id: get_exercise.("pull-up").id, workout_template_id: back_template.id @@ -628,47 +1032,121 @@ Repo.insert!(%WorkoutItem{ weight_unit: "kg", reps: 8, check_box: false, - exercise_id: get_exercise.("chin-up").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 50.0, + weight: 0.0, weight_unit: "kg", - reps: 10, + reps: 6, check_box: false, - exercise_id: get_exercise.("cable seated row").id, + exercise_id: get_exercise.("pull-up").id, workout_template_id: back_template.id }) +# Multiple sets of chin-ups Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("suspended row").id, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id +}) + +# Multiple sets of seated rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 2, weight: 50.0, weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id +}) + +# Multiple sets of suspended rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", reps: 12, check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id +}) + +# Multiple sets of barbell shrugs +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, exercise_id: get_exercise.("barbell shrug").id, workout_template_id: back_template.id }) Repo.insert!(%WorkoutItem{ - sets: 6, - weight: 10.0, + sets: 2, + weight: 50.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: get_exercise.("kettlebell alternating renegade row").id, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, workout_template_id: back_template.id }) @@ -681,12 +1159,12 @@ arms_template = workout_template_score: 0 }) -# Add exercises to arms day template +# Multiple sets of barbell curls Repo.insert!(%WorkoutItem{ sets: 1, - weight: 20.0, + weight: 15.0, weight_unit: "kg", - reps: 10, + reps: 12, check_box: false, exercise_id: get_exercise.("barbell curl").id, workout_template_id: arms_template.id @@ -694,17 +1172,28 @@ Repo.insert!(%WorkoutItem{ Repo.insert!(%WorkoutItem{ sets: 2, - weight: 0.0, + weight: 20.0, weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("triceps dip").id, + exercise_id: get_exercise.("barbell curl").id, workout_template_id: arms_template.id }) Repo.insert!(%WorkoutItem{ sets: 3, - weight: 12.0, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of dumbbell curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, weight_unit: "kg", reps: 12, check_box: false, @@ -713,27 +1202,81 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of preacher curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, weight: 0.0, weight_unit: "kg", reps: 12, check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of bench dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, exercise_id: get_exercise.("weighted bench dip").id, workout_template_id: arms_template.id }) Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 12.0, + sets: 2, + weight: 10.0, weight_unit: "kg", reps: 12, check_box: false, - exercise_id: get_exercise.("dumbbell preacher curl").id, + exercise_id: get_exercise.("weighted bench dip").id, workout_template_id: arms_template.id }) +# Multiple sets of diamond push-ups Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 1, weight: 0.0, weight_unit: "kg", reps: 15, @@ -742,6 +1285,16 @@ Repo.insert!(%WorkoutItem{ workout_template_id: arms_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id +}) + # ==================== 5. FUNCTIONAL FITNESS WORKOUT ==================== functional_template = @@ -752,7 +1305,7 @@ functional_template = workout_template_score: 0 }) -# Add exercises to functional fitness template +# Multiple sets of kettlebell swings Repo.insert!(%WorkoutItem{ sets: 1, weight: 16.0, @@ -765,6 +1318,27 @@ Repo.insert!(%WorkoutItem{ Repo.insert!(%WorkoutItem{ sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of burpees +Repo.insert!(%WorkoutItem{ + sets: 1, weight: 0.0, weight_unit: "kg", reps: 15, @@ -773,18 +1347,70 @@ Repo.insert!(%WorkoutItem{ workout_template_id: functional_template.id }) +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of power cleans +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 70.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + Repo.insert!(%WorkoutItem{ sets: 3, weight: 80.0, weight_unit: "kg", - reps: 6, + reps: 4, check_box: false, exercise_id: get_exercise.("power clean").id, workout_template_id: functional_template.id }) +# Multiple sets of thrusters Repo.insert!(%WorkoutItem{ - sets: 4, + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, weight: 60.0, weight_unit: "kg", reps: 8, @@ -793,18 +1419,30 @@ Repo.insert!(%WorkoutItem{ workout_template_id: functional_template.id }) +# Multiple sets of mountain climbers Repo.insert!(%WorkoutItem{ - sets: 5, + sets: 1, weight: 0.0, weight_unit: "kg", - reps: 20, + reps: 30, check_box: false, exercise_id: get_exercise.("mountain climber").id, workout_template_id: functional_template.id }) Repo.insert!(%WorkoutItem{ - sets: 6, + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of bear crawls +Repo.insert!(%WorkoutItem{ + sets: 1, weight: 0.0, weight_unit: "kg", reps: 12, @@ -814,23 +1452,44 @@ Repo.insert!(%WorkoutItem{ }) Repo.insert!(%WorkoutItem{ - sets: 7, + sets: 2, weight: 0.0, weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of kettlebell thrusters +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 8.0, + weight_unit: "kg", reps: 10, check_box: false, - exercise_id: get_exercise.("jump squat").id, + exercise_id: get_exercise.("kettlebell thruster").id, workout_template_id: functional_template.id }) Repo.insert!(%WorkoutItem{ - sets: 8, + sets: 2, weight: 10.0, weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", reps: 6, check_box: false, exercise_id: get_exercise.("kettlebell thruster").id, workout_template_id: functional_template.id }) -IO.puts("Successfully created 5 workout templates with all exercises from the provided JSON data") +IO.puts("Successfully created 5 workout templates with proper set numbering for each exercise") From 2ff4fda0ce80a3cb7a6a5c6d26749758129885d7 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 13:49:44 -0400 Subject: [PATCH 12/22] update --- priv/repo/exercises.json | 9 + priv/repo/seeds.exs | 1492 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 1501 insertions(+) diff --git a/priv/repo/exercises.json b/priv/repo/exercises.json index 7616822..d3c3c8c 100644 --- a/priv/repo/exercises.json +++ b/priv/repo/exercises.json @@ -53,6 +53,15 @@ "equipment": "Body Only", "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0260.gif" }, + { + "name": "Overhead Press", + "description": "A compound exercise for the shoulders and triceps. Standing with a barbell at shoulder height, press the weight overhead until your arms are fully extended.", + "gif_url": "https://example.com/overhead-press.gif", + "level": "intermediate", + "type": "strength", + "equipment": "barbell", + "body_part": "shoulders" + }, { "name": "Decline Crunch", "type": "Strength", diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs index 5315fa6..e968ac5 100644 --- a/priv/repo/seeds.exs +++ b/priv/repo/seeds.exs @@ -1492,4 +1492,1496 @@ Repo.insert!(%WorkoutItem{ workout_template_id: functional_template.id }) +# ==================== 6. 5x5 STRENGTH TRAINING PROGRAM ==================== + +# 5x5 Workout A +five_by_five_a = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout A", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squats - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +# Bench Press - 5 sets of 5 reps (using dumbbell bench press as substitute) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +# Rows - 5 sets of 5 reps (using cable seated row as substitute) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +# 5x5 Workout B +five_by_five_b = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout B", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squats - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +# Overhead Press - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +# Deadlift - 1 set of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: five_by_five_b.id +}) + +# ==================== 7. HIIT WORKOUT ==================== + +hiit_template = + Repo.insert!(%WorkoutTemplate{ + name: "HIIT (High Intensity Interval Training)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Burpees - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +# Mountain Climbers - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +# Kettlebell Swings - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +# Jump Squats - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +# ==================== 8. BODYWEIGHT WORKOUT ==================== + +bodyweight_template = + Repo.insert!(%WorkoutTemplate{ + name: "Bodyweight Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Push-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +# Pull-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +# Squats (bodyweight) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + # Using same exercise but with 0 weight for bodyweight + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 25, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +# Lunges - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +# Dips - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +# Plank (treating as reps though it would be seconds) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 60, + check_box: false, + # Using shoulder tap as a substitute for plank + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 45, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +# ==================== 9. POWERLIFTING ROUTINE ==================== + +powerlifting_template = + Repo.insert!(%WorkoutTemplate{ + name: "Powerlifting Training", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squat - Pyramid sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 120.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +# Bench Press - Pyramid sets (using dumbbell bench press) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +# Deadlift - Pyramid sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 140.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +# ==================== 10. MOBILITY AND RECOVERY ==================== + +mobility_template = + Repo.insert!(%WorkoutTemplate{ + name: "Mobility and Recovery Session", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Inchworm Stretch - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +# Iron Cross Stretch - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +# Good Morning Stretch - 3 sets (using barbell good morning at low weight) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +# Shoulder Taps/Plank - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +# Push-up to Side Plank - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +# ==================== 11. OLYMPIC WEIGHTLIFTING ==================== + +olympic_template = + Repo.insert!(%WorkoutTemplate{ + name: "Olympic Weightlifting", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Power Clean - 5 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 70.0, + weight_unit: "kg", + reps: 2, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 75.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +# Front Squat - 4 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 70.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +# Clean Pull (using deadlift as substitute) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 90.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +# Overhead Press - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 45.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +# ==================== 12. CORE FOCUSED WORKOUT ==================== + +core_template = + Repo.insert!(%WorkoutTemplate{ + name: "Core Focused Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Hanging Leg Raises - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +# Russian Twists - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +# Side Bends - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +# Mountain Climbers - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +# Decline Sit-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +# Reverse Crunches - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +# ==================== 13. KETTLEBELL WORKOUT ==================== + +kettlebell_template = + Repo.insert!(%WorkoutTemplate{ + name: "Kettlebell Circuit Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Kettlebell Swings - 4 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Thrusters - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Renegade Rows - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Windmills - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +IO.puts("Successfully created 13 workout templates with proper set numbering for each exercise") + IO.puts("Successfully created 5 workout templates with proper set numbering for each exercise") From 773c56bb3fc8c97923c6344d622fc13e1648d3e5 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Sun, 4 May 2025 14:00:15 -0400 Subject: [PATCH 13/22] update --- .../live/workout_template_live/check_boxes_live_component.ex | 5 +---- lib/fitness_web/live/workout_template_live/form_component.ex | 1 - lib/fitness_web/live/workout_template_live/show.ex | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex b/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex index 50c79ae..9da0db2 100644 --- a/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex +++ b/lib/fitness_web/live/workout_template_live/check_boxes_live_component.ex @@ -1,10 +1,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.CheckBoxesLiveComponent do use FitnessWeb, :live_component - alias Fitness.WorkoutTemplates - alias Fitness.WorkoutTemplates.WorkoutItem - alias Fitness.Exercises - @impl true def update(assigns, socket) do {:ok, @@ -17,6 +13,7 @@ defmodule FitnessWeb.WorkoutTemplateLive.CheckBoxesLiveComponent do |> assign(:workout_start, assigns.workout_start)} end + @impl true def render(assigns) do ~H"""
diff --git a/lib/fitness_web/live/workout_template_live/form_component.ex b/lib/fitness_web/live/workout_template_live/form_component.ex index eefbe0d..21d9a09 100644 --- a/lib/fitness_web/live/workout_template_live/form_component.ex +++ b/lib/fitness_web/live/workout_template_live/form_component.ex @@ -2,7 +2,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.FormComponent do use FitnessWeb, :live_component alias Fitness.WorkoutTemplates - alias FitnessWeb.WorkoutTemplateLive.WorkoutItemForm @impl true def update(%{workout_template: workout_template} = assigns, socket) do diff --git a/lib/fitness_web/live/workout_template_live/show.ex b/lib/fitness_web/live/workout_template_live/show.ex index 25bd1e3..beb03d2 100644 --- a/lib/fitness_web/live/workout_template_live/show.ex +++ b/lib/fitness_web/live/workout_template_live/show.ex @@ -2,7 +2,6 @@ defmodule FitnessWeb.WorkoutTemplateLive.Show do use FitnessWeb, :live_view alias Fitness.WorkoutTemplates - alias Fitness.Accounts alias Fitness.WorkoutTemplates.WorkoutItem alias Fitness.Exercises alias Fitness.WorkoutTemplates.ComplexQuery From 6b8a09ac6e8e83d2ee3955ee52f7a7b11ba8a1be Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 14:55:40 -0400 Subject: [PATCH 14/22] global setup --- data/seeds.exs | 2994 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2994 insertions(+) create mode 100644 data/seeds.exs diff --git a/data/seeds.exs b/data/seeds.exs new file mode 100644 index 0000000..b1d0136 --- /dev/null +++ b/data/seeds.exs @@ -0,0 +1,2994 @@ +# Script to generate workout templates from JSON exercise data +# Run with: mix run priv/repo/workout_templates_generator.exs +defmodule Fitness.Data.Seed do + + +alias Fitness.Repo +alias Fitness.Accounts +alias Fitness.Exercises.Exercise +alias Fitness.WorkoutTemplates.WorkoutTemplate +alias Fitness.WorkoutTemplates.WorkoutItem + + +def run do +# Create users or get existing ones +{:ok, user1} = + Accounts.register_user(%{ + email: "test@test9.com", + password: "mak12345", + is_admin: false, + username: "The-Bird-Man", + name: "marko", + player_score: "500" + }) + +{:ok, user2} = + Accounts.register_user(%{ + email: "test@test10.com", + password: "mak12345", + is_admin: false, + username: "Elixir-Newbie", + name: "mohsin", + player_score: "2000" + }) + +# Parse the JSON exercise data +exercise_data = + File.read!("priv/repo/exercises.json") + |> Jason.decode!() + +# Create all exercises from the JSON data and build a map for easy lookup +exercises_map = %{} + +exercises_map = + Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> + # Create a unique key for each exercise + key = + exercise_json["name"] + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + # Create the exercise in the database + exercise = + Repo.insert!(%Exercise{ + name: exercise_json["name"], + description: exercise_json["description"], + gif_url: exercise_json["gif_url"], + level: String.downcase(exercise_json["level"]), + type: String.downcase(exercise_json["type"]), + equipment: String.downcase(exercise_json["equipment"]), + body_part: String.downcase(exercise_json["body_part"]) + }) + + # Add the exercise to our map + Map.put(acc, key, exercise) + end) + +# Helper function to get exercise by name +get_exercise = fn name -> + key = + name + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + Map.get(exercises_map, key) +end + +# ==================== 1. PUSH/PULL/LEGS SPLIT ==================== + +# Push Day (Chest, Shoulders, Triceps) +push_template = + Repo.insert!(%WorkoutTemplate{ + name: "Push Day (Chest, Shoulders, Triceps)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of bench press with pyramid weights +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id +}) + +# Multiple sets of push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: push_template.id +}) + +# Multiple sets of overhead press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: push_template.id +}) + +# Multiple sets of lateral raises +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 8.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell lateral raise").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 6.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell lateral raise").id, + workout_template_id: push_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: push_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: push_template.id +}) + +# Pull Day (Back and Biceps) +pull_template = + Repo.insert!(%WorkoutTemplate{ + name: "Pull Day (Back & Biceps)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of pull-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id +}) + +# Multiple sets of seated rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 55.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id +}) + +# Multiple sets of barbell shrugs +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: pull_template.id +}) + +# Multiple sets of bicep curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id +}) + +# Leg Day +leg_template = + Repo.insert!(%WorkoutTemplate{ + name: "Leg Day (Quads, Hamstrings, Glutes)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of squats +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id +}) + +# Multiple sets of deadlifts +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id +}) + +# Multiple sets of walking lunges +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: leg_template.id +}) + +# Multiple sets of calf raises +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 30.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id +}) + +# ==================== 2. UPPER/LOWER SPLIT ==================== + +# Upper Body Workout +upper_template = + Repo.insert!(%WorkoutTemplate{ + name: "Upper Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of bench press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id +}) + +# Multiple sets of pull-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id +}) + +# Multiple sets of shoulder press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: upper_template.id +}) + +# Multiple sets of bicep curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: upper_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id +}) + +# Lower Body Workout +lower_template = + Repo.insert!(%WorkoutTemplate{ + name: "Lower Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of squats +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id +}) + +# Multiple sets of deadlifts +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id +}) + +# Multiple sets of front squats +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 60.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id +}) + +# Multiple sets of lunges +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: lower_template.id +}) + +# Core exercises +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: lower_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: lower_template.id +}) + +# ==================== 3. FULL BODY WORKOUT ==================== + +full_body_template = + Repo.insert!(%WorkoutTemplate{ + name: "Full Body Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of squats +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id +}) + +# Multiple sets of bench press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id +}) + +# Multiple sets of pull-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: full_body_template.id +}) + +# Multiple sets of shoulder press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id +}) + +# Arm exercises +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: full_body_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: full_body_template.id +}) + +# Core exercise +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: full_body_template.id +}) + +# ==================== 4. BRO SPLIT ==================== + +# Chest Day +chest_template = + Repo.insert!(%WorkoutTemplate{ + name: "Chest Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of bench press +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id +}) + +# Multiple sets of push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: chest_template.id +}) + +# Multiple sets of chest dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id +}) + +# Multiple sets of incline push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("incline push-up").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("incline push-up").id, + workout_template_id: chest_template.id +}) + +# Multiple sets of decline push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline push-up").id, + workout_template_id: chest_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("decline push-up").id, + workout_template_id: chest_template.id +}) + +# Back Day +back_template = + Repo.insert!(%WorkoutTemplate{ + name: "Back Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of pull-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id +}) + +# Multiple sets of chin-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id +}) + +# Multiple sets of seated rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id +}) + +# Multiple sets of suspended rows +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id +}) + +# Multiple sets of barbell shrugs +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id +}) + +# Arms Day +arms_template = + Repo.insert!(%WorkoutTemplate{ + name: "Arms Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of barbell curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of dumbbell curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of preacher curls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of triceps dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of bench dips +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("weighted bench dip").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("weighted bench dip").id, + workout_template_id: arms_template.id +}) + +# Multiple sets of diamond push-ups +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id +}) + +# ==================== 5. FUNCTIONAL FITNESS WORKOUT ==================== + +functional_template = + Repo.insert!(%WorkoutTemplate{ + name: "Functional Fitness Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Multiple sets of kettlebell swings +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of burpees +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of power cleans +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 70.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of thrusters +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of mountain climbers +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of bear crawls +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id +}) + +# Multiple sets of kettlebell thrusters +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 8.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 10.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id +}) + +# ==================== 6. 5x5 STRENGTH TRAINING PROGRAM ==================== + +# 5x5 Workout A +five_by_five_a = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout A", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squats - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id +}) + +# Bench Press - 5 sets of 5 reps (using dumbbell bench press as substitute) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id +}) + +# Rows - 5 sets of 5 reps (using cable seated row as substitute) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id +}) + +# 5x5 Workout B +five_by_five_b = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout B", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squats - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id +}) + +# Overhead Press - 5 sets of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id +}) + +# Deadlift - 1 set of 5 reps +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: five_by_five_b.id +}) + +# ==================== 7. HIIT WORKOUT ==================== + +hiit_template = + Repo.insert!(%WorkoutTemplate{ + name: "HIIT (High Intensity Interval Training)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Burpees - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id +}) + +# Mountain Climbers - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id +}) + +# Kettlebell Swings - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id +}) + +# Jump Squats - 4 sets of 30 seconds +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id +}) + +# ==================== 8. BODYWEIGHT WORKOUT ==================== + +bodyweight_template = + Repo.insert!(%WorkoutTemplate{ + name: "Bodyweight Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Push-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id +}) + +# Pull-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id +}) + +# Squats (bodyweight) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + # Using same exercise but with 0 weight for bodyweight + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 25, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id +}) + +# Lunges - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id +}) + +# Dips - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id +}) + +# Plank (treating as reps though it would be seconds) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 60, + check_box: false, + # Using shoulder tap as a substitute for plank + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 45, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id +}) + +# ==================== 9. POWERLIFTING ROUTINE ==================== + +powerlifting_template = + Repo.insert!(%WorkoutTemplate{ + name: "Powerlifting Training", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Squat - Pyramid sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 120.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id +}) + +# Bench Press - Pyramid sets (using dumbbell bench press) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id +}) + +# Deadlift - Pyramid sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 140.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id +}) + +# ==================== 10. MOBILITY AND RECOVERY ==================== + +mobility_template = + Repo.insert!(%WorkoutTemplate{ + name: "Mobility and Recovery Session", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Inchworm Stretch - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id +}) + +# Iron Cross Stretch - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id +}) + +# Good Morning Stretch - 3 sets (using barbell good morning at low weight) +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id +}) + +# Shoulder Taps/Plank - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id +}) + +# Push-up to Side Plank - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id +}) + +# ==================== 11. OLYMPIC WEIGHTLIFTING ==================== + +olympic_template = + Repo.insert!(%WorkoutTemplate{ + name: "Olympic Weightlifting", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Power Clean - 5 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 70.0, + weight_unit: "kg", + reps: 2, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 75.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id +}) + +# Front Squat - 4 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 70.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id +}) + +# Clean Pull (using deadlift as substitute) - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 90.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id +}) + +# Overhead Press - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 45.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id +}) + +# ==================== 12. CORE FOCUSED WORKOUT ==================== + +core_template = + Repo.insert!(%WorkoutTemplate{ + name: "Core Focused Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + +# Hanging Leg Raises - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id +}) + +# Russian Twists - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id +}) + +# Side Bends - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id +}) + +# Mountain Climbers - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id +}) + +# Decline Sit-ups - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id +}) + +# Reverse Crunches - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id +}) + +# ==================== 13. KETTLEBELL WORKOUT ==================== + +kettlebell_template = + Repo.insert!(%WorkoutTemplate{ + name: "Kettlebell Circuit Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + +# Kettlebell Swings - 4 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Thrusters - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Renegade Rows - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id +}) + +# Kettlebell Windmills - 3 sets +Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id +}) + +IO.puts("Successfully created 13 workout templates with proper set numbering for each exercise") + +IO.puts("Successfully created 5 workout templates with proper set numbering for each exercise") + +end +end From 7aa218235dd699e5ce780f0a23ba2b72cf0d3149 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:04:19 -0400 Subject: [PATCH 15/22] update --- data/seeds.exs | 2994 -------------------------------------------- lib/data/seeds.exs | 2994 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2994 insertions(+), 2994 deletions(-) delete mode 100644 data/seeds.exs create mode 100644 lib/data/seeds.exs diff --git a/data/seeds.exs b/data/seeds.exs deleted file mode 100644 index b1d0136..0000000 --- a/data/seeds.exs +++ /dev/null @@ -1,2994 +0,0 @@ -# Script to generate workout templates from JSON exercise data -# Run with: mix run priv/repo/workout_templates_generator.exs -defmodule Fitness.Data.Seed do - - -alias Fitness.Repo -alias Fitness.Accounts -alias Fitness.Exercises.Exercise -alias Fitness.WorkoutTemplates.WorkoutTemplate -alias Fitness.WorkoutTemplates.WorkoutItem - - -def run do -# Create users or get existing ones -{:ok, user1} = - Accounts.register_user(%{ - email: "test@test9.com", - password: "mak12345", - is_admin: false, - username: "The-Bird-Man", - name: "marko", - player_score: "500" - }) - -{:ok, user2} = - Accounts.register_user(%{ - email: "test@test10.com", - password: "mak12345", - is_admin: false, - username: "Elixir-Newbie", - name: "mohsin", - player_score: "2000" - }) - -# Parse the JSON exercise data -exercise_data = - File.read!("priv/repo/exercises.json") - |> Jason.decode!() - -# Create all exercises from the JSON data and build a map for easy lookup -exercises_map = %{} - -exercises_map = - Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> - # Create a unique key for each exercise - key = - exercise_json["name"] - |> String.downcase() - |> String.replace(~r/[^a-z0-9]+/, "_") - |> String.trim("_") - - # Create the exercise in the database - exercise = - Repo.insert!(%Exercise{ - name: exercise_json["name"], - description: exercise_json["description"], - gif_url: exercise_json["gif_url"], - level: String.downcase(exercise_json["level"]), - type: String.downcase(exercise_json["type"]), - equipment: String.downcase(exercise_json["equipment"]), - body_part: String.downcase(exercise_json["body_part"]) - }) - - # Add the exercise to our map - Map.put(acc, key, exercise) - end) - -# Helper function to get exercise by name -get_exercise = fn name -> - key = - name - |> String.downcase() - |> String.replace(~r/[^a-z0-9]+/, "_") - |> String.trim("_") - - Map.get(exercises_map, key) -end - -# ==================== 1. PUSH/PULL/LEGS SPLIT ==================== - -# Push Day (Chest, Shoulders, Triceps) -push_template = - Repo.insert!(%WorkoutTemplate{ - name: "Push Day (Chest, Shoulders, Triceps)", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of bench press with pyramid weights -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 30.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: push_template.id -}) - -# Multiple sets of push-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: push_template.id -}) - -# Multiple sets of overhead press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 15.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: push_template.id -}) - -# Multiple sets of lateral raises -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 8.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell lateral raise").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 6.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("dumbbell lateral raise").id, - workout_template_id: push_template.id -}) - -# Multiple sets of triceps dips -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: push_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: push_template.id -}) - -# Pull Day (Back and Biceps) -pull_template = - Repo.insert!(%WorkoutTemplate{ - name: "Pull Day (Back & Biceps)", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of pull-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: pull_template.id -}) - -# Multiple sets of seated rows -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 55.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: pull_template.id -}) - -# Multiple sets of barbell shrugs -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("barbell shrug").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell shrug").id, - workout_template_id: pull_template.id -}) - -# Multiple sets of bicep curls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 10.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: pull_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: pull_template.id -}) - -# Leg Day -leg_template = - Repo.insert!(%WorkoutTemplate{ - name: "Leg Day (Quads, Hamstrings, Glutes)", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of squats -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 60.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 90.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 100.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: leg_template.id -}) - -# Multiple sets of deadlifts -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 100.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 120.0, - weight_unit: "kg", - reps: 4, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: leg_template.id -}) - -# Multiple sets of walking lunges -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: leg_template.id -}) - -# Multiple sets of calf raises -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 30.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("weighted donkey calf raise").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 40.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("weighted donkey calf raise").id, - workout_template_id: leg_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 50.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("weighted donkey calf raise").id, - workout_template_id: leg_template.id -}) - -# ==================== 2. UPPER/LOWER SPLIT ==================== - -# Upper Body Workout -upper_template = - Repo.insert!(%WorkoutTemplate{ - name: "Upper Body Day", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of bench press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 30.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: upper_template.id -}) - -# Multiple sets of pull-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: upper_template.id -}) - -# Multiple sets of shoulder press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 15.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: upper_template.id -}) - -# Multiple sets of bicep curls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 15.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell curl").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 20.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell curl").id, - workout_template_id: upper_template.id -}) - -# Multiple sets of triceps dips -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: upper_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: upper_template.id -}) - -# Lower Body Workout -lower_template = - Repo.insert!(%WorkoutTemplate{ - name: "Lower Body Day", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of squats -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 60.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 100.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: lower_template.id -}) - -# Multiple sets of deadlifts -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 100.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 120.0, - weight_unit: "kg", - reps: 4, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: lower_template.id -}) - -# Multiple sets of front squats -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 50.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 60.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: lower_template.id -}) - -# Multiple sets of lunges -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: lower_template.id -}) - -# Core exercises -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("hanging leg raise").id, - workout_template_id: lower_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("hanging leg raise").id, - workout_template_id: lower_template.id -}) - -# ==================== 3. FULL BODY WORKOUT ==================== - -full_body_template = - Repo.insert!(%WorkoutTemplate{ - name: "Full Body Workout", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of squats -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 60.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 90.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: full_body_template.id -}) - -# Multiple sets of bench press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 30.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: full_body_template.id -}) - -# Multiple sets of pull-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: full_body_template.id -}) - -# Multiple sets of shoulder press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 15.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("band shoulder press").id, - workout_template_id: full_body_template.id -}) - -# Arm exercises -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: full_body_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: full_body_template.id -}) - -# Core exercise -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("russian twist").id, - workout_template_id: full_body_template.id -}) - -# ==================== 4. BRO SPLIT ==================== - -# Chest Day -chest_template = - Repo.insert!(%WorkoutTemplate{ - name: "Chest Day (Bro Split)", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of bench press -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 30.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 35.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: chest_template.id -}) - -# Multiple sets of push-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: chest_template.id -}) - -# Multiple sets of chest dips -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("chest dip").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("chest dip").id, - workout_template_id: chest_template.id -}) - -# Multiple sets of incline push-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("incline push-up").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("incline push-up").id, - workout_template_id: chest_template.id -}) - -# Multiple sets of decline push-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("decline push-up").id, - workout_template_id: chest_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("decline push-up").id, - workout_template_id: chest_template.id -}) - -# Back Day -back_template = - Repo.insert!(%WorkoutTemplate{ - name: "Back Day (Bro Split)", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of pull-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: back_template.id -}) - -# Multiple sets of chin-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("chin-up").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("chin-up").id, - workout_template_id: back_template.id -}) - -# Multiple sets of seated rows -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 60.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: back_template.id -}) - -# Multiple sets of suspended rows -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("suspended row").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("suspended row").id, - workout_template_id: back_template.id -}) - -# Multiple sets of barbell shrugs -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("barbell shrug").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell shrug").id, - workout_template_id: back_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 60.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell shrug").id, - workout_template_id: back_template.id -}) - -# Arms Day -arms_template = - Repo.insert!(%WorkoutTemplate{ - name: "Arms Day (Bro Split)", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of barbell curls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 15.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell curl").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 20.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell curl").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 25.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell curl").id, - workout_template_id: arms_template.id -}) - -# Multiple sets of dumbbell curls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 10.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 12.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell biceps curl").id, - workout_template_id: arms_template.id -}) - -# Multiple sets of preacher curls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 10.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell preacher curl").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 12.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("dumbbell preacher curl").id, - workout_template_id: arms_template.id -}) - -# Multiple sets of triceps dips -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: arms_template.id -}) - -# Multiple sets of bench dips -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("weighted bench dip").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 10.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("weighted bench dip").id, - workout_template_id: arms_template.id -}) - -# Multiple sets of diamond push-ups -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("diamond push-up").id, - workout_template_id: arms_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("diamond push-up").id, - workout_template_id: arms_template.id -}) - -# ==================== 5. FUNCTIONAL FITNESS WORKOUT ==================== - -functional_template = - Repo.insert!(%WorkoutTemplate{ - name: "Functional Fitness Workout", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Multiple sets of kettlebell swings -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 16.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 20.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 24.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of burpees -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of power cleans -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 60.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 70.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 80.0, - weight_unit: "kg", - reps: 4, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of thrusters -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell thruster").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("barbell thruster").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 60.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("barbell thruster").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of mountain climbers -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of bear crawls -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("bear crawl").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("bear crawl").id, - workout_template_id: functional_template.id -}) - -# Multiple sets of kettlebell thrusters -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 8.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 10.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: functional_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 12.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: functional_template.id -}) - -# ==================== 6. 5x5 STRENGTH TRAINING PROGRAM ==================== - -# 5x5 Workout A -five_by_five_a = - Repo.insert!(%WorkoutTemplate{ - name: "5x5 Strength Workout A", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Squats - 5 sets of 5 reps -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_a.id -}) - -# Bench Press - 5 sets of 5 reps (using dumbbell bench press as substitute) -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: five_by_five_a.id -}) - -# Rows - 5 sets of 5 reps (using cable seated row as substitute) -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: five_by_five_a.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("cable seated row").id, - workout_template_id: five_by_five_a.id -}) - -# 5x5 Workout B -five_by_five_b = - Repo.insert!(%WorkoutTemplate{ - name: "5x5 Strength Workout B", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Squats - 5 sets of 5 reps -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: five_by_five_b.id -}) - -# Overhead Press - 5 sets of 5 reps -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: five_by_five_b.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: five_by_five_b.id -}) - -# Deadlift - 1 set of 5 reps -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 100.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: five_by_five_b.id -}) - -# ==================== 7. HIIT WORKOUT ==================== - -hiit_template = - Repo.insert!(%WorkoutTemplate{ - name: "HIIT (High Intensity Interval Training)", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Burpees - 4 sets of 30 seconds -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("burpee").id, - workout_template_id: hiit_template.id -}) - -# Mountain Climbers - 4 sets of 30 seconds -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: hiit_template.id -}) - -# Kettlebell Swings - 4 sets of 30 seconds -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 16.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 16.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 16.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 16.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: hiit_template.id -}) - -# Jump Squats - 4 sets of 30 seconds -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("jump squat").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("jump squat").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("jump squat").id, - workout_template_id: hiit_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("jump squat").id, - workout_template_id: hiit_template.id -}) - -# ==================== 8. BODYWEIGHT WORKOUT ==================== - -bodyweight_template = - Repo.insert!(%WorkoutTemplate{ - name: "Bodyweight Workout", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Push-ups - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("push-up").id, - workout_template_id: bodyweight_template.id -}) - -# Pull-ups - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 6, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 4, - check_box: false, - exercise_id: get_exercise.("pull-up").id, - workout_template_id: bodyweight_template.id -}) - -# Squats (bodyweight) - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - # Using same exercise but with 0 weight for bodyweight - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 25, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: bodyweight_template.id -}) - -# Lunges - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("walking lunge").id, - workout_template_id: bodyweight_template.id -}) - -# Dips - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("triceps dip").id, - workout_template_id: bodyweight_template.id -}) - -# Plank (treating as reps though it would be seconds) - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 60, - check_box: false, - # Using shoulder tap as a substitute for plank - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 45, - check_box: false, - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: bodyweight_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: bodyweight_template.id -}) - -# ==================== 9. POWERLIFTING ROUTINE ==================== - -powerlifting_template = - Repo.insert!(%WorkoutTemplate{ - name: "Powerlifting Training", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Squat - Pyramid sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 60.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 100.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 120.0, - weight_unit: "kg", - reps: 1, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 100.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell full squat").id, - workout_template_id: powerlifting_template.id -}) - -# Bench Press - Pyramid sets (using dumbbell bench press) -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 30.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 35.0, - weight_unit: "kg", - reps: 1, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 25.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("dumbbell bench press").id, - workout_template_id: powerlifting_template.id -}) - -# Deadlift - Pyramid sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 100.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 120.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 140.0, - weight_unit: "kg", - reps: 1, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: powerlifting_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 100.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: powerlifting_template.id -}) - -# ==================== 10. MOBILITY AND RECOVERY ==================== - -mobility_template = - Repo.insert!(%WorkoutTemplate{ - name: "Mobility and Recovery Session", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Inchworm Stretch - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("inchworm").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("inchworm").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("inchworm").id, - workout_template_id: mobility_template.id -}) - -# Iron Cross Stretch - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("iron cross stretch").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("iron cross stretch").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("iron cross stretch").id, - workout_template_id: mobility_template.id -}) - -# Good Morning Stretch - 3 sets (using barbell good morning at low weight) -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell good morning").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell good morning").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 20.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("barbell good morning").id, - workout_template_id: mobility_template.id -}) - -# Shoulder Taps/Plank - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("shoulder tap").id, - workout_template_id: mobility_template.id -}) - -# Push-up to Side Plank - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("push-up to side plank").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("push-up to side plank").id, - workout_template_id: mobility_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("push-up to side plank").id, - workout_template_id: mobility_template.id -}) - -# ==================== 11. OLYMPIC WEIGHTLIFTING ==================== - -olympic_template = - Repo.insert!(%WorkoutTemplate{ - name: "Olympic Weightlifting", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Power Clean - 5 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 50.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 60.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 70.0, - weight_unit: "kg", - reps: 2, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 5, - weight: 75.0, - weight_unit: "kg", - reps: 1, - check_box: false, - exercise_id: get_exercise.("power clean").id, - workout_template_id: olympic_template.id -}) - -# Front Squat - 4 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 50.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 60.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 70.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 80.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("barbell front squat").id, - workout_template_id: olympic_template.id -}) - -# Clean Pull (using deadlift as substitute) - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 80.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 90.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 100.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("barbell deadlift").id, - workout_template_id: olympic_template.id -}) - -# Overhead Press - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 40.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 45.0, - weight_unit: "kg", - reps: 5, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: olympic_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 50.0, - weight_unit: "kg", - reps: 3, - check_box: false, - exercise_id: get_exercise.("overhead press").id, - workout_template_id: olympic_template.id -}) - -# ==================== 12. CORE FOCUSED WORKOUT ==================== - -core_template = - Repo.insert!(%WorkoutTemplate{ - name: "Core Focused Workout", - user_id: user2.id, - is_finished: false, - workout_template_score: 0 - }) - -# Hanging Leg Raises - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("hanging leg raise").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("hanging leg raise").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("hanging leg raise").id, - workout_template_id: core_template.id -}) - -# Russian Twists - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("russian twist").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("russian twist").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("russian twist").id, - workout_template_id: core_template.id -}) - -# Side Bends - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 15.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell side bend").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 15.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell side bend").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 15.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("dumbbell side bend").id, - workout_template_id: core_template.id -}) - -# Mountain Climbers - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 30, - check_box: false, - exercise_id: get_exercise.("mountain climber").id, - workout_template_id: core_template.id -}) - -# Decline Sit-ups - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("decline sit-up").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("decline sit-up").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("decline sit-up").id, - workout_template_id: core_template.id -}) - -# Reverse Crunches - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("reverse crunch").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("reverse crunch").id, - workout_template_id: core_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 0.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("reverse crunch").id, - workout_template_id: core_template.id -}) - -# ==================== 13. KETTLEBELL WORKOUT ==================== - -kettlebell_template = - Repo.insert!(%WorkoutTemplate{ - name: "Kettlebell Circuit Workout", - user_id: user1.id, - is_finished: false, - workout_template_score: 0 - }) - -# Kettlebell Swings - 4 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 16.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 20.0, - weight_unit: "kg", - reps: 15, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 24.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 4, - weight: 16.0, - weight_unit: "kg", - reps: 20, - check_box: false, - exercise_id: get_exercise.("kettlebell swing").id, - workout_template_id: kettlebell_template.id -}) - -# Kettlebell Thrusters - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 12.0, - weight_unit: "kg", - reps: 12, - check_box: false, - exercise_id: get_exercise.("kettlebell thruster").id, - workout_template_id: kettlebell_template.id -}) - -# Kettlebell Renegade Rows - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 16.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("kettlebell alternating renegade row").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 16.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("kettlebell alternating renegade row").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 16.0, - weight_unit: "kg", - reps: 10, - check_box: false, - exercise_id: get_exercise.("kettlebell alternating renegade row").id, - workout_template_id: kettlebell_template.id -}) - -# Kettlebell Windmills - 3 sets -Repo.insert!(%WorkoutItem{ - sets: 1, - weight: 12.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("kettlebell windmill").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 2, - weight: 12.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("kettlebell windmill").id, - workout_template_id: kettlebell_template.id -}) - -Repo.insert!(%WorkoutItem{ - sets: 3, - weight: 12.0, - weight_unit: "kg", - reps: 8, - check_box: false, - exercise_id: get_exercise.("kettlebell windmill").id, - workout_template_id: kettlebell_template.id -}) - -IO.puts("Successfully created 13 workout templates with proper set numbering for each exercise") - -IO.puts("Successfully created 5 workout templates with proper set numbering for each exercise") - -end -end diff --git a/lib/data/seeds.exs b/lib/data/seeds.exs new file mode 100644 index 0000000..3fc1e5d --- /dev/null +++ b/lib/data/seeds.exs @@ -0,0 +1,2994 @@ +# Script to generate workout templates from JSON exercise data +# Run with: mix run priv/repo/workout_templates_generator.exs +defmodule Fitness.Data.Seed do + alias Fitness.Repo + alias Fitness.Accounts + alias Fitness.Exercises.Exercise + alias Fitness.WorkoutTemplates.WorkoutTemplate + alias Fitness.WorkoutTemplates.WorkoutItem + + def run do + # Create users or get existing ones + {:ok, user1} = + Accounts.register_user(%{ + email: "test@test9.com", + password: "mak12345", + is_admin: false, + username: "The-Bird-Man", + name: "marko", + player_score: "500" + }) + + {:ok, user2} = + Accounts.register_user(%{ + email: "test@test10.com", + password: "mak12345", + is_admin: false, + username: "Elixir-Newbie", + name: "mohsin", + player_score: "2000" + }) + + # Parse the JSON exercise data + exercise_data = + File.read!("priv/repo/exercises.json") + |> Jason.decode!() + + # Create all exercises from the JSON data and build a map for easy lookup + exercises_map = %{} + + exercises_map = + Enum.reduce(exercise_data, exercises_map, fn exercise_json, acc -> + # Create a unique key for each exercise + key = + exercise_json["name"] + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + # Create the exercise in the database + exercise = + Repo.insert!(%Exercise{ + name: exercise_json["name"], + description: exercise_json["description"], + gif_url: exercise_json["gif_url"], + level: String.downcase(exercise_json["level"]), + type: String.downcase(exercise_json["type"]), + equipment: String.downcase(exercise_json["equipment"]), + body_part: String.downcase(exercise_json["body_part"]) + }) + + # Add the exercise to our map + Map.put(acc, key, exercise) + end) + + # Helper function to get exercise by name + get_exercise = fn name -> + key = + name + |> String.downcase() + |> String.replace(~r/[^a-z0-9]+/, "_") + |> String.trim("_") + + Map.get(exercises_map, key) + end + + # ==================== 1. PUSH/PULL/LEGS SPLIT ==================== + + # Push Day (Chest, Shoulders, Triceps) + push_template = + Repo.insert!(%WorkoutTemplate{ + name: "Push Day (Chest, Shoulders, Triceps)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of bench press with pyramid weights + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: push_template.id + }) + + # Multiple sets of push-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: push_template.id + }) + + # Multiple sets of overhead press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: push_template.id + }) + + # Multiple sets of lateral raises + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 8.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell lateral raise").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 6.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell lateral raise").id, + workout_template_id: push_template.id + }) + + # Multiple sets of triceps dips + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: push_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: push_template.id + }) + + # Pull Day (Back and Biceps) + pull_template = + Repo.insert!(%WorkoutTemplate{ + name: "Pull Day (Back & Biceps)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of pull-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: pull_template.id + }) + + # Multiple sets of seated rows + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 55.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: pull_template.id + }) + + # Multiple sets of barbell shrugs + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: pull_template.id + }) + + # Multiple sets of bicep curls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: pull_template.id + }) + + # Leg Day + leg_template = + Repo.insert!(%WorkoutTemplate{ + name: "Leg Day (Quads, Hamstrings, Glutes)", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of squats + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: leg_template.id + }) + + # Multiple sets of deadlifts + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: leg_template.id + }) + + # Multiple sets of walking lunges + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: leg_template.id + }) + + # Multiple sets of calf raises + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 30.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("weighted donkey calf raise").id, + workout_template_id: leg_template.id + }) + + # ==================== 2. UPPER/LOWER SPLIT ==================== + + # Upper Body Workout + upper_template = + Repo.insert!(%WorkoutTemplate{ + name: "Upper Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of bench press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: upper_template.id + }) + + # Multiple sets of pull-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: upper_template.id + }) + + # Multiple sets of shoulder press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: upper_template.id + }) + + # Multiple sets of bicep curls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: upper_template.id + }) + + # Multiple sets of triceps dips + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: upper_template.id + }) + + # Lower Body Workout + lower_template = + Repo.insert!(%WorkoutTemplate{ + name: "Lower Body Day", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of squats + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: lower_template.id + }) + + # Multiple sets of deadlifts + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: lower_template.id + }) + + # Multiple sets of front squats + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 60.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: lower_template.id + }) + + # Multiple sets of lunges + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: lower_template.id + }) + + # Core exercises + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: lower_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: lower_template.id + }) + + # ==================== 3. FULL BODY WORKOUT ==================== + + full_body_template = + Repo.insert!(%WorkoutTemplate{ + name: "Full Body Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of squats + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 90.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: full_body_template.id + }) + + # Multiple sets of bench press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: full_body_template.id + }) + + # Multiple sets of pull-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: full_body_template.id + }) + + # Multiple sets of shoulder press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("band shoulder press").id, + workout_template_id: full_body_template.id + }) + + # Arm exercises + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: full_body_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: full_body_template.id + }) + + # Core exercise + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: full_body_template.id + }) + + # ==================== 4. BRO SPLIT ==================== + + # Chest Day + chest_template = + Repo.insert!(%WorkoutTemplate{ + name: "Chest Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of bench press + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: chest_template.id + }) + + # Multiple sets of push-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: chest_template.id + }) + + # Multiple sets of chest dips + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("chest dip").id, + workout_template_id: chest_template.id + }) + + # Multiple sets of incline push-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("incline push-up").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("incline push-up").id, + workout_template_id: chest_template.id + }) + + # Multiple sets of decline push-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline push-up").id, + workout_template_id: chest_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("decline push-up").id, + workout_template_id: chest_template.id + }) + + # Back Day + back_template = + Repo.insert!(%WorkoutTemplate{ + name: "Back Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of pull-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: back_template.id + }) + + # Multiple sets of chin-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("chin-up").id, + workout_template_id: back_template.id + }) + + # Multiple sets of seated rows + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: back_template.id + }) + + # Multiple sets of suspended rows + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("suspended row").id, + workout_template_id: back_template.id + }) + + # Multiple sets of barbell shrugs + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell shrug").id, + workout_template_id: back_template.id + }) + + # Arms Day + arms_template = + Repo.insert!(%WorkoutTemplate{ + name: "Arms Day (Bro Split)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of barbell curls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell curl").id, + workout_template_id: arms_template.id + }) + + # Multiple sets of dumbbell curls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell biceps curl").id, + workout_template_id: arms_template.id + }) + + # Multiple sets of preacher curls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("dumbbell preacher curl").id, + workout_template_id: arms_template.id + }) + + # Multiple sets of triceps dips + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: arms_template.id + }) + + # Multiple sets of bench dips + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("weighted bench dip").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 10.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("weighted bench dip").id, + workout_template_id: arms_template.id + }) + + # Multiple sets of diamond push-ups + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("diamond push-up").id, + workout_template_id: arms_template.id + }) + + # ==================== 5. FUNCTIONAL FITNESS WORKOUT ==================== + + functional_template = + Repo.insert!(%WorkoutTemplate{ + name: "Functional Fitness Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Multiple sets of kettlebell swings + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of burpees + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of power cleans + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 70.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of thrusters + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("barbell thruster").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of mountain climbers + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of bear crawls + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("bear crawl").id, + workout_template_id: functional_template.id + }) + + # Multiple sets of kettlebell thrusters + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 8.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 10.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: functional_template.id + }) + + # ==================== 6. 5x5 STRENGTH TRAINING PROGRAM ==================== + + # 5x5 Workout A + five_by_five_a = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout A", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Squats - 5 sets of 5 reps + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_a.id + }) + + # Bench Press - 5 sets of 5 reps (using dumbbell bench press as substitute) + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: five_by_five_a.id + }) + + # Rows - 5 sets of 5 reps (using cable seated row as substitute) + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("cable seated row").id, + workout_template_id: five_by_five_a.id + }) + + # 5x5 Workout B + five_by_five_b = + Repo.insert!(%WorkoutTemplate{ + name: "5x5 Strength Workout B", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Squats - 5 sets of 5 reps + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: five_by_five_b.id + }) + + # Overhead Press - 5 sets of 5 reps + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: five_by_five_b.id + }) + + # Deadlift - 1 set of 5 reps + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: five_by_five_b.id + }) + + # ==================== 7. HIIT WORKOUT ==================== + + hiit_template = + Repo.insert!(%WorkoutTemplate{ + name: "HIIT (High Intensity Interval Training)", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Burpees - 4 sets of 30 seconds + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("burpee").id, + workout_template_id: hiit_template.id + }) + + # Mountain Climbers - 4 sets of 30 seconds + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: hiit_template.id + }) + + # Kettlebell Swings - 4 sets of 30 seconds + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: hiit_template.id + }) + + # Jump Squats - 4 sets of 30 seconds + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("jump squat").id, + workout_template_id: hiit_template.id + }) + + # ==================== 8. BODYWEIGHT WORKOUT ==================== + + bodyweight_template = + Repo.insert!(%WorkoutTemplate{ + name: "Bodyweight Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Push-ups - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up").id, + workout_template_id: bodyweight_template.id + }) + + # Pull-ups - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 6, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 4, + check_box: false, + exercise_id: get_exercise.("pull-up").id, + workout_template_id: bodyweight_template.id + }) + + # Squats (bodyweight) - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + # Using same exercise but with 0 weight for bodyweight + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 25, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: bodyweight_template.id + }) + + # Lunges - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("walking lunge").id, + workout_template_id: bodyweight_template.id + }) + + # Dips - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("triceps dip").id, + workout_template_id: bodyweight_template.id + }) + + # Plank (treating as reps though it would be seconds) - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 60, + check_box: false, + # Using shoulder tap as a substitute for plank + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 45, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: bodyweight_template.id + }) + + # ==================== 9. POWERLIFTING ROUTINE ==================== + + powerlifting_template = + Repo.insert!(%WorkoutTemplate{ + name: "Powerlifting Training", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Squat - Pyramid sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 120.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell full squat").id, + workout_template_id: powerlifting_template.id + }) + + # Bench Press - Pyramid sets (using dumbbell bench press) + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 30.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 35.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 25.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("dumbbell bench press").id, + workout_template_id: powerlifting_template.id + }) + + # Deadlift - Pyramid sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 120.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 140.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 100.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: powerlifting_template.id + }) + + # ==================== 10. MOBILITY AND RECOVERY ==================== + + mobility_template = + Repo.insert!(%WorkoutTemplate{ + name: "Mobility and Recovery Session", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Inchworm Stretch - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("inchworm").id, + workout_template_id: mobility_template.id + }) + + # Iron Cross Stretch - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("iron cross stretch").id, + workout_template_id: mobility_template.id + }) + + # Good Morning Stretch - 3 sets (using barbell good morning at low weight) + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 20.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("barbell good morning").id, + workout_template_id: mobility_template.id + }) + + # Shoulder Taps/Plank - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("shoulder tap").id, + workout_template_id: mobility_template.id + }) + + # Push-up to Side Plank - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("push-up to side plank").id, + workout_template_id: mobility_template.id + }) + + # ==================== 11. OLYMPIC WEIGHTLIFTING ==================== + + olympic_template = + Repo.insert!(%WorkoutTemplate{ + name: "Olympic Weightlifting", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Power Clean - 5 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 60.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 70.0, + weight_unit: "kg", + reps: 2, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 5, + weight: 75.0, + weight_unit: "kg", + reps: 1, + check_box: false, + exercise_id: get_exercise.("power clean").id, + workout_template_id: olympic_template.id + }) + + # Front Squat - 4 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 50.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 60.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 70.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 80.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("barbell front squat").id, + workout_template_id: olympic_template.id + }) + + # Clean Pull (using deadlift as substitute) - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 80.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 90.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 100.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("barbell deadlift").id, + workout_template_id: olympic_template.id + }) + + # Overhead Press - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 40.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 45.0, + weight_unit: "kg", + reps: 5, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 50.0, + weight_unit: "kg", + reps: 3, + check_box: false, + exercise_id: get_exercise.("overhead press").id, + workout_template_id: olympic_template.id + }) + + # ==================== 12. CORE FOCUSED WORKOUT ==================== + + core_template = + Repo.insert!(%WorkoutTemplate{ + name: "Core Focused Workout", + user_id: user2.id, + is_finished: false, + workout_template_score: 0 + }) + + # Hanging Leg Raises - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("hanging leg raise").id, + workout_template_id: core_template.id + }) + + # Russian Twists - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("russian twist").id, + workout_template_id: core_template.id + }) + + # Side Bends - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 15.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("dumbbell side bend").id, + workout_template_id: core_template.id + }) + + # Mountain Climbers - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 30, + check_box: false, + exercise_id: get_exercise.("mountain climber").id, + workout_template_id: core_template.id + }) + + # Decline Sit-ups - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("decline sit-up").id, + workout_template_id: core_template.id + }) + + # Reverse Crunches - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 0.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("reverse crunch").id, + workout_template_id: core_template.id + }) + + # ==================== 13. KETTLEBELL WORKOUT ==================== + + kettlebell_template = + Repo.insert!(%WorkoutTemplate{ + name: "Kettlebell Circuit Workout", + user_id: user1.id, + is_finished: false, + workout_template_score: 0 + }) + + # Kettlebell Swings - 4 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 20.0, + weight_unit: "kg", + reps: 15, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 24.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 4, + weight: 16.0, + weight_unit: "kg", + reps: 20, + check_box: false, + exercise_id: get_exercise.("kettlebell swing").id, + workout_template_id: kettlebell_template.id + }) + + # Kettlebell Thrusters - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 12, + check_box: false, + exercise_id: get_exercise.("kettlebell thruster").id, + workout_template_id: kettlebell_template.id + }) + + # Kettlebell Renegade Rows - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 16.0, + weight_unit: "kg", + reps: 10, + check_box: false, + exercise_id: get_exercise.("kettlebell alternating renegade row").id, + workout_template_id: kettlebell_template.id + }) + + # Kettlebell Windmills - 3 sets + Repo.insert!(%WorkoutItem{ + sets: 1, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 2, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id + }) + + Repo.insert!(%WorkoutItem{ + sets: 3, + weight: 12.0, + weight_unit: "kg", + reps: 8, + check_box: false, + exercise_id: get_exercise.("kettlebell windmill").id, + workout_template_id: kettlebell_template.id + }) + + IO.puts( + "Successfully created 13 workout templates with proper set numbering for each exercise" + ) + + IO.puts( + "Successfully created 5 workout templates with proper set numbering for each exercise" + ) + end +end From dc8cf08cd0034222500226c1f2f8919dbd77c2b7 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:06:06 -0400 Subject: [PATCH 16/22] update --- lib/data/exercises.json | 695 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 695 insertions(+) create mode 100644 lib/data/exercises.json diff --git a/lib/data/exercises.json b/lib/data/exercises.json new file mode 100644 index 0000000..d3c3c8c --- /dev/null +++ b/lib/data/exercises.json @@ -0,0 +1,695 @@ +[ + { + "name": "Kettlebell Windmill", + "type": "Strength", + "level": "Intermediate", + "description": "The single-kettlebell windmill is a dynamic kettlebell exercise emphasizing core strength and shoulder and hip mobility and stability. It is often used as a functional warm-up or for multi-directional strength work. It doesn't work as well in a metcon or conditioning setting, and shouldn't be performed under intense fatigue.", + "body_part": "Abdominals", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0554.gif" + }, + { + "name": "Kettlebell swing", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell swing is a popular lower-body exercise emphasizing the hamstrings, glutes, and back muscles. It is often used to train explosive power, for aerobic or cardiovascular conditioning, in circuit training, or as an accessory movement for the deadlift.", + "body_part": "Abdominals", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0549.gif" + }, + { + "name": "Dumbbell side bend", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell side bend is a popular exercise for targeting the oblique muscles of the abdomen. It is usually performed for relatively high reps, at least 8-12 reps per set or more. It can be performed one side at a time or alternating sides.", + "body_part": "Abdominals", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0407.gif" + }, + { + "name": "Barbell press sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell press sit-up is a weighted exercise focusing on the abdominal muscles, as well as the shoulders to a lesser degree. It primarily targets the rectus abdominis or \"six-pack\" muscles, but also involves the obliques and deep core muscles. It can be performed on the floor with the feet anchored or unanchored, or on a decline or other bench. It is similar to the Otis-up, which is performed with a weight plate.", + "body_part": "Abdominals", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0071.gif" + }, + { + "name": "Cable reverse crunch", + "type": "Strength", + "level": "Beginner", + "description": "The cable reverse crunch is performed on the ground facing away from a high pulley, which helps target the lower abdominals specifically.", + "body_part": "Abdominals", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0873.gif" + }, + { + "name": "Cocoons", + "type": "Strength", + "level": "Intermediate", + "description": "The cocoon crunch is a bodyweight exercise targeting the ab muscles, the rectus abdominis or \"six-pack\" muscles in particular. It involves bringing your knees to your chest and your arms from overhead to center. It can be performed for time or reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0260.gif" + }, + { + "name": "Overhead Press", + "description": "A compound exercise for the shoulders and triceps. Standing with a barbell at shoulder height, press the weight overhead until your arms are fully extended.", + "gif_url": "https://example.com/overhead-press.gif", + "level": "intermediate", + "type": "strength", + "equipment": "barbell", + "body_part": "shoulders" + }, + { + "name": "Decline Crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The decline crunch is an effective core exercise targeting the rectus abdominis.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0277.gif" + }, + { + "name": "Hanging Oblique Knee Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging oblique crunch an abdominal exercise that targets both the rectus abdominus or “six-pack” muscles, and the oblique muscles. It can be performed hanging from a bar, or if grip strength is a limitation, by placing the elbows in ab straps. If hanging from a straight bar is uncomfortable to the wrists or shoulder, you can also perform them hanging with a neutral grip (palms facing one another)", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1761.gif" + }, + { + "name": "Hanging leg raise", + "type": "Strength", + "level": "Intermediate", + "description": "The hanging leg raise is an exercise targeting the abs, but which also works the lats and hip flexors. Instead of resting your forearms on the pads of a captain's chair, you perform these hanging from a bar. Experienced lifters make these look easy, but beginners may need time to build up to sets of 8-12 reps.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0472.gif" + }, + { + "name": "Mountain climber", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The mountain climber is a popular bodyweight exercise targeting the muscles of the core, as well as the shoulders, hips, and cardiovascular system. It involves lifting one knee to the chest at a time from a straight-arm plank position. It can be performed for time or reps as part of a dynamic warm-up, for bodyweight cardio or conditioning, or as no-equipment dynamic core training.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0630.gif" + }, + { + "name": "3/4 sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The 3/4 sit-up is a bodyweight exercise focused on the muscles of the core. It is similar to a sit-up, but stops short of the top position. This keeps constant tension on the abs, making it more difficult than traditional sit-ups. It can be performed for time or for reps, with the feet anchored or free, as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0001.gif" + }, + { + "name": "Reverse crunch", + "type": "Strength", + "level": "Intermediate", + "description": "The reverse crunch is a popular exercise targeting the abdominals, particularly the lower half. It’s easy to perform on either the floor or a flat bench. Many lifters think of this as a companion to the crunch, which targets the upper abdominals more than the lower.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0872.gif" + }, + { + "name": "Russian twist", + "type": "Strength", + "level": "Intermediate", + "description": "The Russian twist is an exercise targeting the abdominals and the obliques. Beginning from a position that resembles stopping midway through a sit-up, it involves twisting side to side. It can be performed with body weight alone or while holding a weight plate or other object. It is performed by alternating sides with each rep and can be done for time or for a specific number of reps as part of the ab-focused portion of any workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0687.gif" + }, + { + "name": "Bear crawl", + "type": "Strength", + "level": "Intermediate", + "description": "The bear crawl is a popular bodyweight crawling exercise. While it looks simple, the bear crawl is an intense full-body movement that targets the cardiovascular system as well as a wide range of muscle groups, the shoulders, core, and legs in particular. It can be done as a full-body warm-up, in short bursts for power or circuit training, or for longer durations as cardiovascular conditioning.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3360.gif" + }, + { + "name": "Shoulder tap", + "type": "Strength", + "level": "Intermediate", + "description": "The shoulder tap is an exercise targeting the abdominals and core. The basic stance matches the top of a push-up position. From there, one hand is raised to tap its opposing shoulder. A tap with each hand to each opposing shoulder equals one rep.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3699.gif" + }, + { + "name": "Push-up to side plank", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up to side plank is an upper-body and core-focused exercise combining two popular bodyweight movements. It targets the chest, triceps, and shoulders with the push-up, and the obliques and hip external rotator muscles with the side plank. It can be performed as part of a dynamic warm-up or any bodyweight strength-training workout.", + "body_part": "Abdominals", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0664.gif" + }, + { + "name": "Decline sit-up", + "type": "Strength", + "level": "Intermediate", + "description": "The decline sit-up is a bodyweight core exercise that works the rectus abdominis or \"six pack\" muscles. Sit-up variations are usually performed for moderate to high reps, such as 10-15 reps per set or more, as part of the core-focused portion of a workout.", + "body_part": "Abdominals", + "equipment": "None", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0282.gif" + }, + { + "name": "Barbell Curl", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell curl is an arm exercise that is also one of the most recognizable movements in all of bodybuilding and fitness. It helps build sleeve-popping biceps and allows heavier loading than many other curl variations. It is usually performed in moderate to high reps, such as 8-12 reps per set, as part of the arm-focused portion of any workout.", + "body_part": "Biceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0031.gif" + }, + { + "name": "Dumbbell preacher curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell preacher curl is an exercise that focuses on building the biceps, particularly the biceps peak. All you need is a pair of dumbbells and a preacher bench. It's usually performed for moderate to high reps as part of an upper-body or arms-focused workout.", + "body_part": "Biceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0372.gif" + }, + { + "name": "Dumbbell biceps curl", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell biceps curl is a single-joint exercise for building bigger and stronger biceps. Popular among gym goers of all experience levels, this move can be done seated or standing. It is generally performed for moderate to high reps, such as 8-12 reps or higher, as part of the arm-focused portion of a workout.", + "body_part": "Biceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0294.gif" + }, + { + "name": "Weighted donkey calf raise", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted donkey calk raise is a strength and muscle-building exercise focused on the muscles of the lower leg, most prominently the gastrocnemius muscle. While traditional donkey calf raises involved either a specific machine or carrying another person on one's back, this method uses a weight belt. It can be done in traditional muscle-building rep ranges, or for higher reps as part of lower-body training.", + "body_part": "Calves", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0833.gif" + }, + { + "name": "Kettlebell plyo push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell plyo push-up is an explosive upper-body movement that uses a kettlebell primarily as a platform for the hands. A short step, dumbbell, or other stationary object could also be used in place of the kettlebell. It can be performed for reps or time, either for low reps to build explosive power or for higher reps for conditioning.", + "body_part": "Chest", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0545.gif" + }, + { + "name": "Incline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The hands-elevated push-up is a variation on the push-up, a body-weight standard. The hands are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0493.gif" + }, + { + "name": "Decline Push-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The feet-elevated push-up is a variation on the push-up, a body-weight standard. The feet are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0279.gif" + }, + { + "name": "Isometric Wipers", + "type": "Strength", + "level": "Beginner", + "description": "The typewriter push-up is an advanced push-up variation where the hands are extra wide and you lower toward each hand in alternating reps. It is more challenging to each working arm than traditional push-ups and also stretches and challenges the chest.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0500.gif" + }, + { + "name": "Clock push-up", + "type": "Strength", + "level": "Beginner", + "description": "The clock push-up is a series of regular push-ups performed one at a time, moving your hands one step to the side between each one until you've completed a full circle. It targets the same muscles as traditional push-ups, such as the chest, triceps, and shoulders, but adds an endurance and core challenge to traditional push-ups.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0258.gif" + }, + { + "name": "Suspended push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended push-up is a bodyweight pushing exercise performed on a suspension strap system or gymnastic rings. It targets the chest, shoulders, and triceps, but is also challenging to the core and upper back. It can work in traditional strength and muscle-building rep ranges or for higher reps.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0806.gif" + }, + { + "name": "Diamond push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The diamond push-up is an advanced variation of the push-up exercise performed with the hands in a diamond shape. It increases the challenge to the triceps, but also targets the chest and shoulders.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0283.gif" + }, + { + "name": "Push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The push-up is a popular bodyweight exercise that is commonly used in military and tactical physical fitness tests. It’s a classic movement to build upper-body muscle and strength, emphasizing the chest, triceps, and shoulders, but also working the upper back and core.", + "body_part": "Chest", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0662.gif" + }, + { + "name": "Medicine Ball Chest Pass", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The medicine ball pass is a simple partner-based exercise that involves throwing a weighted ball back-and-forth. It can be part of a dynamic warm-up for lifting or athletics, but can also work as active rest or as a component of circuit training.", + "body_part": "Chest", + "equipment": "Medicine Ball", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1302.gif" + }, + { + "name": "Dumbbell Bench Press", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell bench press is a mainstay of workout enthusiasts worldwide. It’s a classic move for building a bigger, stronger chest. As such, it’s often placed first in mass-building chest workouts.", + "body_part": "Chest", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0289.gif" + }, + { + "name": "Chest dip", + "type": "Strength", + "level": "Intermediate", + "description": "The chest dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the chest, triceps, and shoulders. Dips with a chest focus are usually performed with the torso leaning forward and the elbows angled out from the torso. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Chest", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0251.gif" + }, + { + "name": "Barbell glute bridge", + "type": "Powerlifting", + "level": "Intermediate", + "description": "The barbell glute bridge is a popular exercise targeting the muscles of the glutes and hamstrings. It can be done as a strength movement on its own, as an activation drill or warm-up for lower-body training, or as a burnout at the end of a lower-body workout.", + "body_part": "Glutes", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1409.gif" + }, + { + "name": "Kettlebell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell thruster is a popular kettlebell movement that combines a kettlebell front squat with a kettlebell press, while holding the bell in a goblet or bottoms-up grip. It is preceded by a clean at the start of each set, and you can perform a clean between each rep if you choose. It can be trained in traditional strength or muscle-building rep ranges, in circuit or fat-loss training, or as part of a larger kettlebell combination or complex.", + "body_part": "Glutes", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0550.gif" + }, + { + "name": "Walking lunge", + "type": "Strength", + "level": "Intermediate", + "description": "The walking lunge is a lower-body exercise that targets the glutes, quads, and hamstrings while challenging stability and balance. It can be performed for reps, time, or distance in the lower-body portion of any workout.", + "body_part": "Glutes", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1460.gif" + }, + { + "name": "Barbell Deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell deadlift is a compound exercise used to develop overall strength and size in the posterior chain. It is a competition lift in the sport of powerlifting, but is also considered a classic benchmark of overall strength. When performed with the hands outside the knees, it is often called a \"conventional\" deadlift. When the feet are wide and the hands are inside the knees, it is a sumo deadlift.", + "body_part": "Hamstrings", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0032.gif" + }, + { + "name": "Power clean", + "type": "Strength", + "level": "Intermediate", + "description": "The power clean is a full-body movement in which the bar is pulled from the floor and caught in the front rack position in three pulls or phases. The bar is received in the \"power\" position, with the hips higher than a full-depth squat position. The power clean can be used as a component of the clean and press or clean and jerk, but is also a valuable lift to build explosive power and strength.", + "body_part": "Hamstrings", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0648.gif" + }, + { + "name": "Inchworm", + "type": "Stretching", + "level": "Beginner", + "description": "The inchworm is a popular bodyweight exercise that involves “walking” the hands on the floor from a bent-over toe-touch position into a straight-arm plank. It is usually performed as part of a dynamic warm-up to help raise core body temperature and “limber up” the body from head to toe.", + "body_part": "Hamstrings", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1471.gif" + }, + { + "name": "Weighted pull-up", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted pull-up is a more advanced variation of the pull-up exercise in which the lifter adds extra weight to their body. Options for adding weight include a dip belt, weighted vest, chains, a dumbbell placed between the feet or legs, or looping a kettlebell over the foot. Like other pull-up variations, the weighted pull-up builds strength and muscle in the upper back, biceps, and core.", + "body_part": "Lats", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0841.gif" + }, + { + "name": "Pull-up", + "type": "Strength", + "level": "Beginner", + "description": "The pull-up is a multijoint bodyweight exercise that builds strength and muscle in the upper back, biceps, and core. It is often used as a measurement tool in military or tactical fitness tests, and is an excellent gauge of \"relative strength\" which is strength in relation to body weight.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0652.gif" + }, + { + "name": "Rope climb", + "type": "Strength", + "level": "Intermediate", + "description": "The rope climb is an exercise that is used commonly in CrossFit workouts and as a test of upper-body strength. It was even contested at the Olympics in the early 20th century. It targets a wide range of upper-body musculature, including the hands and forearms, shoulders, biceps, lats (latissimus dorsi), and core.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0680.gif" + }, + { + "name": "Chin-Up", + "type": "Strength", + "level": "Intermediate", + "description": "The a chin-up is a variation of the pull-up exercise in which the reps are performed with the palms facing toward the body, in an underhand position, with a grip that is narrower than shoulder-width. Like other pull-up variations, it builds strength and muscle in the upper back, biceps, and core, but it utilizes the biceps slightly more than overhand pull-ups. It can be used as a more shoulder-friendly alternative to straight-bar pull-ups, or to help perform more reps than you can perform overhand.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1326.gif" + }, + { + "name": "Iron cross stretch", + "type": "Strength", + "level": "Intermediate", + "description": "The iron cross stretch is a bodyweight stretch that focuses on hip and thoracic spine mobility.", + "body_part": "Lats", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1419.gif" + }, + { + "name": "Barbell good morning", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell good morning is an exercise that targets glute, hamstring, and lower back development. It is often trained as an accessory movement to the deadlift, but also has value on its own. It is sometimes performed for reps in traditional strength-focused rep ranges such as 5-8 reps per set, but due to the risk posed to the lower back, is rarely treated as a max-effort single-rep lift.", + "body_part": "Lower Back", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0044.gif" + }, + { + "name": "Kettlebell alternating renegade row", + "type": "Strength", + "level": "Intermediate", + "description": "The kettlebell alternating renegade row combines rowing and core training into a single difficult movement. It's popular in time-efficient strength and muscle-building workouts, as well as in circuit-style training.", + "body_part": "Middle Back", + "equipment": "Kettlebells", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0521.gif" + }, + { + "name": "Suspended row", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended row is a bodyweight pulling exercise that focuses on the muscles of the middle and upper back, as well as the biceps. It can be trained in traditional muscle-building rep ranges or for higher reps. It can also work as part of a dynamic warm-up for a pressing or pulling-focused workout.", + "body_part": "Middle Back", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0808.gif" + }, + { + "name": "Barbell shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell shrug is an exercise targeting the traps (trapezius muscles). It is popular in strength and muscle-focused upper-body training, and is often trained on a shoulder day. With the assistance of straps, it can be loaded heavily, but it is still usually performed for moderate to high reps, such as 8-10 reps per set.", + "body_part": "Traps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0095.gif" + }, + { + "name": "Cable shrug", + "type": "Strength", + "level": "Intermediate", + "description": "The cable shrug is an exercise targeting the traps, as well as hitting the shoulders and upper back. Cables allow for lighter loading which is beneficial for higher-rep sets.", + "body_part": "Traps", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0220.gif" + }, + { + "name": "Barbell Full Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell back squat is a popular compound movement that emphasizes building the lower-body muscle groups and overall strength. It's the classic way to start a leg day, and is a worthy centerpiece to a lower-body training program. The squat is a competitive lift in the sport of powerlifting, but is also a classic measurement of lower-body strength. With the barbell racked on the traps or upper back, the emphasis is placed on the posterior chain but the entire body gets worked. The back squat can be trained in everything from heavy singles to sets of 20 reps or higher.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0043.gif" + }, + { + "name": "Barbell front squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front squat is a compound movement that emphasizes building the lower-body muscle groups. With the barbell racked in front of the body on the anterior delts, the front squat emphasizes the quads and glutes, but also upper back and core strength to remain upright. Front squats can be trained as an alternative to back squats, as an accessory movement for either squats or deadlifts, or for strength and muscle on their own. Many lifters and athletes prefer them to back squats, although they can be uncomfortable and difficult to learn at first.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0042.gif" + }, + { + "name": "Barbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0114.gif" + }, + { + "name": "Barbell hack squat", + "type": "Strength", + "level": "Expert", + "description": "The barbell hack squat is a variety of deadlift performed with the barbell behind the legs. This forces the lifter into a body position similar to a squat and targets the quads and glutes. It is named after famed strongman George Hackenschmidt, who performed it as an overall leg-building exercise. The barbell hack squat can be used as a substitute for the machine hack squat, or as a lower-body strength and size movement on its own.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0046.gif" + }, + { + "name": "Barbell thruster", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell thruster is a full-body exercise that incorporates both squatting and pressing in one functional movement. It's especially common in contemporary CrossFit workouts, but also in general strength training. The barbell is usually cleaned into place first, but it could be performed taken from a squat rack in a front-rack position. The thruster can be performed in traditional strength-focused rep ranges to build strength in the press, or in higher reps for full-body conditioning.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/3305.gif" + }, + { + "name": "Barbell side split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell side split squat is a variation of the split squat that targets the lower body, specifically the quads, and requires good hip mobility.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0098.gif" + }, + { + "name": "Barbell speed squat", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell speed squat targets the lower-body muscle groups using lighter weights to perform fast-paced back squats. Speed squats are popular in certain powerlifting training methodologies as a way to engrain form and lifting speed that can carry over to max-effort lifts. In this approach, they are usually performed in numerous sets of 3-5 reps with adequate rest in between. Speed squats are also sometimes performed with bands or chains adding extra resistance to the top half of the lift.", + "body_part": "Quadriceps", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0101.gif" + }, + { + "name": "Dumbbell Goblet Squat", + "type": "Strength", + "level": "Intermediate", + "description": "The goblet squat is a common exercise used in the early stages of learning to squat, or as a movement in general training programs for building size to the quads, glutes, and hamstrings.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1760.gif" + }, + { + "name": "Dumbbell squat", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell squat is a classic lower-body exercise that targets the quadriceps, hamstrings, and glutes. While this variation is usually performed with relatively light weights for high reps, it can also be used as a substitute for squats or the trap-bar deadlift in any workout.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0413.gif" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0431.gif" + }, + { + "name": "Dumbbell deadlift", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell deadlift is a movement that targets the hamstrings, glutes, and back muscles. While it can be performed all the way from the ground, in the style of a barbell deadlift, it is more often performed from the top down as a Romanian deadlift. The dumbbell deadlift can be performed in low rep ranges to build posterior strength, or for moderate to high reps to build muscle and endurance.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0300.gif" + }, + { + "name": "Tire flip", + "type": "Strongman", + "level": "Intermediate", + "description": "The tire flip is an exercise that works the entire body, starting from a deadlift position and ending with a giant tire being flipped over. Each flip moves the tire farther in one direction until a set has been completed. It can be performed for time or reps as part of a functional fitness or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/2459.gif" + }, + { + "name": "Weighted sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted sissy squat is an exercise primarily targeting the quadriceps. In sissy squats, the knees travel over the toes, placing the quads under a fairly extreme stretch. They are usually performed for moderate to high reps as part of a lower-body training session.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0851.gif" + }, + { + "name": "Dumbbell step-up", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "body_part": "Quadriceps", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0431.gif" + }, + { + "name": "Suspended split squat", + "type": "Strength", + "level": "Intermediate", + "description": "The suspended split squat is a single-leg squat variation performed with the rear leg in a suspension strap system. This allows the rear leg to move slightly more naturally than it would be able to on a bench. The exercise targets the quads, hamstring, and glute muscles on the front leg, but also taxes and stretches the quads on the rear leg.", + "body_part": "Quadriceps", + "equipment": "Other", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0809.gif" + }, + { + "name": "Burpee", + "type": "Cardio", + "level": "Intermediate", + "description": "The burpee is a high-intensity exercise that recruits the entire body to build strength and aerobic capacity. It is common in CrossFit workouts and group fitness classes, but can also be performed for time or reps in any fat-loss or athleticism-focused circuit or workout.", + "body_part": "Quadriceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1160.gif" + }, + { + "name": "Jump Squat", + "type": "Plyometrics", + "level": "Intermediate", + "description": "The jump squat is an explosive bodyweight exercise targeting the quads, hamstrings, and glutes. It is also a serious cardiovascular challenge when done for reps. It can be performed as a power exercise to build jumping power, or in any fat-loss or athleticism-focused workout.", + "body_part": "Quadriceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0514.gif" + }, + { + "name": "Sissy squat", + "type": "Strength", + "level": "Intermediate", + "description": "The sissy squat is a bodyweight squat variation that involves letting the knees travel far over the toes, placing an extreme stretch on the quads. This movement targets the quad muscles directly and can be performed in partial or full ranges of motion based on knee health and pain.", + "body_part": "Quadriceps", + "equipment": "None", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/1489.gif" + }, + { + "name": "Band shoulder press", + "type": "Strength", + "level": "Intermediate", + "description": "The band shoulder press is a deltoid exercise and an alternative to the classic dumbbell shoulder press. The dynamic tension of the band forces the core to stabilize the body and more closely matches the strength curve of the shoulder press. It can be performed in low reps, such as 5-8 reps per set, to build shoulder strength, or for higher reps to build muscle and for conditioning. It can work as the main focus of a shoulder day but is also popular as an accessory movement to the bench press or barbell military press.", + "body_part": "Shoulders", + "equipment": "Bands", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0997.gif" + }, + { + "name": "Barbell upright row", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell upright row is a barbell exercise that builds stronger and bigger traps. Many lifters combine this move with either their back or shoulder workout since it involves both body parts.", + "body_part": "Shoulders", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0120.gif" + }, + { + "name": "Barbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The barbell front raise is an upper-body isolation exercise that targets the shoulders. It is usually performed for moderate to high reps, such as 8-12 reps or higher, as part of the shoulder-focused part of any workout.", + "body_part": "Shoulders", + "equipment": "Barbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0041.gif" + }, + { + "name": "Dumbbell front raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell front raise is a single-joint exercise targeting the shoulder muscles, particularly the front or anterior deltoids. It is usually performed for moderate to high reps, at least 8-12 reps per set, as part of an upper-body or shoulder-focused workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0310.gif" + }, + { + "name": "Dumbbell Lying Rear Lateral Raise", + "type": "Strength", + "level": "Intermediate", + "description": "The incline dumbbell reverse fly is an upper-body exercise targeting the posterior or rear deltoids, as well as the postural muscles of the upper back. Because it targets such small muscles, this exercise is usually performed with light weight for high reps, such as 10-15 reps per set or more.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0348.gif" + }, + { + "name": "Dumbbell lateral raise", + "type": "Strength", + "level": "Intermediate", + "description": "The dumbbell lateral raise is a shoulder exercise that targets the medial or middle head of the deltoid muscle. It's a staple strength-training move and is a great option for accessory work on upper-body training days. It is usually performed for moderate to high reps, at least 8-12 reps, as part of the upper-body or shoulder-focused portion of a workout.", + "body_part": "Shoulders", + "equipment": "Dumbbell", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0334.gif" + }, + { + "name": "Cable seated row", + "type": "Strength", + "level": "Intermediate", + "description": "The cable seated row is a popular exercise to train the muscles of the upper back, including the lats (latissimus dorsi), traps, rhomboids, and rear deltoids, using a cable stack. It also targets the biceps to a lesser degree. The cable row can work well in a variety of rep ranges but is most popular in muscle-building workouts or as an accessory movement for strength workouts.", + "body_part": "Shoulders", + "equipment": "Cable", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0861.gif" + }, + { + "name": "Handstand push-up", + "type": "Strength", + "level": "Intermediate", + "description": "The handstand push-up is an exercise targeting the shoulders, although other muscles assist in the completion of the reps. It is common in both CrossFit workouts and advanced bodyweight or calisthenics training. Given the degree of difficulty, beginners will need to progress to this move.", + "body_part": "Shoulders", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0471.gif" + }, + { + "name": "Triceps dip", + "type": "Strength", + "level": "Intermediate", + "description": "The triceps dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the triceps first, but also stretches and strengthens the chest and shoulders. Dips with a triceps focus are usually performed with an upright torso, the knees bent and crossed, and the arms close to the body. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "body_part": "Triceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0814.gif" + }, + { + "name": "Weighted bench dip", + "type": "Strength", + "level": "Intermediate", + "description": "The weighted bench dip is a highly effective exercise for building the triceps. The resistance comes from a combination of body weight and added weight—usually a weight plate.", + "body_part": "Triceps", + "equipment": "Body Only", + "gif_url": "http://d205bpvrqc9yn1.cloudfront.net/0830.gif" + } +] \ No newline at end of file From 6450f9bc9cd38855b9c0f66c7b1e92610c486b95 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:07:00 -0400 Subject: [PATCH 17/22] update --- lib/data/seeds.exs | 774 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 772 insertions(+), 2 deletions(-) diff --git a/lib/data/seeds.exs b/lib/data/seeds.exs index 3fc1e5d..5da59cc 100644 --- a/lib/data/seeds.exs +++ b/lib/data/seeds.exs @@ -31,8 +31,778 @@ defmodule Fitness.Data.Seed do # Parse the JSON exercise data exercise_data = - File.read!("priv/repo/exercises.json") - |> Jason.decode!() + [ + %{ + "body_part" => "Abdominals", + "description" => + "The single-kettlebell windmill is a dynamic kettlebell exercise emphasizing core strength and shoulder and hip mobility and stability. It is often used as a functional warm-up or for multi-directional strength work. It doesn't work as well in a metcon or conditioning setting, and shouldn't be performed under intense fatigue.", + "equipment" => "Kettlebells", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0554.gif", + "level" => "Intermediate", + "name" => "Kettlebell Windmill", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The kettlebell swing is a popular lower-body exercise emphasizing the hamstrings, glutes, and back muscles. It is often used to train explosive power, for aerobic or cardiovascular conditioning, in circuit training, or as an accessory movement for the deadlift.", + "equipment" => "Kettlebells", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0549.gif", + "level" => "Intermediate", + "name" => "Kettlebell swing", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The dumbbell side bend is a popular exercise for targeting the oblique muscles of the abdomen. It is usually performed for relatively high reps, at least 8-12 reps per set or more. It can be performed one side at a time or alternating sides.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0407.gif", + "level" => "Intermediate", + "name" => "Dumbbell side bend", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The barbell press sit-up is a weighted exercise focusing on the abdominal muscles, as well as the shoulders to a lesser degree. It primarily targets the rectus abdominis or \"six-pack\" muscles, but also involves the obliques and deep core muscles. It can be performed on the floor with the feet anchored or unanchored, or on a decline or other bench. It is similar to the Otis-up, which is performed with a weight plate.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0071.gif", + "level" => "Intermediate", + "name" => "Barbell press sit-up", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The cable reverse crunch is performed on the ground facing away from a high pulley, which helps target the lower abdominals specifically.", + "equipment" => "Cable", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0873.gif", + "level" => "Beginner", + "name" => "Cable reverse crunch", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The cocoon crunch is a bodyweight exercise targeting the ab muscles, the rectus abdominis or \"six-pack\" muscles in particular. It involves bringing your knees to your chest and your arms from overhead to center. It can be performed for time or reps as part of the ab-focused portion of any workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0260.gif", + "level" => "Intermediate", + "name" => "Cocoons", + "type" => "Strength" + }, + %{ + "body_part" => "shoulders", + "description" => + "A compound exercise for the shoulders and triceps. Standing with a barbell at shoulder height, press the weight overhead until your arms are fully extended.", + "equipment" => "barbell", + "gif_url" => "https://example.com/overhead-press.gif", + "level" => "intermediate", + "name" => "Overhead Press", + "type" => "strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The decline crunch is an effective core exercise targeting the rectus abdominis.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0277.gif", + "level" => "Intermediate", + "name" => "Decline Crunch", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The hanging oblique crunch an abdominal exercise that targets both the rectus abdominus or “six-pack” muscles, and the oblique muscles. It can be performed hanging from a bar, or if grip strength is a limitation, by placing the elbows in ab straps. If hanging from a straight bar is uncomfortable to the wrists or shoulder, you can also perform them hanging with a neutral grip (palms facing one another)", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1761.gif", + "level" => "Intermediate", + "name" => "Hanging Oblique Knee Raise", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The hanging leg raise is an exercise targeting the abs, but which also works the lats and hip flexors. Instead of resting your forearms on the pads of a captain's chair, you perform these hanging from a bar. Experienced lifters make these look easy, but beginners may need time to build up to sets of 8-12 reps.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0472.gif", + "level" => "Intermediate", + "name" => "Hanging leg raise", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The mountain climber is a popular bodyweight exercise targeting the muscles of the core, as well as the shoulders, hips, and cardiovascular system. It involves lifting one knee to the chest at a time from a straight-arm plank position. It can be performed for time or reps as part of a dynamic warm-up, for bodyweight cardio or conditioning, or as no-equipment dynamic core training.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0630.gif", + "level" => "Intermediate", + "name" => "Mountain climber", + "type" => "Plyometrics" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The 3/4 sit-up is a bodyweight exercise focused on the muscles of the core. It is similar to a sit-up, but stops short of the top position. This keeps constant tension on the abs, making it more difficult than traditional sit-ups. It can be performed for time or for reps, with the feet anchored or free, as part of the ab-focused portion of any workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0001.gif", + "level" => "Intermediate", + "name" => "3/4 sit-up", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The reverse crunch is a popular exercise targeting the abdominals, particularly the lower half. It’s easy to perform on either the floor or a flat bench. Many lifters think of this as a companion to the crunch, which targets the upper abdominals more than the lower.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0872.gif", + "level" => "Intermediate", + "name" => "Reverse crunch", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The Russian twist is an exercise targeting the abdominals and the obliques. Beginning from a position that resembles stopping midway through a sit-up, it involves twisting side to side. It can be performed with body weight alone or while holding a weight plate or other object. It is performed by alternating sides with each rep and can be done for time or for a specific number of reps as part of the ab-focused portion of any workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0687.gif", + "level" => "Intermediate", + "name" => "Russian twist", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The bear crawl is a popular bodyweight crawling exercise. While it looks simple, the bear crawl is an intense full-body movement that targets the cardiovascular system as well as a wide range of muscle groups, the shoulders, core, and legs in particular. It can be done as a full-body warm-up, in short bursts for power or circuit training, or for longer durations as cardiovascular conditioning.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/3360.gif", + "level" => "Intermediate", + "name" => "Bear crawl", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The shoulder tap is an exercise targeting the abdominals and core. The basic stance matches the top of a push-up position. From there, one hand is raised to tap its opposing shoulder. A tap with each hand to each opposing shoulder equals one rep.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/3699.gif", + "level" => "Intermediate", + "name" => "Shoulder tap", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The push-up to side plank is an upper-body and core-focused exercise combining two popular bodyweight movements. It targets the chest, triceps, and shoulders with the push-up, and the obliques and hip external rotator muscles with the side plank. It can be performed as part of a dynamic warm-up or any bodyweight strength-training workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0664.gif", + "level" => "Intermediate", + "name" => "Push-up to side plank", + "type" => "Strength" + }, + %{ + "body_part" => "Abdominals", + "description" => + "The decline sit-up is a bodyweight core exercise that works the rectus abdominis or \"six pack\" muscles. Sit-up variations are usually performed for moderate to high reps, such as 10-15 reps per set or more, as part of the core-focused portion of a workout.", + "equipment" => "None", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0282.gif", + "level" => "Intermediate", + "name" => "Decline sit-up", + "type" => "Strength" + }, + %{ + "body_part" => "Biceps", + "description" => + "The barbell curl is an arm exercise that is also one of the most recognizable movements in all of bodybuilding and fitness. It helps build sleeve-popping biceps and allows heavier loading than many other curl variations. It is usually performed in moderate to high reps, such as 8-12 reps per set, as part of the arm-focused portion of any workout.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0031.gif", + "level" => "Intermediate", + "name" => "Barbell Curl", + "type" => "Strength" + }, + %{ + "body_part" => "Biceps", + "description" => + "The dumbbell preacher curl is an exercise that focuses on building the biceps, particularly the biceps peak. All you need is a pair of dumbbells and a preacher bench. It's usually performed for moderate to high reps as part of an upper-body or arms-focused workout.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0372.gif", + "level" => "Intermediate", + "name" => "Dumbbell preacher curl", + "type" => "Strength" + }, + %{ + "body_part" => "Biceps", + "description" => + "The dumbbell biceps curl is a single-joint exercise for building bigger and stronger biceps. Popular among gym goers of all experience levels, this move can be done seated or standing. It is generally performed for moderate to high reps, such as 8-12 reps or higher, as part of the arm-focused portion of a workout.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0294.gif", + "level" => "Intermediate", + "name" => "Dumbbell biceps curl", + "type" => "Strength" + }, + %{ + "body_part" => "Calves", + "description" => + "The weighted donkey calk raise is a strength and muscle-building exercise focused on the muscles of the lower leg, most prominently the gastrocnemius muscle. While traditional donkey calf raises involved either a specific machine or carrying another person on one's back, this method uses a weight belt. It can be done in traditional muscle-building rep ranges, or for higher reps as part of lower-body training.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0833.gif", + "level" => "Intermediate", + "name" => "Weighted donkey calf raise", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The kettlebell plyo push-up is an explosive upper-body movement that uses a kettlebell primarily as a platform for the hands. A short step, dumbbell, or other stationary object could also be used in place of the kettlebell. It can be performed for reps or time, either for low reps to build explosive power or for higher reps for conditioning.", + "equipment" => "Kettlebells", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0545.gif", + "level" => "Intermediate", + "name" => "Kettlebell plyo push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The hands-elevated push-up is a variation on the push-up, a body-weight standard. The hands are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0493.gif", + "level" => "Intermediate", + "name" => "Incline Push-Up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The feet-elevated push-up is a variation on the push-up, a body-weight standard. The feet are elevated, so that your body is aligned at an angle to the floor rather than parallel.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0279.gif", + "level" => "Intermediate", + "name" => "Decline Push-Up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The typewriter push-up is an advanced push-up variation where the hands are extra wide and you lower toward each hand in alternating reps. It is more challenging to each working arm than traditional push-ups and also stretches and challenges the chest.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0500.gif", + "level" => "Beginner", + "name" => "Isometric Wipers", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The clock push-up is a series of regular push-ups performed one at a time, moving your hands one step to the side between each one until you've completed a full circle. It targets the same muscles as traditional push-ups, such as the chest, triceps, and shoulders, but adds an endurance and core challenge to traditional push-ups.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0258.gif", + "level" => "Beginner", + "name" => "Clock push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The suspended push-up is a bodyweight pushing exercise performed on a suspension strap system or gymnastic rings. It targets the chest, shoulders, and triceps, but is also challenging to the core and upper back. It can work in traditional strength and muscle-building rep ranges or for higher reps.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0806.gif", + "level" => "Intermediate", + "name" => "Suspended push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The diamond push-up is an advanced variation of the push-up exercise performed with the hands in a diamond shape. It increases the challenge to the triceps, but also targets the chest and shoulders.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0283.gif", + "level" => "Intermediate", + "name" => "Diamond push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The push-up is a popular bodyweight exercise that is commonly used in military and tactical physical fitness tests. It’s a classic movement to build upper-body muscle and strength, emphasizing the chest, triceps, and shoulders, but also working the upper back and core.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0662.gif", + "level" => "Intermediate", + "name" => "Push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The medicine ball pass is a simple partner-based exercise that involves throwing a weighted ball back-and-forth. It can be part of a dynamic warm-up for lifting or athletics, but can also work as active rest or as a component of circuit training.", + "equipment" => "Medicine Ball", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1302.gif", + "level" => "Intermediate", + "name" => "Medicine Ball Chest Pass", + "type" => "Plyometrics" + }, + %{ + "body_part" => "Chest", + "description" => + "The dumbbell bench press is a mainstay of workout enthusiasts worldwide. It’s a classic move for building a bigger, stronger chest. As such, it’s often placed first in mass-building chest workouts.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0289.gif", + "level" => "Intermediate", + "name" => "Dumbbell Bench Press", + "type" => "Strength" + }, + %{ + "body_part" => "Chest", + "description" => + "The chest dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the chest, triceps, and shoulders. Dips with a chest focus are usually performed with the torso leaning forward and the elbows angled out from the torso. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0251.gif", + "level" => "Intermediate", + "name" => "Chest dip", + "type" => "Strength" + }, + %{ + "body_part" => "Glutes", + "description" => + "The barbell glute bridge is a popular exercise targeting the muscles of the glutes and hamstrings. It can be done as a strength movement on its own, as an activation drill or warm-up for lower-body training, or as a burnout at the end of a lower-body workout.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1409.gif", + "level" => "Intermediate", + "name" => "Barbell glute bridge", + "type" => "Powerlifting" + }, + %{ + "body_part" => "Glutes", + "description" => + "The kettlebell thruster is a popular kettlebell movement that combines a kettlebell front squat with a kettlebell press, while holding the bell in a goblet or bottoms-up grip. It is preceded by a clean at the start of each set, and you can perform a clean between each rep if you choose. It can be trained in traditional strength or muscle-building rep ranges, in circuit or fat-loss training, or as part of a larger kettlebell combination or complex.", + "equipment" => "Kettlebells", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0550.gif", + "level" => "Intermediate", + "name" => "Kettlebell thruster", + "type" => "Strength" + }, + %{ + "body_part" => "Glutes", + "description" => + "The walking lunge is a lower-body exercise that targets the glutes, quads, and hamstrings while challenging stability and balance. It can be performed for reps, time, or distance in the lower-body portion of any workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1460.gif", + "level" => "Intermediate", + "name" => "Walking lunge", + "type" => "Strength" + }, + %{ + "body_part" => "Hamstrings", + "description" => + "The barbell deadlift is a compound exercise used to develop overall strength and size in the posterior chain. It is a competition lift in the sport of powerlifting, but is also considered a classic benchmark of overall strength. When performed with the hands outside the knees, it is often called a \"conventional\" deadlift. When the feet are wide and the hands are inside the knees, it is a sumo deadlift.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0032.gif", + "level" => "Intermediate", + "name" => "Barbell Deadlift", + "type" => "Strength" + }, + %{ + "body_part" => "Hamstrings", + "description" => + "The power clean is a full-body movement in which the bar is pulled from the floor and caught in the front rack position in three pulls or phases. The bar is received in the \"power\" position, with the hips higher than a full-depth squat position. The power clean can be used as a component of the clean and press or clean and jerk, but is also a valuable lift to build explosive power and strength.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0648.gif", + "level" => "Intermediate", + "name" => "Power clean", + "type" => "Strength" + }, + %{ + "body_part" => "Hamstrings", + "description" => + "The inchworm is a popular bodyweight exercise that involves “walking” the hands on the floor from a bent-over toe-touch position into a straight-arm plank. It is usually performed as part of a dynamic warm-up to help raise core body temperature and “limber up” the body from head to toe.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1471.gif", + "level" => "Beginner", + "name" => "Inchworm", + "type" => "Stretching" + }, + %{ + "body_part" => "Lats", + "description" => + "The weighted pull-up is a more advanced variation of the pull-up exercise in which the lifter adds extra weight to their body. Options for adding weight include a dip belt, weighted vest, chains, a dumbbell placed between the feet or legs, or looping a kettlebell over the foot. Like other pull-up variations, the weighted pull-up builds strength and muscle in the upper back, biceps, and core.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0841.gif", + "level" => "Intermediate", + "name" => "Weighted pull-up", + "type" => "Strength" + }, + %{ + "body_part" => "Lats", + "description" => + "The pull-up is a multijoint bodyweight exercise that builds strength and muscle in the upper back, biceps, and core. It is often used as a measurement tool in military or tactical fitness tests, and is an excellent gauge of \"relative strength\" which is strength in relation to body weight.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0652.gif", + "level" => "Beginner", + "name" => "Pull-up", + "type" => "Strength" + }, + %{ + "body_part" => "Lats", + "description" => + "The rope climb is an exercise that is used commonly in CrossFit workouts and as a test of upper-body strength. It was even contested at the Olympics in the early 20th century. It targets a wide range of upper-body musculature, including the hands and forearms, shoulders, biceps, lats (latissimus dorsi), and core.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0680.gif", + "level" => "Intermediate", + "name" => "Rope climb", + "type" => "Strength" + }, + %{ + "body_part" => "Lats", + "description" => + "The a chin-up is a variation of the pull-up exercise in which the reps are performed with the palms facing toward the body, in an underhand position, with a grip that is narrower than shoulder-width. Like other pull-up variations, it builds strength and muscle in the upper back, biceps, and core, but it utilizes the biceps slightly more than overhand pull-ups. It can be used as a more shoulder-friendly alternative to straight-bar pull-ups, or to help perform more reps than you can perform overhand.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1326.gif", + "level" => "Intermediate", + "name" => "Chin-Up", + "type" => "Strength" + }, + %{ + "body_part" => "Lats", + "description" => + "The iron cross stretch is a bodyweight stretch that focuses on hip and thoracic spine mobility.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1419.gif", + "level" => "Intermediate", + "name" => "Iron cross stretch", + "type" => "Strength" + }, + %{ + "body_part" => "Lower Back", + "description" => + "The barbell good morning is an exercise that targets glute, hamstring, and lower back development. It is often trained as an accessory movement to the deadlift, but also has value on its own. It is sometimes performed for reps in traditional strength-focused rep ranges such as 5-8 reps per set, but due to the risk posed to the lower back, is rarely treated as a max-effort single-rep lift.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0044.gif", + "level" => "Intermediate", + "name" => "Barbell good morning", + "type" => "Strength" + }, + %{ + "body_part" => "Middle Back", + "description" => + "The kettlebell alternating renegade row combines rowing and core training into a single difficult movement. It's popular in time-efficient strength and muscle-building workouts, as well as in circuit-style training.", + "equipment" => "Kettlebells", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0521.gif", + "level" => "Intermediate", + "name" => "Kettlebell alternating renegade row", + "type" => "Strength" + }, + %{ + "body_part" => "Middle Back", + "description" => + "The suspended row is a bodyweight pulling exercise that focuses on the muscles of the middle and upper back, as well as the biceps. It can be trained in traditional muscle-building rep ranges or for higher reps. It can also work as part of a dynamic warm-up for a pressing or pulling-focused workout.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0808.gif", + "level" => "Intermediate", + "name" => "Suspended row", + "type" => "Strength" + }, + %{ + "body_part" => "Traps", + "description" => + "The barbell shrug is an exercise targeting the traps (trapezius muscles). It is popular in strength and muscle-focused upper-body training, and is often trained on a shoulder day. With the assistance of straps, it can be loaded heavily, but it is still usually performed for moderate to high reps, such as 8-10 reps per set.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0095.gif", + "level" => "Intermediate", + "name" => "Barbell shrug", + "type" => "Strength" + }, + %{ + "body_part" => "Traps", + "description" => + "The cable shrug is an exercise targeting the traps, as well as hitting the shoulders and upper back. Cables allow for lighter loading which is beneficial for higher-rep sets.", + "equipment" => "Cable", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0220.gif", + "level" => "Intermediate", + "name" => "Cable shrug", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell back squat is a popular compound movement that emphasizes building the lower-body muscle groups and overall strength. It's the classic way to start a leg day, and is a worthy centerpiece to a lower-body training program. The squat is a competitive lift in the sport of powerlifting, but is also a classic measurement of lower-body strength. With the barbell racked on the traps or upper back, the emphasis is placed on the posterior chain but the entire body gets worked. The back squat can be trained in everything from heavy singles to sets of 20 reps or higher.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0043.gif", + "level" => "Intermediate", + "name" => "Barbell Full Squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell front squat is a compound movement that emphasizes building the lower-body muscle groups. With the barbell racked in front of the body on the anterior delts, the front squat emphasizes the quads and glutes, but also upper back and core strength to remain upright. Front squats can be trained as an alternative to back squats, as an accessory movement for either squats or deadlifts, or for strength and muscle on their own. Many lifters and athletes prefer them to back squats, although they can be uncomfortable and difficult to learn at first.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0042.gif", + "level" => "Intermediate", + "name" => "Barbell front squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0114.gif", + "level" => "Intermediate", + "name" => "Barbell step-up", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell hack squat is a variety of deadlift performed with the barbell behind the legs. This forces the lifter into a body position similar to a squat and targets the quads and glutes. It is named after famed strongman George Hackenschmidt, who performed it as an overall leg-building exercise. The barbell hack squat can be used as a substitute for the machine hack squat, or as a lower-body strength and size movement on its own.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0046.gif", + "level" => "Expert", + "name" => "Barbell hack squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell thruster is a full-body exercise that incorporates both squatting and pressing in one functional movement. It's especially common in contemporary CrossFit workouts, but also in general strength training. The barbell is usually cleaned into place first, but it could be performed taken from a squat rack in a front-rack position. The thruster can be performed in traditional strength-focused rep ranges to build strength in the press, or in higher reps for full-body conditioning.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/3305.gif", + "level" => "Intermediate", + "name" => "Barbell thruster", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell side split squat is a variation of the split squat that targets the lower body, specifically the quads, and requires good hip mobility.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0098.gif", + "level" => "Intermediate", + "name" => "Barbell side split squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The barbell speed squat targets the lower-body muscle groups using lighter weights to perform fast-paced back squats. Speed squats are popular in certain powerlifting training methodologies as a way to engrain form and lifting speed that can carry over to max-effort lifts. In this approach, they are usually performed in numerous sets of 3-5 reps with adequate rest in between. Speed squats are also sometimes performed with bands or chains adding extra resistance to the top half of the lift.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0101.gif", + "level" => "Intermediate", + "name" => "Barbell speed squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The goblet squat is a common exercise used in the early stages of learning to squat, or as a movement in general training programs for building size to the quads, glutes, and hamstrings.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1760.gif", + "level" => "Intermediate", + "name" => "Dumbbell Goblet Squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The dumbbell squat is a classic lower-body exercise that targets the quadriceps, hamstrings, and glutes. While this variation is usually performed with relatively light weights for high reps, it can also be used as a substitute for squats or the trap-bar deadlift in any workout.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0413.gif", + "level" => "Intermediate", + "name" => "Dumbbell squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0431.gif", + "level" => "Intermediate", + "name" => "Dumbbell step-up", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The dumbbell deadlift is a movement that targets the hamstrings, glutes, and back muscles. While it can be performed all the way from the ground, in the style of a barbell deadlift, it is more often performed from the top down as a Romanian deadlift. The dumbbell deadlift can be performed in low rep ranges to build posterior strength, or for moderate to high reps to build muscle and endurance.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0300.gif", + "level" => "Intermediate", + "name" => "Dumbbell deadlift", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The tire flip is an exercise that works the entire body, starting from a deadlift position and ending with a giant tire being flipped over. Each flip moves the tire farther in one direction until a set has been completed. It can be performed for time or reps as part of a functional fitness or athleticism-focused workout.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/2459.gif", + "level" => "Intermediate", + "name" => "Tire flip", + "type" => "Strongman" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The weighted sissy squat is an exercise primarily targeting the quadriceps. In sissy squats, the knees travel over the toes, placing the quads under a fairly extreme stretch. They are usually performed for moderate to high reps as part of a lower-body training session.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0851.gif", + "level" => "Intermediate", + "name" => "Weighted sissy squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The dumbbell step-up is a great exercise for building lower-body strength and power. It targets all the same muscles as bodyweight step-ups, such as the quads, glutes, and hamstrings, but allows for greater muscular overload.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0431.gif", + "level" => "Intermediate", + "name" => "Dumbbell step-up", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The suspended split squat is a single-leg squat variation performed with the rear leg in a suspension strap system. This allows the rear leg to move slightly more naturally than it would be able to on a bench. The exercise targets the quads, hamstring, and glute muscles on the front leg, but also taxes and stretches the quads on the rear leg.", + "equipment" => "Other", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0809.gif", + "level" => "Intermediate", + "name" => "Suspended split squat", + "type" => "Strength" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The burpee is a high-intensity exercise that recruits the entire body to build strength and aerobic capacity. It is common in CrossFit workouts and group fitness classes, but can also be performed for time or reps in any fat-loss or athleticism-focused circuit or workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1160.gif", + "level" => "Intermediate", + "name" => "Burpee", + "type" => "Cardio" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The jump squat is an explosive bodyweight exercise targeting the quads, hamstrings, and glutes. It is also a serious cardiovascular challenge when done for reps. It can be performed as a power exercise to build jumping power, or in any fat-loss or athleticism-focused workout.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0514.gif", + "level" => "Intermediate", + "name" => "Jump Squat", + "type" => "Plyometrics" + }, + %{ + "body_part" => "Quadriceps", + "description" => + "The sissy squat is a bodyweight squat variation that involves letting the knees travel far over the toes, placing an extreme stretch on the quads. This movement targets the quad muscles directly and can be performed in partial or full ranges of motion based on knee health and pain.", + "equipment" => "None", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/1489.gif", + "level" => "Intermediate", + "name" => "Sissy squat", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The band shoulder press is a deltoid exercise and an alternative to the classic dumbbell shoulder press. The dynamic tension of the band forces the core to stabilize the body and more closely matches the strength curve of the shoulder press. It can be performed in low reps, such as 5-8 reps per set, to build shoulder strength, or for higher reps to build muscle and for conditioning. It can work as the main focus of a shoulder day but is also popular as an accessory movement to the bench press or barbell military press.", + "equipment" => "Bands", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0997.gif", + "level" => "Intermediate", + "name" => "Band shoulder press", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The barbell upright row is a barbell exercise that builds stronger and bigger traps. Many lifters combine this move with either their back or shoulder workout since it involves both body parts.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0120.gif", + "level" => "Intermediate", + "name" => "Barbell upright row", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The barbell front raise is an upper-body isolation exercise that targets the shoulders. It is usually performed for moderate to high reps, such as 8-12 reps or higher, as part of the shoulder-focused part of any workout.", + "equipment" => "Barbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0041.gif", + "level" => "Intermediate", + "name" => "Barbell front raise", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The dumbbell front raise is a single-joint exercise targeting the shoulder muscles, particularly the front or anterior deltoids. It is usually performed for moderate to high reps, at least 8-12 reps per set, as part of an upper-body or shoulder-focused workout.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0310.gif", + "level" => "Intermediate", + "name" => "Dumbbell front raise", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The incline dumbbell reverse fly is an upper-body exercise targeting the posterior or rear deltoids, as well as the postural muscles of the upper back. Because it targets such small muscles, this exercise is usually performed with light weight for high reps, such as 10-15 reps per set or more.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0348.gif", + "level" => "Intermediate", + "name" => "Dumbbell Lying Rear Lateral Raise", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The dumbbell lateral raise is a shoulder exercise that targets the medial or middle head of the deltoid muscle. It's a staple strength-training move and is a great option for accessory work on upper-body training days. It is usually performed for moderate to high reps, at least 8-12 reps, as part of the upper-body or shoulder-focused portion of a workout.", + "equipment" => "Dumbbell", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0334.gif", + "level" => "Intermediate", + "name" => "Dumbbell lateral raise", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The cable seated row is a popular exercise to train the muscles of the upper back, including the lats (latissimus dorsi), traps, rhomboids, and rear deltoids, using a cable stack. It also targets the biceps to a lesser degree. The cable row can work well in a variety of rep ranges but is most popular in muscle-building workouts or as an accessory movement for strength workouts.", + "equipment" => "Cable", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0861.gif", + "level" => "Intermediate", + "name" => "Cable seated row", + "type" => "Strength" + }, + %{ + "body_part" => "Shoulders", + "description" => + "The handstand push-up is an exercise targeting the shoulders, although other muscles assist in the completion of the reps. It is common in both CrossFit workouts and advanced bodyweight or calisthenics training. Given the degree of difficulty, beginners will need to progress to this move.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0471.gif", + "level" => "Intermediate", + "name" => "Handstand push-up", + "type" => "Strength" + }, + %{ + "body_part" => "Triceps", + "description" => + "The triceps dip is a bodyweight exercise performed on parallel bars or on a pull-up and dip station. It targets the triceps first, but also stretches and strengthens the chest and shoulders. Dips with a triceps focus are usually performed with an upright torso, the knees bent and crossed, and the arms close to the body. Dips can be performed for low reps for strength or higher reps for muscle growth.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0814.gif", + "level" => "Intermediate", + "name" => "Triceps dip", + "type" => "Strength" + }, + %{ + "body_part" => "Triceps", + "description" => + "The weighted bench dip is a highly effective exercise for building the triceps. The resistance comes from a combination of body weight and added weight—usually a weight plate.", + "equipment" => "Body Only", + "gif_url" => "http://d205bpvrqc9yn1.cloudfront.net/0830.gif", + "level" => "Intermediate", + "name" => "Weighted bench dip", + "type" => "Strength" + } + ] # Create all exercises from the JSON data and build a map for easy lookup exercises_map = %{} From a1e5858265107c47f51076044869545d78f91b30 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:08:46 -0400 Subject: [PATCH 18/22] update --- lib/{ => fitness}/data/exercises.json | 0 lib/{ => fitness}/data/seeds.exs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lib/{ => fitness}/data/exercises.json (100%) rename lib/{ => fitness}/data/seeds.exs (100%) diff --git a/lib/data/exercises.json b/lib/fitness/data/exercises.json similarity index 100% rename from lib/data/exercises.json rename to lib/fitness/data/exercises.json diff --git a/lib/data/seeds.exs b/lib/fitness/data/seeds.exs similarity index 100% rename from lib/data/seeds.exs rename to lib/fitness/data/seeds.exs From 336dcae9a3fca2c880ee8cac5a6596cadaa67480 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:10:14 -0400 Subject: [PATCH 19/22] update --- lib/fitness/data/{seeds.exs => setup.ex} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename lib/fitness/data/{seeds.exs => setup.ex} (99%) diff --git a/lib/fitness/data/seeds.exs b/lib/fitness/data/setup.ex similarity index 99% rename from lib/fitness/data/seeds.exs rename to lib/fitness/data/setup.ex index 5da59cc..bedb80c 100644 --- a/lib/fitness/data/seeds.exs +++ b/lib/fitness/data/setup.ex @@ -1,6 +1,6 @@ # Script to generate workout templates from JSON exercise data # Run with: mix run priv/repo/workout_templates_generator.exs -defmodule Fitness.Data.Seed do +defmodule Fitness.Data.Setup do alias Fitness.Repo alias Fitness.Accounts alias Fitness.Exercises.Exercise From 5fd152866a0f689a0dda9fe8d7528e892fbdafb1 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 15:28:23 -0400 Subject: [PATCH 20/22] update --- config/prod.exs | 2 +- lib/fitness/workout_templates.ex | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/prod.exs b/config/prod.exs index ff98ab3..cde6f31 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -12,7 +12,7 @@ import Config config :fitness, FitnessWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" # Do not print debug messages in production -config :logger, level: :info +config :logger, level: :warning # ## SSL Support # diff --git a/lib/fitness/workout_templates.ex b/lib/fitness/workout_templates.ex index 499ef31..d187bc4 100644 --- a/lib/fitness/workout_templates.ex +++ b/lib/fitness/workout_templates.ex @@ -120,7 +120,6 @@ defmodule Fitness.WorkoutTemplates do iex> change_workout_template(workout_template) %Ecto.Changeset{data: %WorkoutTemplate{}} - """ def change_workout_template(%WorkoutTemplate{} = workout_template, attrs \\ %{}) do WorkoutTemplate.changeset(workout_template, attrs) From 83e49dfc4b09b5ca002718f57412093b1920ac53 Mon Sep 17 00:00:00 2001 From: Maqbool Date: Wed, 7 May 2025 17:24:15 -0400 Subject: [PATCH 21/22] update --- lib/fitness_web/absinthe_metrics.ex | 75 +++++++++++++++++++++++++++++ lib/fitness_web/telemetry.ex | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 lib/fitness_web/absinthe_metrics.ex diff --git a/lib/fitness_web/absinthe_metrics.ex b/lib/fitness_web/absinthe_metrics.ex new file mode 100644 index 0000000..14cb08a --- /dev/null +++ b/lib/fitness_web/absinthe_metrics.ex @@ -0,0 +1,75 @@ +defmodule FitnessWeb.AbsintheMetrics do + require Logger + + def setup do + # Attach to the existing Absinthe telemetry events + :telemetry.attach_many( + :absinthe_telemetry, + [ + [:absinthe, :execute, :operation, :start], + [:absinthe, :execute, :operation, :stop], + [:absinthe, :resolve, :field, :start], + [:absinthe, :resolve, :field, :stop], + [:absinthe, :resolve, :field, :exception] + ], + &handle_event/4, + nil + ) + + Logger.info("Absinthe telemetry handlers attached") + end + + # Operation events + defp handle_event([:absinthe, :execute, :operation, :start], _measurements, metadata, _config) do + operation_type = metadata.operation.operation || "unknown" + operation_name = metadata.operation.name || "anonymous" + + Logger.warning("[GraphQL] Starting operation: #{operation_type} #{operation_name}") + end + + defp handle_event([:absinthe, :execute, :operation, :stop], measurements, metadata, _config) do + operation_type = metadata.operation.operation || "unknown" + operation_name = metadata.operation.name || "anonymous" + duration_ms = System.convert_time_unit(measurements.duration, :native, :millisecond) + + Logger.warning("[GraphQL] Completed operation: #{operation_type} #{operation_name} in #{duration_ms}ms") + end + + # Field resolution events + defp handle_event([:absinthe, :resolve, :field, :start], _measurements, _metadata, _config) do + # Skip logging field starts to reduce noise + :ok + end + + defp handle_event([:absinthe, :resolve, :field, :stop], measurements, metadata, _config) do + object_type = metadata.object.identifier + field_name = metadata.field.name + duration_ms = System.convert_time_unit(measurements.duration, :native, :millisecond) + + # Focus on key resolvers and slow resolvers + cond do + # Critical resolvers that we always want to log + {object_type, field_name} == {:workout_template, :workout_items} -> + Logger.warning("[GraphQL] Resolved workout_items for template in #{duration_ms}ms") + + {object_type, field_name} == {:workout_item, :exercise} -> + Logger.warning("[GraphQL] Resolved exercise for workout_item in #{duration_ms}ms") + + # Slow resolvers + duration_ms > 50 -> + Logger.warning("[GraphQL] Slow resolver: #{object_type}.#{field_name} took #{duration_ms}ms") + + # Skip logging fast resolvers + true -> + :ok + end + end + + defp handle_event([:absinthe, :resolve, :field, :exception], _measurements, metadata, _config) do + object_type = metadata.object.identifier + field_name = metadata.field.name + error = inspect(metadata.reason) + + Logger.warning("[GraphQL] Error resolving #{object_type}.#{field_name}: #{error}") + end +end diff --git a/lib/fitness_web/telemetry.ex b/lib/fitness_web/telemetry.ex index 2cec993..ab5c62b 100644 --- a/lib/fitness_web/telemetry.ex +++ b/lib/fitness_web/telemetry.ex @@ -15,7 +15,7 @@ defmodule FitnessWeb.Telemetry do # Add reporters as children of your supervision tree. # {Telemetry.Metrics.ConsoleReporter, metrics: metrics()} ] - + FitnessWeb.AbsintheMetrics.setup() Supervisor.init(children, strategy: :one_for_one) end From 7bf2ac8d440264123017d51d3f159f3b927612bf Mon Sep 17 00:00:00 2001 From: Maqbool Date: Thu, 8 May 2025 10:06:20 -0400 Subject: [PATCH 22/22] update --- lib/fitness_web/absinthe_metrics.ex | 66 ++++++++++++----------------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/lib/fitness_web/absinthe_metrics.ex b/lib/fitness_web/absinthe_metrics.ex index 14cb08a..a70de6e 100644 --- a/lib/fitness_web/absinthe_metrics.ex +++ b/lib/fitness_web/absinthe_metrics.ex @@ -2,74 +2,60 @@ defmodule FitnessWeb.AbsintheMetrics do require Logger def setup do - # Attach to the existing Absinthe telemetry events :telemetry.attach_many( - :absinthe_telemetry, + :absinthe_metrics, [ [:absinthe, :execute, :operation, :start], [:absinthe, :execute, :operation, :stop], [:absinthe, :resolve, :field, :start], - [:absinthe, :resolve, :field, :stop], - [:absinthe, :resolve, :field, :exception] + [:absinthe, :resolve, :field, :stop] ], &handle_event/4, - nil + [] ) Logger.info("Absinthe telemetry handlers attached") end - # Operation events defp handle_event([:absinthe, :execute, :operation, :start], _measurements, metadata, _config) do - operation_type = metadata.operation.operation || "unknown" - operation_name = metadata.operation.name || "anonymous" - - Logger.warning("[GraphQL] Starting operation: #{operation_type} #{operation_name}") + operation_name = get_operation_name_from_metadata(metadata) + Logger.warning("[GraphQL] Starting operation: #{operation_name}") end defp handle_event([:absinthe, :execute, :operation, :stop], measurements, metadata, _config) do - operation_type = metadata.operation.operation || "unknown" - operation_name = metadata.operation.name || "anonymous" + operation_name = get_operation_name_from_metadata(metadata) duration_ms = System.convert_time_unit(measurements.duration, :native, :millisecond) - - Logger.warning("[GraphQL] Completed operation: #{operation_type} #{operation_name} in #{duration_ms}ms") + Logger.warning("[GraphQL] Completed operation: #{operation_name} in #{duration_ms}ms") end - # Field resolution events - defp handle_event([:absinthe, :resolve, :field, :start], _measurements, _metadata, _config) do - # Skip logging field starts to reduce noise - :ok + defp handle_event( [:absinthe, :resolve, :field, :start], _measurements, _metadata, _config) do + + Logger.warning("[GraphQL] Field start resolving") end - defp handle_event([:absinthe, :resolve, :field, :stop], measurements, metadata, _config) do - object_type = metadata.object.identifier - field_name = metadata.field.name + defp handle_event([:absinthe, :resolve, :field, :stop], measurements, _metadata, _config) do duration_ms = System.convert_time_unit(measurements.duration, :native, :millisecond) - # Focus on key resolvers and slow resolvers + Logger.warning("[GraphQL] Field resolved: in #{duration_ms}ms") + end + + defp get_operation_name_from_metadata(metadata) do cond do - # Critical resolvers that we always want to log - {object_type, field_name} == {:workout_template, :workout_items} -> - Logger.warning("[GraphQL] Resolved workout_items for template in #{duration_ms}ms") + # First try params which is most reliable + metadata[:params] && metadata[:params]["operationName"] -> + metadata[:params]["operationName"] - {object_type, field_name} == {:workout_item, :exercise} -> - Logger.warning("[GraphQL] Resolved exercise for workout_item in #{duration_ms}ms") + # Next try options + metadata[:options] && Keyword.get(metadata[:options], :operation_name) -> + Keyword.get(metadata[:options], :operation_name) - # Slow resolvers - duration_ms > 50 -> - Logger.warning("[GraphQL] Slow resolver: #{object_type}.#{field_name} took #{duration_ms}ms") + # Finally try operation if it exists + metadata[:operation] && metadata[:operation][:name] -> + metadata[:operation][:name] - # Skip logging fast resolvers + # Fallback true -> - :ok + "anonymous" end end - - defp handle_event([:absinthe, :resolve, :field, :exception], _measurements, metadata, _config) do - object_type = metadata.object.identifier - field_name = metadata.field.name - error = inspect(metadata.reason) - - Logger.warning("[GraphQL] Error resolving #{object_type}.#{field_name}: #{error}") - end end