Skip to content

juancarlosbs/pumpkin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Workout Tracker πŸ’ͺ

A comprehensive workout tracking system to monitor your gym progress, including sets, reps, and weight for each exercise.

Features

  • Track workouts with dates and notes
  • Organize exercises by muscle groups and subgroups
  • Record sets, repetitions, and weight for each exercise
  • Monitor your progress over time
  • Visualize strength gains and improvements

Tech Stack

  • Backend: NestJS with TypeScript
  • Database: PostgreSQL with Prisma ORM
  • Validation: Zod for schema validation
  • Infrastructure: Docker for database containerization
  • API Documentation: Postman Collection included

Project Structure

apps/
β”œβ”€β”€ api/                  # NestJS backend application
β”‚   β”œβ”€β”€ prisma/           # Prisma schema and migrations
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ exercises/    # Exercise management
β”‚   β”‚   β”œβ”€β”€ muscle-groups/# Muscle group management
β”‚   β”‚   β”œβ”€β”€ muscle-subgroups/ # Muscle subgroup management
β”‚   β”‚   β”œβ”€β”€ workouts/     # Workout, workout exercises, sets
β”‚   β”‚   β”œβ”€β”€ prisma/       # Prisma service
β”‚   β”‚   └── app.module.ts # Main application module
β”œβ”€β”€ web/                  # Frontend application (to be implemented)

Getting Started

Prerequisites

  • Node.js (v18+)
  • Docker and Docker Compose
  • pnpm or npm

Installation

  1. Clone the repository:
git clone https://github.com/your-username/workout-tracker.git
cd workout-tracker
  1. Install dependencies:
pnpm install
  1. Start the PostgreSQL database using Docker:
docker-compose up -d

This will create a container named workout-tracker-db with PostgreSQL running on port 5432.

  1. Set up environment variables:
cp .env.example .env
  1. Run database migrations:
cd apps/api
npx prisma migrate dev
  1. Seed the database with initial data:
npm run prisma:seed
  1. Start the development server:
npm run dev

The API will be available at http://localhost:3000.

API Endpoints

Muscle Groups

  • GET /muscle-groups - List all muscle groups
  • GET /muscle-groups/:id - Get a specific muscle group
  • POST /muscle-groups - Create a new muscle group
  • PUT /muscle-groups/:id - Update a muscle group
  • DELETE /muscle-groups/:id - Delete a muscle group

Muscle Subgroups

  • GET /muscle-subgroups - List all muscle subgroups
  • GET /muscle-subgroups?muscleGroupId=:id - List subgroups for a specific muscle group
  • POST /muscle-subgroups - Create a new muscle subgroup
  • PUT /muscle-subgroups/:id - Update a muscle subgroup
  • DELETE /muscle-subgroups/:id - Delete a muscle subgroup

Exercises

  • GET /exercises - List all exercises
  • GET /exercises/:id - Get a specific exercise
  • POST /exercises - Create a new exercise
  • PUT /exercises/:id - Update an exercise
  • DELETE /exercises/:id - Delete an exercise

Workouts

  • GET /workouts - List all workouts
  • GET /workouts/:id - Get a specific workout
  • POST /workouts - Create a new workout
  • PUT /workouts/:id - Update a workout
  • DELETE /workouts/:id - Delete a workout

Workout Exercises

  • GET /workouts/:workoutId/exercises/:id - Get a specific exercise in a workout
  • POST /workouts/:workoutId/exercises - Add an exercise to a workout
  • PUT /workouts/:workoutId/exercises/:id - Update an exercise in a workout
  • DELETE /workouts/:workoutId/exercises/:id - Remove an exercise from a workout

Exercise Sets

  • GET /workout-exercises/:workoutExerciseId/sets - List all sets for an exercise
  • GET /workout-exercises/:workoutExerciseId/sets/:id - Get a specific set
  • POST /workout-exercises/:workoutExerciseId/sets - Add a set to an exercise
  • POST /workout-exercises/:workoutExerciseId/sets/batch - Add multiple sets at once
  • PUT /workout-exercises/:workoutExerciseId/sets/:id - Update a set
  • DELETE /workout-exercises/:workoutExerciseId/sets/:id - Delete a set

Development

Running Tests

npm run test

Database Management

  • Access Prisma Studio (database GUI):
cd apps/api
npx prisma studio

API Testing

Import the included Postman collection to test all API endpoints.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Workout tracker πŸ’ͺ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages