Corpointa is a frontend-only single-page application (SPA) built with React. It does not contain any server-side logic of its own — instead, every data operation is delegated to a companion REST API backend over HTTP. All network communication is handled through a single, centrally configured Axios instance that lives inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
src/lib/api-client.ts. Understanding this client is the starting point for any integration or debugging work.
Base URL Configuration
The API base URL is supplied at build time through theVITE_API_URL environment variable. When that variable is absent — for example in a local development environment — the client falls back to http://localhost:4000.
Content-Type header:
apiClient instance, so changing VITE_API_URL at build time is the only configuration required to point the entire frontend at a different backend.
Request Interceptor
Before any request leaves the browser, a request interceptor reads the JWT access token from a cookie namedthisisjustarandomstring, JSON-parses its value, and attaches it as an Authorization: Bearer header. This happens automatically for every call — individual API functions do not need to handle token attachment themselves.
JSON.stringify before writing it to the cookie. If the cookie is absent or its value cannot be parsed, the interceptor skips token attachment without throwing, and the request is sent unauthenticated — the backend will return 401 Unauthorized.
Content-Type
All requests useContent-Type: application/json by default, set at instance creation time. This means every request body must be a JSON-serialisable JavaScript object. Axios handles serialisation automatically when you pass a plain object to .post(), .put(), or .patch().
The one exception is the PDF download endpoint (
GET /salidas/:id/pdf), which overrides responseType to 'blob' on a per-request basis to handle the binary response correctly.Response Handling
Axios unwraps the HTTP response envelope automatically. API module functions returnresponse.data directly, so callers receive the parsed JSON body without any additional unwrapping:
error.response?.status and the error body via error.response?.data. If the network is unreachable, error.response will be undefined and error.request will be populated instead.
API Modules
The frontend is organised into feature modules, each with a dedicated API file. The table below maps each feature to its base URL path.Auth
Sign in and token refresh —
/authDashboard
Aggregate stats for the home screen —
/dashboardMaterials
Inventory item catalogue —
/materialesEntries / Receipts
Control perceptivo (goods received notes) —
/controles-perceptivosDispatches
Outbound material dispatches —
/salidasStock
Current stock levels and min/max thresholds —
/existenciasCategories
Material category catalogue —
/categoriasUnits of Measure
Unit of measure catalogue —
/unidades-medidasDestinations
Destination / department catalogue —
/destinosSuppliers
Supplier catalogue —
/proveedoresEmployees
Employee records —
/empleadosUsers
System user accounts —
/usersAudit Log
Immutable activity log —
/bitacoras