Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Lokhy87/gymApp/llms.txt

Use this file to discover all available pages before exploring further.

GymFlow uses MariaDB 10.11 as its database, running as the gymflow_db_server container. Doctrine Migrations manages the schema — a single migration file creates all tables and foreign key constraints. A data.sql dump provides the reference and seed data (exercises, muscle groups, muscles, training goals, work plans, and two example users) that the application depends on to function correctly.
Run migrations and load seed data only after the gymflow_db_server container is healthy and accepting connections. The PHP container’s links directive ensures gymflow-db-server is reachable by hostname, but MariaDB may still take a few seconds to finish initializing after docker compose up. If the migration command fails with a connection error, wait 10–15 seconds and try again.

MariaDB container

The database service is defined in docker-compose.yml:
gymflow-db-server:
  container_name: gymflow_db_server
  image: mariadb:10.11
  ports:
    - "3350:3306"
  restart: unless-stopped
  environment:
    MYSQL_ROOT_PASSWORD: root
  volumes:
    - gymflow_db_mysql:/var/lib/mysql
  networks:
    - gymflow_network
MariaDB listens on port 3306 inside the container, mapped to 3350 on the host. Data is persisted in the gymflow_db_mysql named volume so it survives container restarts. The root password is root — suitable for local development only. To connect to the database from your host machine using the mysql CLI or a GUI like TablePlus or DBeaver:
Host:     localhost
Port:     3350
User:     root
Password: root
Database: gymflow

Run migrations

The single Doctrine migration (Version20260512152226) creates the complete schema. Run it from inside the PHP container after the stack is up:
docker exec -it gymflow_php_server bash
php bin/console doctrine:migrations:migrate --no-interaction
exit
To verify all migrations have been applied:
docker exec -it gymflow_php_server php bin/console doctrine:migrations:status
To roll back the last migration:
docker exec -it gymflow_php_server php bin/console doctrine:migrations:migrate prev --no-interaction

Load seed data

backend/data.sql is a MariaDB dump that populates the reference tables (exercises, muscle groups, muscles, training goals, work splits, work plans, training methods) and inserts two example user accounts. Load it into the running container:
docker exec -i gymflow_db_server \
  mariadb -u root -proot gymflow < backend/data.sql
The dump was generated from MariaDB 10.11 and uses utf8mb4_general_ci collation throughout. It includes DROP TABLE IF EXISTS statements, so re-running it will truncate all seeded tables before re-inserting. Do not run it against a database that contains real user workout data.
The seed data includes two example user accounts:
EmailRolePassword (bcrypt)
admin@florida.esROLE_ADMINSee data.sql — change before any shared deployment
test@user.es(none)See data.sql — change before any shared deployment

Database schema

The migration creates the following tables:
TableDescription
userRegistered accounts. Stores email (unique), bcrypt-hashed password, name, username, and location. Roles are stored as a JSON column.
workoutIndividual logged sets. Links to user and exercise via foreign keys; records sets, reps, weight (float), an optional comments text, and a date timestamp.
exercisesExercise catalogue. Each exercise has a name, optional image URL, and belongs to one muscle_group.
muscle_groupsTop-level muscle group categories (Chest, Back, Legs, Shoulder, Arms, Core). Each has a name and image URL.
musclesIndividual muscles (e.g., Pectoralis major, Quadriceps). Each belongs to a muscle_group and has an optional image URL.
exercises_musclesJoin table that maps exercises to the muscles they target. The role column classifies each mapping as primary, secondary, or stabilizer.
exercises_variantsNamed variants of a base exercise (e.g., “Dumbbell Bench Press” is a variant of “Bench Press”). Links back to exercises via exercise_id.
work_splitTraining split types (Full Body, Upper Lower, Push Pull Legs, Bro Split, Hybrid).
work_planStructured training programmes. Combines a work_split, training_goal, and training_level with days_per_week, optional duration_weeks, and an is_active flag.
training_goalTraining objectives (Hypertrophy, Fat Loss, Strength, etc.) with a name and optional description.
training_levelUser experience levels: Beginner, Intermediate, Advanced.
training_methodSpecific training techniques (Progressive Overload, Superset, Drop Set, HIIT, etc.) with a name and optional description.
messenger_messagesSymfony Messenger async queue table. Created by the migration and used internally by the framework.

Entity relationships

The key foreign key relationships defined by the migration are:
exercises          → muscle_groups       (muscle_group_id)
muscles            → muscle_groups       (muscle_group_id)
exercises_muscles  → exercises           (exercise_id)
exercises_muscles  → muscles             (muscle_id)
exercises_variants → exercises           (exercise_id)
workout            → user                (user_id)
workout            → exercises           (exercise_id)
work_plan          → training_goal       (training_goal_id)
work_plan          → training_level      (training_level_id)
work_plan          → work_split          (work_split_id)

Docker Compose setup

Container definitions, port mappings, and the gymflow_network configuration.

Environment variables

Configure DATABASE_URL, APP_SECRET, JWT_PASSPHRASE, and other required variables.

Exercises

How the exercise library and muscle group data are surfaced in the UI.

Workouts API

REST endpoints for creating, reading, updating, and deleting workout entries.

Build docs developers (and LLMs) love