Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/titobrian97/Prueba-tecnica-ts-node---gestion-de-csv/llms.txt

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

CSV Manager accepts a single CSV file at a time and stores its rows in memory so they become immediately available for real-time search. You can upload a file through the browser-based UI at http://localhost:5173 (the default Vite dev-server address) or by calling the POST /api/files endpoint directly. Either way, the backend validates the file, parses every row into a JSON object, and replaces any previously held data with the new upload.

Via the UI

1

Open CSV Manager in your browser

Navigate to http://localhost:5173 (the default Vite dev-server address). You will see the CSV MANAGE heading and a file picker — no data has been loaded yet.
2

Select your CSV file

Click Choose File (the <input type="file" accept=".csv"> element) and pick a .csv file from your local machine. The Subir Archivo button appears as soon as a file is selected.
3

Upload the file

Click Subir Archivo to submit. While the upload is in progress the button label changes to Cargando and both the button and the file picker are disabled to prevent duplicate submissions.
4

Confirm success and start searching

On a successful upload a toast notification displays the message "El archivo se cargo correctamente" and the app automatically transitions to the Search view, where you can query the uploaded rows immediately.

Via the API

You can upload a CSV file directly with curl (or any HTTP client) by sending a multipart/form-data POST request to POST /api/files. The field name must be file.
curl -X POST http://localhost:3000/api/files \
  -F "file=@example.csv"
A successful upload returns HTTP 200 with the parsed rows and a confirmation message:
{
  "data": [
    {
      "id": "1",
      "nombre": "Carlos",
      "apellido": "Mendez",
      "edad": "34",
      "email": "carlos.mendez@example.com",
      "ciudad": "Cancun",
      "pais": "Mexico",
      "telefono": "+52-998-123-4567"
    }
  ],
  "message": "El archivo se cargo correctamente"
}
The data array contains one object per CSV row. Every value is a string regardless of how it looks in the original file (numbers, phone numbers, etc.).

Error Cases

If the request reaches the server without an attached file, the endpoint returns HTTP 500:
{
  "data": [],
  "message": "file is required"
}
Make sure the multipart/form-data field is named exactly file.
The backend checks file.mimetype and rejects anything that is not text/csv. Uploading a .txt, .xlsx, or any other file type returns HTTP 500:
{
  "data": [],
  "message": "El archivo debe ser un csv"
}
Rename and re-save your file as a proper CSV, or ensure your HTTP client sets the correct content type for the part.
If convert-csv-to-json throws while processing the raw CSV string, the endpoint returns HTTP 500:
{
  "data": [],
  "message": "Error parsing file"
}
This usually means the file is malformed — for example, inconsistent column counts or unexpected binary content. See the CSV Format guide for the exact requirements.
Uploading a new CSV file replaces all previously uploaded data in memory. CSV Manager holds only one dataset at a time — there is no append mode. If you need to preserve earlier records, merge them into a single CSV before uploading.

Build docs developers (and LLMs) love