Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Imjuanisss/proyecto-melika/llms.txt

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

MELIKA organizes its medical network around a specialty catalog that connects disciplines to their associated doctors and drives the entire availability-checking workflow. Every doctor in the system (medicos table) is linked to exactly one specialty via a foreign key (medicos.id_especialidad), and the platform exposes both single-day and date-range availability queries that integrate directly with FullCalendar on the frontend. Only specialties marked activa = TRUE are returned through the public API.

Available Specialties

MELIKA currently supports the following medical and health disciplines:

Cardiología

Dermatología

Ginecología

Medicina General

Neurología

Nutrición y Dietética

Oftalmología

Ortopedia y Traumatología

Otorrinolaringología

Pediatría

Psiquiatría

Urología

Specialty Data Model

Each specialty record exposes the following fields:
FieldTypeDescription
idintegerUnique identifier for the specialty
nombrevarcharDisplay name of the specialty (e.g., "Cardiología")
descripciontextPlain-language description of the discipline
precio_basenumericBase consultation price for this specialty
imagen_urlvarcharURL to the specialty’s cover image
activabooleanWhen FALSE, the specialty is hidden from all public endpoints

Listing Active Specialties

The specialties listing endpoint is public — no authentication is required. It returns only specialties where activa = TRUE, ordered by name.
GET /especialidades
Example response:
[
  {
    "id": 1,
    "nombre": "Cardiología",
    "descripcion": "Diagnóstico y tratamiento de enfermedades del corazón y sistema cardiovascular",
    "precio_base": "80000.00",
    "imagen_url": "/imagenes/especialidades/cardiologia.jpg",
    "activa": true
  },
  {
    "id": 2,
    "nombre": "Dermatología",
    "descripcion": "Diagnóstico y cuidado integral de patologías de la piel, pelo y uñas",
    "precio_base": "70000.00",
    "imagen_url": "/imagenes/especialidades/dermatologia.jpg",
    "activa": true
  }
]

Doctors per Specialty

To list all active doctors within a specialty, query the specialty’s doctor endpoint. Only doctors where both medicos.activo = TRUE and usuarios.activo = TRUE are returned, ordered by first name.
GET /especialidades/:id/medicos

Doctor Profile Fields

FieldTypeDescription
idintegerDoctor’s unique ID in the medicos table
nombrevarcharDoctor’s first name (from usuarios)
primer_apellidovarcharDoctor’s first surname (from usuarios)
foto_urlvarcharURL to the doctor’s profile photo
tarifanumericDoctor’s per-consultation fee
calificacionnumericAverage star rating (e.g., 4.8)
acepta_teleconsultabooleanWhether the doctor offers video consultations
acepta_presencialbooleanWhether the doctor accepts in-person visits
biografiatextShort professional biography
anos_experienciaintegerYears of clinical experience
Example response item:
{
  "id": 3,
  "nombre": "Laura",
  "primer_apellido": "Méndez",
  "foto_url": "https://storage.melika.app/medicos/laura-mendez.jpg",
  "tarifa": "130000.00",
  "calificacion": 4.9,
  "acepta_teleconsulta": true,
  "acepta_presencial": true,
  "biografia": "Cardióloga con 12 años de experiencia en cardiología intervencionista y prevención cardiovascular.",
  "anos_experiencia": 12
}

Checking Doctor Availability

MELIKA provides two availability endpoints — both powered by the franjas_horarias table. Only slots with disponible = TRUE are returned from either endpoint.
Returns available time slots for a specific doctor on a given date. Use this to power a day-level slot picker.
GET /especialidades/disponibilidad?medico_id=3&fecha=2025-08-15
Query parameters:
ParameterRequiredDescription
medico_id✅ YesThe doctor’s ID from the medicos table
fecha✅ YesDate to query in YYYY-MM-DD format
Example response:
[
  {
    "id": 14,
    "hora_inicio": "09:00:00",
    "hora_fin": "09:40:00",
    "disponible": true
  },
  {
    "id": 15,
    "hora_inicio": "09:40:00",
    "hora_fin": "10:20:00",
    "disponible": true
  }
]
All returned slots have disponible = true. Already-booked slots are excluded entirely — they do not appear in the response.

How Specialties Connect to the Booking Flow

The specialty catalog is the entry point for every appointment booking. The connection between specialties, doctors, slots, and appointments follows this hierarchy:
1

Select a Specialty

Patient browses GET /especialidades and picks a discipline. The id and precio_base are retained for display in the booking summary.
2

Choose a Doctor

Patient calls GET /especialidades/:id/medicos to see available physicians, their ratings, fees, and consultation modalities.
3

Query Available Slots

Patient calls GET /especialidades/disponibilidad-rango to populate the booking calendar, then GET /especialidades/disponibilidad on day selection to retrieve the granular slot list for that date.
4

Book the Appointment

Patient submits POST /citas with id_especialidad, id_medico, id_franja, fecha, and hora_inicio. The franja_horaria is reserved immediately with database-level concurrency protection.
When building the booking UI, call the range availability endpoint first to show a calendar overview, then switch to the single-day endpoint when the user selects a specific date to display the granular slot picker.

Build docs developers (and LLMs) love