A simple Go service that generates workouts and full workout plans. Filter by body part or style and get random exercises or a complete plan.
- Go 1.21+ installed
- Node 20+ and npm installed
- Basic understanding of
go run,npm, andgit
- Clone the repository:
git clone https://github.com/MBreece89/getLifted.git
cd getLifted- Build the backend service:
go build -o workoutservice ./cmd/workoutservice- Install frontend dependencies:
npm --prefix frontend/terminal-ui installgo run ./cmd/workoutserviceThe backend listens on http://localhost:8080 by default.
npm --prefix frontend/terminal-ui startOpen http://localhost:4200 in your browser to use the terminal-style frontend.
- Start the backend with
go run ./cmd/workoutservice - Start the frontend with
npm --prefix frontend/terminal-ui start - Use the UI at
http://localhost:4200
From the terminal UI, use:
help— show available commands and backend metadataget-workout [type] [bodyPart]— fetch a random workoutplan [type] [bodyPart]— fetch a full workout planoptions— list supported workout types and body parts
Example:
get-workout strength legs
plan cardio core
optionsGET /workout— random workoutGET /workout?type=<type>&bodyPart=<bodyPart>— random workout filtered by type and body partGET /workout/plan?type=<type>&bodyPart=<bodyPart>— full workout planGET /workout/options— listing of supported body parts and stylesGET /commands— available terminal commands and parametersPOST /logs— accept structured log events from the frontend
Example requests:
curl http://localhost:8080/workout
curl "http://localhost:8080/workout?type=strength&bodyPart=legs"
curl "http://localhost:8080/workout/plan?type=core&bodyPart=strength"
curl http://localhost:8080/workout/options
curl http://localhost:8080/commandsBackend tests:
go test ./internal/serverFrontend tests:
npm --prefix frontend/terminal-ui run test -- --watch=falseBuild the Docker image:
docker build -t workout-service .Run the container:
docker run -d -p 8080:8080 --name workout workout-serviceTest endpoints:
curl http://127.0.0.1:8080/workout
curl "http://127.0.0.1:8080/workout?bodyPart=legs"
curl "http://127.0.0.1:8080/workout/plan?bodyPart=core&style=strength"
curl http://127.0.0.1:8080/workout/options- Open
internal/server/data.go - Add a new
Workoutentry to theworkoutsslice:
Workout{Name: "New Exercise", BodyPart: "legs", Style: "strength", Sets: 3, Reps: 12}- Fork the repository
- Add new workouts or improve the plan generation
- Open a pull request
MIT License