Initial commit for Start9 packaging
This commit is contained in:
@@ -0,0 +1,405 @@
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import * as bcryptjs from "bcryptjs";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
interface ExerciseData {
|
||||
name: string;
|
||||
description: string;
|
||||
muscleGroups: string[];
|
||||
type: string;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
// Create default user
|
||||
const hashedPassword = await bcryptjs.hash("workout123", 10);
|
||||
|
||||
const user = await prisma.user.upsert({
|
||||
where: { email: "admin@local" },
|
||||
update: {},
|
||||
create: {
|
||||
email: "admin@local",
|
||||
passwordHash: hashedPassword,
|
||||
name: "Admin User",
|
||||
},
|
||||
});
|
||||
|
||||
console.log("Created/verified user:", user.id);
|
||||
|
||||
// Create user preferences
|
||||
await prisma.userPreferences.upsert({
|
||||
where: { userId: user.id },
|
||||
update: {},
|
||||
create: {
|
||||
userId: user.id,
|
||||
theme: "system",
|
||||
defaultWeightUnit: "lbs",
|
||||
defaultRestSeconds: 90,
|
||||
enableClaudeAI: false,
|
||||
},
|
||||
});
|
||||
|
||||
console.log("Created/verified user preferences");
|
||||
|
||||
// Define exercises by muscle group
|
||||
const exercises: ExerciseData[] = [
|
||||
// Chest
|
||||
{
|
||||
name: "Bench Press",
|
||||
description: "Barbell bench press for chest development",
|
||||
muscleGroups: ["chest", "triceps", "shoulders"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Incline Bench Press",
|
||||
description: "Incline barbell bench press targeting upper chest",
|
||||
muscleGroups: ["chest", "shoulders", "triceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Dumbbell Fly",
|
||||
description: "Chest fly using dumbbells for stretch and squeeze",
|
||||
muscleGroups: ["chest"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Cable Crossover",
|
||||
description: "Cable machine chest fly for constant tension",
|
||||
muscleGroups: ["chest"],
|
||||
type: "cable",
|
||||
},
|
||||
{
|
||||
name: "Push-ups",
|
||||
description: "Bodyweight chest exercise",
|
||||
muscleGroups: ["chest", "triceps", "shoulders"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Dips (Chest)",
|
||||
description: "Weighted or bodyweight dips for chest and triceps",
|
||||
muscleGroups: ["chest", "triceps"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Incline Dumbbell Press",
|
||||
description: "Incline dumbbell bench press for upper chest",
|
||||
muscleGroups: ["chest", "shoulders", "triceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Decline Bench Press",
|
||||
description: "Decline barbell bench press for lower chest emphasis",
|
||||
muscleGroups: ["chest", "triceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
|
||||
// Back
|
||||
{
|
||||
name: "Deadlift",
|
||||
description: "Compound barbell deadlift for full posterior chain",
|
||||
muscleGroups: ["back", "legs", "glutes"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Barbell Row",
|
||||
description: "Barbell bent-over row for back strength",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Pull-ups",
|
||||
description: "Bodyweight pull-ups for back and biceps",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Lat Pulldown",
|
||||
description: "Machine lat pulldown for back width",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Cable Row",
|
||||
description: "Seated cable row for back strength",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "cable",
|
||||
},
|
||||
{
|
||||
name: "T-Bar Row",
|
||||
description: "T-bar row for mid-back thickness",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Dumbbell Row",
|
||||
description: "Single-arm dumbbell row for back development",
|
||||
muscleGroups: ["back", "biceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Face Pulls",
|
||||
description: "Cable face pulls for rear delts and upper back",
|
||||
muscleGroups: ["back", "shoulders"],
|
||||
type: "cable",
|
||||
},
|
||||
|
||||
// Shoulders
|
||||
{
|
||||
name: "Overhead Press",
|
||||
description: "Standing barbell overhead press for shoulder strength",
|
||||
muscleGroups: ["shoulders", "triceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Lateral Raise",
|
||||
description: "Dumbbell lateral raise for shoulder width",
|
||||
muscleGroups: ["shoulders"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Front Raise",
|
||||
description: "Front raise for anterior shoulder development",
|
||||
muscleGroups: ["shoulders"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Reverse Fly",
|
||||
description: "Rear delt fly for posterior shoulder",
|
||||
muscleGroups: ["shoulders", "back"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Arnold Press",
|
||||
description: "Arnold press for full shoulder development",
|
||||
muscleGroups: ["shoulders", "triceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Upright Row",
|
||||
description: "Barbell upright row for shoulder and trap development",
|
||||
muscleGroups: ["shoulders", "traps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Shrugs",
|
||||
description: "Barbell shrugs for trap development",
|
||||
muscleGroups: ["traps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Cable Lateral Raise",
|
||||
description: "Cable lateral raise for shoulder isolation",
|
||||
muscleGroups: ["shoulders"],
|
||||
type: "cable",
|
||||
},
|
||||
|
||||
// Legs
|
||||
{
|
||||
name: "Squat",
|
||||
description: "Barbell back squat for overall leg development",
|
||||
muscleGroups: ["legs", "glutes", "quads"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Front Squat",
|
||||
description: "Front squat with emphasis on quadriceps",
|
||||
muscleGroups: ["quads", "glutes"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Leg Press",
|
||||
description: "Machine leg press for lower body strength",
|
||||
muscleGroups: ["legs", "glutes", "quads"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Romanian Deadlift",
|
||||
description: "RDL for hamstring and lower back development",
|
||||
muscleGroups: ["hamstrings", "glutes", "back"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Leg Curl",
|
||||
description: "Machine leg curl for hamstring isolation",
|
||||
muscleGroups: ["hamstrings"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Leg Extension",
|
||||
description: "Machine leg extension for quadriceps isolation",
|
||||
muscleGroups: ["quads"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Calf Raise",
|
||||
description: "Standing calf raise for calf development",
|
||||
muscleGroups: ["calves"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Bulgarian Split Squat",
|
||||
description: "Single-leg squat variation for leg strength",
|
||||
muscleGroups: ["legs", "glutes", "quads"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Lunges",
|
||||
description: "Dumbbell lunges for unilateral leg development",
|
||||
muscleGroups: ["legs", "glutes", "quads"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Hip Thrust",
|
||||
description: "Barbell hip thrust for glute development",
|
||||
muscleGroups: ["glutes"],
|
||||
type: "barbell",
|
||||
},
|
||||
|
||||
// Arms
|
||||
{
|
||||
name: "Barbell Curl",
|
||||
description: "Barbell curl for bicep strength",
|
||||
muscleGroups: ["biceps"],
|
||||
type: "barbell",
|
||||
},
|
||||
{
|
||||
name: "Dumbbell Curl",
|
||||
description: "Dumbbell bicep curl for arm development",
|
||||
muscleGroups: ["biceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Hammer Curl",
|
||||
description: "Hammer curl for bicep and forearm development",
|
||||
muscleGroups: ["biceps", "forearms"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Tricep Pushdown",
|
||||
description: "Cable tricep pushdown for tricep isolation",
|
||||
muscleGroups: ["triceps"],
|
||||
type: "cable",
|
||||
},
|
||||
{
|
||||
name: "Skull Crusher",
|
||||
description: "Lying tricep extension for tricep development",
|
||||
muscleGroups: ["triceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Overhead Tricep Extension",
|
||||
description: "Standing tricep extension for arm development",
|
||||
muscleGroups: ["triceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
{
|
||||
name: "Preacher Curl",
|
||||
description: "Preacher curl for bicep isolation",
|
||||
muscleGroups: ["biceps"],
|
||||
type: "machine",
|
||||
},
|
||||
{
|
||||
name: "Concentration Curl",
|
||||
description: "Seated concentration curl for bicep peak",
|
||||
muscleGroups: ["biceps"],
|
||||
type: "dumbbell",
|
||||
},
|
||||
|
||||
// Core
|
||||
{
|
||||
name: "Plank",
|
||||
description: "Bodyweight plank for core stability",
|
||||
muscleGroups: ["core", "abs"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Hanging Leg Raise",
|
||||
description: "Hanging leg raise for lower abs",
|
||||
muscleGroups: ["abs", "core"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Cable Crunch",
|
||||
description: "Cable crunch for abdominal development",
|
||||
muscleGroups: ["abs"],
|
||||
type: "cable",
|
||||
},
|
||||
{
|
||||
name: "Ab Wheel Rollout",
|
||||
description: "Ab wheel for core and abs",
|
||||
muscleGroups: ["core", "abs"],
|
||||
type: "other",
|
||||
},
|
||||
{
|
||||
name: "Russian Twist",
|
||||
description: "Russian twist for obliques and core",
|
||||
muscleGroups: ["obliques", "core"],
|
||||
type: "bodyweight",
|
||||
},
|
||||
{
|
||||
name: "Pallof Press",
|
||||
description: "Pallof press for anti-rotation core stability",
|
||||
muscleGroups: ["core", "obliques"],
|
||||
type: "cable",
|
||||
},
|
||||
|
||||
// Cardio
|
||||
{
|
||||
name: "Running",
|
||||
description: "Running for cardiovascular endurance",
|
||||
muscleGroups: ["cardio"],
|
||||
type: "cardio",
|
||||
},
|
||||
{
|
||||
name: "Rowing",
|
||||
description: "Rowing machine for full-body cardio",
|
||||
muscleGroups: ["cardio"],
|
||||
type: "cardio",
|
||||
},
|
||||
{
|
||||
name: "Jump Rope",
|
||||
description: "Jump rope for cardio and footwork",
|
||||
muscleGroups: ["cardio"],
|
||||
type: "cardio",
|
||||
},
|
||||
{
|
||||
name: "Cycling",
|
||||
description: "Cycling for lower body cardio",
|
||||
muscleGroups: ["cardio"],
|
||||
type: "cardio",
|
||||
},
|
||||
];
|
||||
|
||||
// Create or update exercises
|
||||
for (const exercise of exercises) {
|
||||
await prisma.exercise.upsert({
|
||||
where: {
|
||||
userId_name: {
|
||||
userId: user.id,
|
||||
name: exercise.name,
|
||||
},
|
||||
},
|
||||
update: {},
|
||||
create: {
|
||||
userId: user.id,
|
||||
name: exercise.name,
|
||||
description: exercise.description,
|
||||
muscleGroups: JSON.stringify(exercise.muscleGroups),
|
||||
type: exercise.type,
|
||||
isCustom: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`Created/verified ${exercises.length} exercises`);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user