The admin panel is a JWT-protected area that gives administrators full visibility into the inventory system — searching by responsible person or location, browsing items, and reviewing audit trails of revision history.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/Goods-Inventory/llms.txt
Use this file to discover all available pages before exploring further.
Logging in
Route/admin renders AdminPage. The form POSTs { name, password } to POST /api/login. On success, the JWT access_token is stored in localStorage under the key "token" and the user is redirected to /dashboard.
AdminPage.jsx
Dashboard search
Route/dashboard renders Dashboard. Admins can toggle between searching by “Responsables” or “Ubicaciones” using a dropdown. The query is debounced (250ms) and calls either:
GET /api/admin/responsables/buscar?q={q}— returns[{ id, name }]GET /api/admin/ubicaciones/buscar?q={q}— returns[{ id_location, number_location, description, ... }]
Authorization: Bearer {token} header. A 401 response clears the token from localStorage and redirects the user to /admin.
Viewing a responsible’s locations
Route/admin/responsable/:id renders AdminResponsablesUbicacion. It fetches GET /api/admin/responsables/{id}/ubicaciones and displays all locations assigned to that responsible person, including the last revision date for each.
Viewing a location’s items and revisions
Route/admin/ubicacion/:id_location renders AdminUbicacionRevisiones. This page makes two parallel fetches:
GET /api/admin/items/{id_location}— renders an items table with account numbers and descriptionsGET /api/admin/locations/{id_location}/revisions— renders revision history cards sorted newest first
Token expiry
The JWT token expires after the number of days configured inJWT_EXPIRES_DAYS (default: 1 day). When a 401 is received on any admin request, the frontend clears localStorage and redirects back to the login page at /admin.