Patients are the primary end users of MELIKA. After registering and verifying their email address, they can browse medical specialties, book appointments with available doctors, track upcoming and past visits on a personal calendar, and review their full clinical history — all without requiring any administrative intervention.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.
Registration
To create a MELIKA patient account, the following fields are required at sign-up:| Field | Type | Validation rules |
|---|---|---|
nombre | string | Letters and spaces only; min 2 chars; no digits or repeated characters |
primer_apellido | string | Letters and spaces only; min 2 chars; no digits or repeated characters |
email | string | Must match user@domain.tld format; must be unique |
password | string | Min 6 characters; avoid trivially repeated characters (e.g. 111111) |
tipo_documento | enum | One of CC, CE, or PASAPORTE |
numero_documento | string | Digits only, 5–15 characters; no letters or symbols; must be unique |
fecha_nacimiento | date | Format YYYY-MM-DD; cannot be in the future; calculated age must be 0–120 years |
genero | enum | One of M, F, or O |
validarRegistroUsuario. All errors are collected and returned together in a single 422 response — the request is never rejected on just the first failing field.
After submission, the account is created in an unverified state and the patient is taken through the email verification step before gaining access to authenticated routes.
Email Verification
Before a newly registered patient can book appointments or view records, MELIKA requires email verification.Code delivered
Immediately after registration, MELIKA sends a 6-digit numeric code to the provided email address. The code is valid for 15 minutes.
Enter the code
The patient enters the code on the verification screen. A correct submission sets both
activo = TRUE and verificado = TRUE on the account, allowing the patient to log in.Verification codes are single-use. Requesting a resend immediately invalidates the previous code.
Session Storage
After a successful login, the frontend stores two entries inlocalStorage:
| Key | Contents |
|---|---|
melika_token | The raw JWT string (valid for 8 hours) |
melika_usuario | JSON-serialised user object (id, nombre, primer_apellido, email, rol) |
AuthContext on page load to restore the session without requiring a new login. Both keys are removed from localStorage when the patient calls logout().
Booking an Appointment
Once verified, a patient can book an appointment through the following workflow:Browse specialties
The specialties listing (
/especialidades) is publicly accessible — no authentication is required. Patients can explore available fields of medicine before deciding to register.Select a doctor
After choosing a specialty, the patient picks a doctor from the list of practitioners associated with that specialty.
Pick a time slot
Available 40-minute slots for the chosen date are listed. The patient selects one open slot (
disponible = true).Viewing Appointments
Patients have two complementary views for tracking their appointments:- Appointment List
- Calendar View
Endpoint:
GET /citas/mis-citasReturns a chronological list of all appointments belonging to the authenticated patient, including their current status (pendiente, completada, cancelada, no_asistio).Cancelling an Appointment
A patient may cancel a pending appointment and, once cancelled, remove it from their list entirely.Request cancellation
Send a The appointment status changes to
PATCH request to /citas/:id with a mandatory cancellation reason:cancelada. The razon_cancelacion field is required; the request is rejected without it.Clinical Records
Patients have read-only access to their own clinical history. No patient-facing route permits creating or modifying medical records.- Full History
- Documents
Endpoint:
GET /historias/paciente/:id_pacienteReturns all structured clinical history entries linked to the patient, including diagnoses, prescriptions, and evolution notes added by doctors.Document Visibility Control
Patients can choose to hide externally uploaded documents from their default document view. Hidden documents are not deleted — they remain accessible to authorised medical staff.isPaciente middleware guard, ensuring only the document’s owner can toggle its visibility.
What counts as an external document?
What counts as an external document?
External documents are files uploaded outside of a standard MELIKA consultation — for example, lab results from a third-party clinic, imaging files, or referral letters. They are linked to the patient’s record but carry an
externo flag that distinguishes them from notes created by MELIKA doctors.Dashboard and Route Guard
The patient dashboard is available at/dashboard. Access is controlled by the RutaPaciente guard defined in App.jsx, which reads the rol claim from the decoded user object stored under the melika_usuario key in localStorage.
If a user with a medico or admin role attempts to navigate to
/dashboard, the RutaPaciente guard redirects them automatically to their own dashboard (/dashboard-medico or /admin, respectively). Role-based redirects work symmetrically — each guard enforces separation between the three panels.