Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jperez77775/ProyectoDocker/llms.txt

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

The /cv endpoint queries the cv_db MySQL database and returns a single JSON object containing personal information from the persona table and all education records from the formacion table. You can use this endpoint to render a complete CV without any additional requests.

Request

GET http://localhost:4000/cv
No request parameters or authentication are required.

Example

curl http://localhost:4000/cv

Response codes

StatusMeaning
200 OKRequest succeeded. Response body contains the full CV object.
503 Service UnavailableDatabase connection is not yet ready. Retry after a few seconds.
500 Internal Server ErrorA MySQL query failed.
404 Not FoundNo rows exist in the persona table.

Response schema

nombre
string
First name(s) of the person. Example: "Juan Eduardo".
apellido
string
Last name(s) of the person. Example: "Pérez Orellana".
ciudad
string
City of residence. Example: "Santa Cruz".
foto
string
Path to the profile image served by the frontend. Example: "/perfil.jpg".
formacion
array
Array of academic education records ordered by insertion. Each item contains the following fields:

Example response

The following response reflects the seed data inserted by database/init.sql:
{
  "nombre": "Juan Eduardo",
  "apellido": "Pérez Orellana",
  "ciudad": "Santa Cruz",
  "foto": "/perfil.jpg",
  "formacion": [
    {
      "id": 1,
      "titulo": "Diplomado FullStack Developer Backend y Frontend",
      "institucion": "USIP",
      "anio": "2026",
      "persona_id": 1
    },
    {
      "id": 2,
      "titulo": "Gestión de Proyectos",
      "institucion": "Millicom University",
      "anio": "2014",
      "persona_id": 1
    },
    {
      "id": 3,
      "titulo": "Arquitectura Enterprise: Oracle SOA Suite, WebLogic Server y Java EE",
      "institucion": "Oracle",
      "anio": "2011",
      "persona_id": 1
    },
    {
      "id": 4,
      "titulo": "Maestría en Ciencias de la Computación",
      "institucion": "UAGRM",
      "anio": "2006",
      "persona_id": 1
    },
    {
      "id": 5,
      "titulo": "Ingeniería Informática",
      "institucion": "UAGRM",
      "anio": "1999",
      "persona_id": 1
    }
  ]
}

How the response is built

The following excerpt from backend/server.js shows how the cv object is assembled and sent. The sanearTexto function is applied to all string fields before the response is serialized:
const sanearTexto = (texto) => {
  if (!texto) return texto;
  const buffer = Buffer.from(texto, 'binary');
  return buffer.toString('utf8');
};

const formacionCorregida = formacionRes.map(f => ({
  ...f,
  titulo: sanearTexto(f.titulo),
  institucion: sanearTexto(f.institucion)
}));

const cv = {
  nombre: sanearTexto(personaRes[0].nombre),
  apellido: sanearTexto(personaRes[0].apellido),
  ciudad: sanearTexto(personaRes[0].ciudad),
  foto: personaRes[0].foto,
  formacion: formacionCorregida
};

res.setHeader('Content-Type', 'application/json; charset=utf-8');
res.send(JSON.stringify(cv));
sanearTexto() corrects a MySQL latin1/utf8 encoding mismatch that can corrupt Spanish characters such as é, ó, and ú. When MySQL returns string data interpreted as latin1 binary instead of UTF-8, the function re-reads the raw bytes as UTF-8, restoring the correct characters. This ensures that accented letters in names and titles are always rendered correctly in the response.

Build docs developers (and LLMs) love