Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Hansel-Pan/sistema-de-informacion-web-para-un-gimnasio/llms.txt

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

The /api/acceso resource manages real-time gym access control. It tracks which clients are currently inside the facility (en_gimnasio), deducts a membership day each time a client enters, and maintains a complete access log per member. Use the occupancy endpoint to display a live list of clients in the gym and the history endpoint to audit an individual member’s visits.

POST /api/acceso/entrada

Registers a client entry event. The backend sets the client’s en_gimnasio flag to true and deducts one day from their dias_restantes balance.
If the client’s dias_restantes is 0 or less, the backend should reject the entry request and return an error. The GymSys frontend disables the “Entrada” button for clients with no days remaining, but API consumers must handle the error response directly.

Request body

cliente_id
number
required
The unique ID of the client entering the gym.

Response fields

nombres
string
Full name of the client who entered.
dias_restantes_actualizados
number
The client’s updated membership day balance after deducting one day for this entry.

Example request

curl -X POST http://localhost:3001/api/acceso/entrada \
  -H 'Content-Type: application/json' \
  -d '{"cliente_id": 1}'

Example response

{
  "nombres": "Juan Pérez",
  "dias_restantes_actualizados": 21
}

POST /api/acceso/salida

Registers a client exit event. The backend sets the client’s en_gimnasio flag to false.

Request body

cliente_id
number
required
The unique ID of the client exiting the gym.

Response fields

nombres
string
Full name of the client who exited.

Example request

curl -X POST http://localhost:3001/api/acceso/salida \
  -H 'Content-Type: application/json' \
  -d '{"cliente_id": 1}'

Example response

{
  "nombres": "Juan Pérez"
}

GET /api/acceso/ocupacion

Returns an array of all clients who are currently inside the gym (en_gimnasio = true). Use this endpoint to display real-time occupancy on a dashboard or reception screen.

Response fields

id
number
Unique identifier of the client.
nombres
string
Full name of the client.
identificacion
string
National ID or document number of the client.
celular
string
Mobile phone number of the client.
dias_restantes
number
Number of membership days the client still has available.

Example request

curl http://localhost:3001/api/acceso/ocupacion

Example response

[
  {
    "id": 1,
    "nombres": "Juan Pérez",
    "identificacion": "1234567890",
    "celular": "3001234567",
    "dias_restantes": 21
  }
]

GET /api/acceso/historial/:cliente_id

Returns the full access log (entries and exits) for a specific client, ordered chronologically.

Path parameters

cliente_id
number
required
The unique ID of the client whose access history you want to retrieve.

Response fields

id
number
Unique identifier for the access log entry.
cliente_id
number
ID of the client this log entry belongs to.
tipo
string
Type of access event. Typically "entrada" (entry) or "salida" (exit).
fecha
string
Timestamp of the access event in ISO 8601 format.

Example request

curl http://localhost:3001/api/acceso/historial/1

Example response

[
  {
    "id": 45,
    "cliente_id": 1,
    "tipo": "entrada",
    "fecha": "2024-03-10T08:30:00.000Z"
  },
  {
    "id": 46,
    "cliente_id": 1,
    "tipo": "salida",
    "fecha": "2024-03-10T10:15:00.000Z"
  }
]

Build docs developers (and LLMs) love