How juc-windell/frontend-arreglaya works
ArreglaYa is a React SPA for campus maintenance: users sign in, then access role-adapted dashboards and workflows for buildings/spaces, technicians/materials, requests, and work orders. Pages use service modules to call the Django REST API through a shared Axios client; authentication state, route protection, and error handling support those workflows. The README documents all major modules. Some page and integration code was not sampled, so links for those capabilities rely on documented routes or indexed imports rather than assumptions about internal call sequences.
Main entry points: App.jsx SPA routes · axios.js Axios client · Ordenes.jsx Work orders · AuthContext.jsx Session provider
Components 31
Access and shell
- SPA routes
src/App.jsx - Session provider
src/context/AuthContext.jsx - Authentication service
src/services/authService.js - Session hook
src/hooks/useAuth.js - Role permissions
src/utils/permisos.js - Protected routes
src/components/ProtectedRoute.jsx
Buildings and spaces
- Building pages
src/pages/Edificios.jsx - Building detail and edit
src/pages/EdificioDetalle.jsx - Building service
src/services/edificioService.js - Space pages
src/pages/Espacios.jsx - Space detail and edit
src/pages/EspacioDetalle.jsx - Space service
src/services/espacioService.js
Requests and work
- Request workflow
src/pages/Solicitudes.jsx - Request form
src/components/solicitudes/SolicitudForm.jsx - Work orders
src/pages/Ordenes.jsx - Order form
src/components/ordenes/OrdenForm.jsx - Register materials
src/components/ordenes/RegistrarMateriales.jsx - Order service
src/services/ordenService.js - Request service
src/services/solicitudService.js
Inventory and staff
- Technician management
src/pages/Tecnicos.jsx - Technician service
src/services/tecnicoService.js - Material management
src/pages/Materiales.jsx - Material service
src/services/materialService.js
Dashboard
- Dashboard
src/pages/Dashboard.jsx - Dashboard service
src/services/dashboardService.js
Shared client and UI
- Axios client
src/api/axios.js - API error handling
src/api/errores.js - Query and route hooks
src/hooks - Shared UI components
src/components
Other components
- Campus user
- Django REST API
Connections 45
- Campus user → SPA routes: uses
README.md - SPA routes → Protected routes: routes through
src/App.jsx - SPA routes → Dashboard: routes to
src/App.jsx - SPA routes → Building pages: routes to
src/App.jsx - SPA routes → Building detail and edit: routes to
src/App.jsx - SPA routes → Space pages: routes to
src/App.jsx - SPA routes → Space detail and edit: routes to
src/App.jsx - SPA routes → Technician management: routes to
src/App.jsx - SPA routes → Material management: routes to
src/App.jsx - SPA routes → Request workflow: routes to
src/App.jsx - SPA routes → Work orders: routes to
src/App.jsx - SPA routes → Session hook: reads session
src/App.jsx - Session provider → Authentication service: authenticates and revokes
src/context/AuthContext.jsx - Session provider → Axios client: registers 401 handler
src/context/AuthContext.jsx - Session provider → Role permissions: derives role access
src/context/AuthContext.jsx - Protected routes → Session hook: checks session
src/components/ProtectedRoute.jsx - Session provider → Django REST API: validates profile and revokes token
README.md - Axios client → Django REST API: sends API requests
README.md - Building pages → Building service: requests building data
src/pages/Edificios.jsx - Building detail and edit → Building service: requests building data
src/pages/EdificioDetalle.jsx - Space pages → Space service: requests space data
src/pages/Espacios.jsx - Space detail and edit → Space service: requests space data
src/pages/EspacioDetalle.jsx - Space detail and edit → Building service: loads building data
- Building service → Axios client: calls
src/services/edificioService.js - Space service → Axios client: calls
src/services/espacioService.js - Space service → Django REST API: queries related requests
src/services/espacioService.js - Request workflow → Request form: renders
- Work orders → Order form: renders
src/pages/Ordenes.jsx - Work orders → Register materials: renders
src/pages/Ordenes.jsx - Work orders → Order service: calls
src/pages/Ordenes.jsx - Work orders → Request service: loads request data
src/pages/Ordenes.jsx - Work orders → Technician service: loads technician data
src/pages/Ordenes.jsx - Work orders → Material service: loads material data
src/pages/Ordenes.jsx - Request workflow → Request service: uses
- Order service → Axios client: calls
src/services/ordenService.js - Request service → Axios client: calls
README.md - Technician management → Technician service: calls
src/pages/Tecnicos.jsx - Material management → Material service: calls
src/pages/Materiales.jsx - Technician service → Axios client: calls
src/services/tecnicoService.js - Material service → Axios client: calls
src/services/materialService.js - Dashboard → Dashboard service: loads indicators
src/pages/Dashboard.jsx - Dashboard service → Axios client: calls
src/services/dashboardService.js - Query and route hooks → API error handling: interprets query errors
src/hooks/useConsulta.js - Shared UI components → API error handling: displays API errors
src/components/dashboard/TarjetaIndicador.jsx - Axios client → Session provider: notifies on 401
src/api/axios.js