Every HTTP request in the application flows through a single shared Axios instance defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebax85/frontend-prueba-fullstack/llms.txt
Use this file to discover all available pages before exploring further.
src/services/api.js. This centralises the base URL configuration and makes it straightforward to add interceptors or default headers in the future. All six feature components import this instance directly — no fetch calls or additional HTTP libraries are used.
The Axios instance
src/services/api.js creates and exports one Axios instance with baseURL set from the REACT_APP_API_URL environment variable.
src/services/api.js
REACT_APP_API_URL must be defined at build time (Create React App inlines environment variables prefixed with REACT_APP_ during npm run build). A typical value is http://localhost:8080. See Environment Configuration for how to set this in Docker.
Importing the client
Each component importsapi with the same one-liner:
HTTP methods in use
The application uses all four standard REST methods. The examples below are taken directly from the component source code.Response data shapes
The shapes below are inferred from how each component readsres.data.
Alumno
| Field | Type | Notes |
|---|---|---|
id | number | Primary key, present on existing records |
nombre | string | First name |
apellido | string | Last name, used for alphabetical sorting |
email | string | Email address |
fechaNacimiento | string | ISO date string (YYYY-MM-DD) |
Materia
| Field | Type | Notes |
|---|---|---|
id | number | Primary key |
nombre | string | Subject name, used for alphabetical sorting |
Nota
| Field | Type | Notes |
|---|---|---|
id | number | Primary key |
alumnoId | number | Foreign key to Alumno |
alumnoNombre | string | Denormalised first name for display |
alumnoApellido | string | Denormalised last name, used for sorting |
materiaId | number | Foreign key to Materia |
materiaNombre | string | Denormalised subject name for display |
valor | number | Numeric grade value (step 0.1) |
The POST/PUT payload for Notas uses a nested object format rather than flat IDs:
{ alumno: { id }, materia: { id }, valor }. This matches the backend’s expected request body.Error handling patterns
Two distinct patterns are used across the components. Validation errors (client-side): Form components validate required fields before making any network call. If validation fails, they set anerror string and set mostrarError to true, which renders a modal overlay with the message.
Client-side validation (AlumnosFormulario.js)
message field if present, or a default message explaining that the record has dependent grades.
Server error handling (AlumnosLista.js)
mostrarError back to false.