How manuelrisco/tf-pendientes works
1. Purpose and System Shape
This is a task-management and operational tracking system with a React/Vite single-page frontend and a PHP API backend. It supports authentication, task administration, user management, dashboards, movements/audit activity, catalogs, and reporting. Database artifacts are under BD/bd.txt and BD/tf_pendientes.sql.
2. Application Entry Points
• Frontend bootstraps React from frontend/src/main.jsx, with application composition and routing likely rooted in frontend/src/App.jsx.
• PHP requests enter through backend/index.php; Apache rewrite behavior is defined by backend/.htaccess.
• API dispatch is centralized in backend/core/Router.php, separating HTTP entry handling from feature controllers.
3. Frontend Shell, Session, and UI State
The SPA uses provider-level state for authentication and theme behavior:
• frontend/src/context/AuthContext.jsx
• frontend/src/context/ThemeContext.jsx
• frontend/src/components/Layout/Layout.jsx
The authenticated application shell is composed from layout/navigation elements such as frontend/src/components/Sidebar/Sidebar.jsx and frontend/src/components/TopBar/TopBar.jsx. The HTTP client boundary is frontend/src/lib/axios.js, which should be the principal frontend-to-API integration point.
4. Feature Screens and Client Flows
Feature pages own their view-specific fetch/mutation orchestration through colocated hooks:
• Dashboard: frontend/src/pages/Dashboard/Dashboard.jsx, frontend/src/pages/Dashboard/useDashboard.js
• Task management: frontend/src/pages/GestionTareas/GestionTareas.jsx, frontend/src/pages/GestionTareas/useGestionTareas.js
• User administration: frontend/src/pages/Usuarios/Usuarios.jsx, frontend/src/pages/Usuarios/useUsuarios.js
Additional operational views are frontend/src/pages/Movimientos/Movimientos.jsx and frontend/src/pages/Reportes/Reportes.jsx. Login is isolated in frontend/src/pages/Login/Login.jsx and frontend/src/pages/Login/useLogin.js, forming the transition into authenticated state.
5. API Controller and Authorization Layer
Controllers expose domain-oriented endpoints:
• Authentication and users: backend/controllers/AuthController.php, backend/controllers/UsuarioController.php
• Tasks and movements: backend/controllers/TareaController.php, backend/controllers/MovimientosController.php
• Dashboard, reports, and catalog values: backend/controllers/DashboardController.php, backend/controllers/ReporteController.php, backend/controllers/CatalogoController.php
Cross-cutting request boundaries are JWT issuance/verification in backend/core/JwtHelper.php, authorization enforcement in backend/middleware/AuthMiddleware.php, and normalized API output in backend/core/Response.php. The frontend session must carry credentials through its Axios boundary; protected API routes must pass middleware before controller execution.
6. Persistence and Domain Model
Database connection configuration is centralized at backend/config/database.php. Controller operations are delegated to query/data-access models:
• Tasks and users: backend/models/TareaModel.php, backend/models/UsuarioModel.php
• Aggregations/reporting: backend/models/DashboardModel.php, backend/models/ReporteModel.php
• Reference data: backend/models/CatalogoModel.php
Domain entities define the system’s core records and reference dimensions: backend/entities/Tarea.php, backend/entities/Movimiento.php, backend/entities/Usuario.php, plus status, priority, role, and audit-related entities such as backend/entities/Estado.php, backend/entities/Prioridad.php, and backend/entities/Bitacora.php.
7. Runtime and Infrastructure Boundaries
The frontend is a Vite-managed JavaScript/React runtime (frontend/package.json, frontend/vite.config.js). The backend is a Composer-managed PHP deployment (backend/composer.json) served through an Apache-compatible entry/rewrite setup. Its only evident infrastructure dependency is a relational database configured by backend/config/database.php; the repository does not show third-party SaaS integrations.
Main entry points: axios.js Axios client · App.jsx App routing · Layout.jsx Authenticated layout · TareaController.php Domain controllers
Components 20
React SPA
Vite-managed browser application.
- Vite runtime
frontend/vite.config.js - SPA entry
frontend/src/main.jsx - App routing
frontend/src/App.jsx - Session state · Stores authenticated client state.
frontend/src/context/AuthContext.jsx - Theme state
frontend/src/context/ThemeContext.jsx - Authenticated layout · Composes navigation and protected views.
frontend/src/components/Layout/Layout.jsx - Axios client · Carries frontend requests and credentials to the API.
frontend/src/lib/axios.js - Login flow · Authenticates users and establishes session state.
frontend/src/pages/Login/Login.jsx - Dashboard
frontend/src/pages/Dashboard/Dashboard.jsx - Task management
frontend/src/pages/GestionTareas/GestionTareas.jsx - User administration
frontend/src/pages/Usuarios/Usuarios.jsx - Movements and reports
frontend/src/pages/Movimientos/Movimientos.jsx
PHP API
Apache-served API runtime.
- Apache API entry · Rewrite rules direct requests into PHP.
backend/index.php - API router · Routes requests to domain controllers.
backend/core/Router.php - JWT authorization · Verifies protected requests and issues session tokens.
backend/middleware/AuthMiddleware.php - Domain controllers · Auth, users, tasks, movements, dashboard, reports, and catalogs.
backend/controllers/TareaController.php - Domain entities · Task, user, movement, status, priority, role, and audit records.
backend/entities/Tarea.php
Persistence
Relational task-tracking data.
- Data-access models · Executes domain queries and report aggregations.
backend/models/TareaModel.php - Database connection
backend/config/database.php - Relational database · Stores tasks, users, movements, audit records, and catalogs.
BD/tf_pendientes.sql
Connections 24
- Vite runtime → SPA entry: serves
- SPA entry → App routing: mounts
- App routing → Session state: uses
- App routing → Theme state: uses
- App routing → Login flow: routes to
- App routing → Authenticated layout: routes authenticated users to
- Authenticated layout → Dashboard: hosts
- Authenticated layout → Task management: hosts
- Authenticated layout → User administration: hosts
- Authenticated layout → Movements and reports: hosts
- Login flow → Axios client: authenticates through
- Dashboard → Axios client: loads data through
- Task management → Axios client: mutates through
- User administration → Axios client: manages through
- Movements and reports → Axios client: queries through
- Axios client → Apache API entry: HTTP requests
- Apache API entry → API router: dispatches
- API router → JWT authorization: protects routes with
- JWT authorization → Domain controllers: authorizes
- API router → Domain controllers: dispatches public routes to
- Domain controllers → Data-access models: delegates queries to
- Domain controllers → Domain entities: uses
- Data-access models → Database connection: connects via
- Database connection → Relational database: connects to