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.

Once a CSV file has been uploaded, CSV Manager exposes a real-time search experience. The frontend debounces every keystroke by 300 ms before firing a request, which keeps network traffic low while still feeling instantaneous. On the server side, the GET /api/users endpoint filters the in-memory dataset by checking whether the query string appears anywhere in any column value — no index, no configuration required. You can use the browser UI or call the API directly with curl.

Via the UI

1

Reach the Search view

After a successful CSV upload the app automatically transitions to the Search view. You will see a form with the label Busqueda and a single text input.
2

Type your query

Click the search input (placeholder: Inserte su letra) and start typing. The input accepts any free-text string — partial words, digits, phone number fragments, email addresses, and so on.
3

Wait for the debounce

After 300 ms of inactivity the frontend automatically sends GET /api/users?q={yourQuery} to the backend. No button press is needed — results update as you type.
4

Review matching rows

Matching rows appear below the search form as a list. Every field from the original CSV is rendered with its column name in uppercase followed by the cell value — for example, NOMBRE: Carlos || APELLIDO: Mendez ||. Rows that do not match the query are hidden.

Via the API

Pass your search term as the q query parameter on GET /api/users:
curl "http://localhost:3000/api/users?q=carlos"
A successful search returns HTTP 200 with a data array containing every matching row:
{
  "data": [
    {
      "id": "1",
      "nombre": "Carlos",
      "apellido": "Mendez",
      "edad": "34",
      "email": "carlos.mendez@example.com",
      "ciudad": "Cancun",
      "pais": "Mexico",
      "telefono": "+52-998-123-4567"
    }
  ]
}
You can search across any column. For example, to find all rows where any field contains "mexico":
curl "http://localhost:3000/api/users?q=mexico"
Or to search by partial email domain:
curl "http://localhost:3000/api/users?q=example.com"

How the Filter Works

The search logic is intentionally broad. For each row in the in-memory dataset, the server calls:
Object.values(row).some((value) =>
  value.toLowerCase().includes(search)
)
This means:
  • Every column is searchedid, nombre, apellido, edad, email, ciudad, pais, telefono, and any other columns present in your CSV.
  • Partial matches succeed — the query "can" matches "Cancun".
  • The comparison is case-insensitive — both sides are lowercased before comparing.
  • A row is included if any single column matches — you do not need to specify which column to search.

Error Case

If the q parameter is omitted entirely, the endpoint returns HTTP 500:
{
  "message": "No hay parametro de busqueda"
}
Always include ?q= followed by at least one character. An empty string (?q=) is technically provided but will match every row because every value includes the empty string.
Searches are case-insensitive — querying for "mexico", "Mexico", or "MEXICO" all return the same set of matching rows. You never need to worry about capitalisation when constructing a query.

Build docs developers (and LLMs) love