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 runs entirely inside Docker. A single docker compose up command starts the PHP/Symfony API on port 8050 and a MariaDB 10.11 database on port 3350, so you do not need PHP, Composer, or a local database installed on your machine.
1

Clone the repository

Clone the GymFlow repository to your local machine.
git clone https://github.com/Lokhy87/gymApp.git
cd gymApp
The repository root contains the Dockerfile, docker-compose.yml, and both the backend/ and frontend/ directories.
2

Start the Docker stack

Build the PHP image and start both services in the background.
docker compose up -d --build
Docker Compose starts two containers:
ContainerServiceExposed port
gymflow_php_serverSymfony API (Apache + PHP 8.3)8050 → container 8000
gymflow_db_serverMariaDB 10.113350 → container 3306
Once the containers are running, verify the API is online:
curl http://localhost:8050/api
Expected response:
{
  "project": "GymFlow API",
  "version": "1.0",
  "status": "online"
}
On the first build, Docker downloads the base php:8.3-apache image and installs Composer, the Symfony CLI, and Xdebug. Subsequent starts are much faster because the image is cached.
3

Run database migrations

With the containers running, open a shell inside the PHP container and apply the Doctrine migrations to create the schema.
docker exec -it gymflow_php_server bash
php bin/console doctrine:migrations:migrate --no-interaction
exit
The MariaDB container uses root / root credentials by default. Do not expose port 3350 to the public internet in production. See the environment variables reference for how to override these values.
4

Create an account

Register a new user account by posting to POST /api/register. The location field is optional and defaults to Valencia if omitted.
curl -s -X POST http://localhost:8050/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alex@example.com",
    "username": "alex",
    "password": "supersecret",
    "location": "Madrid"
  }'
A successful registration returns HTTP 201:
{
  "message": "User registered successfully",
  "user": "alex@example.com"
}
Alternatively, open the Angular dev server (npm start inside frontend/) and use the Register page at http://localhost:4200/register.
5

Log in and get your JWT

Exchange your credentials for a JWT by calling POST /api/login_check. The API uses your email as the login identifier.
curl -s -X POST http://localhost:8050/api/login_check \
  -H "Content-Type: application/json" \
  -d '{
    "username": "alex@example.com",
    "password": "supersecret"
  }'
A successful response returns a token:
{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
Save this token — you must pass it as a Bearer token in the Authorization header for all protected endpoints.
export TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
The Angular frontend stores the token in localStorage under the key token and attaches it automatically to every outgoing request via the authInterceptor.
6

Log your first workout

Find an exercise ID you want to log. Fetch the full exercise list from the library:
curl -s http://localhost:8050/api/exercises \
  -H "Authorization: Bearer $TOKEN"
Then create a workout entry with POST /api/workouts. The required fields are exercise_id, sets, and reps. weight and comments are optional.
curl -s -X POST http://localhost:8050/api/workouts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "exercise_id": 1,
    "sets": 4,
    "reps": 8,
    "weight": 80.5,
    "comments": "Felt strong today"
  }'
A successful response returns HTTP 201 with the new workout’s ID:
{
  "message": "Workout created successfully",
  "workout_id": 42
}
You can filter exercises by muscle group by passing the muscle_group_id query parameter: GET /api/exercises?muscle_group_id=2. See the exercises API reference for details.

Next steps

Architecture

Learn how the Angular SPA, Symfony API, and MariaDB fit together.

Authentication

Full reference for the register and login endpoints, token format, and expiry.

Workouts API

Create, update, and delete workout entries via the REST API.

Docker deployment

Configure and deploy GymFlow with Docker Compose in a production environment.

Build docs developers (and LLMs) love