Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/azahel79/Spartans-gym/llms.txt

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

The Configuration page (/config) is the central control panel for your Spartans Gym installation. It is accessible to administrators only — receptionists are redirected away by the frontend route guard before the page loads. From here you can update your gym’s public identity, manage the membership plans available to clients, administer staff user accounts, and review security options.
Spartans Gym is designed for single-gym deployments. Only one GymConfig record exists per installation. All reads and writes target that single row; if it does not yet exist, the API creates it automatically with default values on the first request.
The Config page is organized into six tabs. Use the sidebar navigation on the left to switch between them.

Detalles del Gimnasio

Edit your gym’s name, email, phone number, address, and logo. Changes are persisted to the GymConfig table via PUT /api/config/gym.

Planes y Membresías

Create, edit, and soft-delete the membership plans available to clients. Each plan has a name, price, and billing period.

Roles y Permisos

Manage staff user accounts and their access levels. You can create new users and toggle roles directly from this tab.

Seguridad

Change your admin password and close all active sessions. Both actions are presented as UI controls in the current release.

Notificaciones

Coming soon — notification and alert configuration will be available in a future update.

Pagos y Facturación

Coming soon — payment gateway integration and invoicing settings will be available in a future update.

Gym Identity Settings

The Detalles del Gimnasio tab lets you update the information displayed throughout the application and on any client-facing output.

GymConfig Model

FieldTypeDefaultDescription
idIntauto-incrementPrimary key
nameStringSPARTAN'S GYMGym’s commercial name
emailStringcontacto@spartansgym.comContact email address
phoneString+52 55 1234 5678Contact phone number
addressStringAvenida de los Deportes 123, CDMXPhysical address
logoString?nullCloudinary URL for the gym logo
createdAtDateTimenow()Record creation timestamp
updatedAtDateTimeautoLast update timestamp

Updating Gym Info

Send a PUT request to /api/config/gym with any combination of the writable fields. Only the fields you include are updated — omitted fields keep their current values.
PUT /api/config/gym
Authorization: Bearer <admin-token>
Content-Type: application/json

{
  "name": "Spartans Elite Gym",
  "email": "hello@spartanselite.com",
  "phone": "+52 55 9876 5432",
  "address": "Calle Fuerza 456, Monterrey"
}
A successful response returns { "success": true, "data": { ...updatedConfig } }.

Logo Upload

The logo uploader in the Detalles del Gimnasio tab sends the selected image file to Cloudinary and stores the resulting URL in GymConfig.logo.

Upload Endpoint

POST /api/upload/logo
Authorization: Bearer <admin-token>
Content-Type: multipart/form-data

logo=<image file>
The field name in the form data must be logo. The file must be an image (image/*) and must not exceed 5 MB. Files that exceed the size limit or are not images are rejected client-side before the request is made.
Logo uploads require a valid Cloudinary account. Make sure CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, and CLOUDINARY_API_SECRET are set in your server environment. If any of these variables are missing, the upload request will fail with a server error even though the file itself is valid.

Upload Flow

1

Select an image

Click Subir logo on the Detalles del Gimnasio tab and choose a JPG, PNG, or WEBP file under 5 MB. A local preview renders immediately.
2

Save changes

Click Guardar cambios. The frontend first POSTs the file to /api/upload/logo, receives the Cloudinary URL in the response, then includes that URL in the subsequent PUT /api/config/gym request.
3

Logo stored

The Cloudinary URL is saved to GymConfig.logo and the preview reflects the live URL going forward.
To remove the logo entirely, click the × button overlaid on the preview. The frontend calls PUT /api/config/gym with { "logo": "" }, clearing the stored URL.

Membership Plans

The Planes y Membresías tab surfaces the Plan management interface.
FieldTypeDescription
idString (UUID)Unique plan identifier
nameStringUnique plan name (e.g., “Plan Premium”)
priceDecimalPrice in MXN
periodStringBilling period: Mes, 3 Meses, 6 Meses, or Ano
colorStringUI accent color class (default: bg-primary)
isActiveBooleanWhether the plan appears in client-facing selectors
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast modification timestamp
Click Nuevo Plan to open the plan creation modal. Fill in the name, price, and period, then click Crear Plan. To modify an existing plan, click Editar on its card. Deleting a plan performs a soft-delete — the isActive flag is set to false and existing client records that reference the plan are not modified.

Security Tab

The Seguridad tab (admin only) presents two actions:
ActionDescription
Cambiar ContraseñaOpens a form to update your admin account password
Cerrar todas las sesionesTerminates all active login sessions for your account
Both security actions are currently UI-only controls in this release. Backend endpoints for password change and session invalidation are not yet exposed via the API.

Build docs developers (and LLMs) love