How martincarreno/uptask works
Purpose and Runtime
This is a PHP task/project management application with authentication, user dashboards, projects, and tasks. It uses Composer-managed PHP dependencies, a relational database initialized from docs/script.sql, and browser assets compiled with Gulp from SCSS/JavaScript into public/build/.
HTTP Entry and Routing
public/index.php is the public front controller. It loads application bootstrap code and dispatches requests through the custom router in Router.php. Application initialization and database wiring are centralized in includes/app.php and includes/database.php.
Controller Layer
Controllers own request handling, session/auth decisions, validation orchestration, and view/API responses:
• controllers/LoginController.php handles registration, login, account confirmation, password recovery, and reset flows.
• controllers/DashboardController.php serves authenticated dashboard, profile, password, and project creation/navigation views.
• controllers/TareaController.php exposes task-oriented operations, likely consumed asynchronously by the dashboard task UI.
Domain and Persistence Model
Models follow a shared Active Record persistence pattern:
• models/ActiveRecord.php provides database connection, CRUD conventions, validation, and model mapping.
• models/Usuario.php represents accounts and authentication-related state.
• models/Proyecto.php and models/Tarea.php represent the project/task hierarchy.
Database schema and relational constraints are defined in docs/script.sql; controllers should enforce ownership boundaries when resolving projects and tasks for the active user.
Authentication and Email Boundary
Authentication-related screens are rendered from views/auth/, while account confirmation and recovery messages are sent through classes/Email.php. The login controller is the boundary between HTTP/session state, Usuario persistence, and outbound email. Shared request/session utilities reside in includes/funciones.php.
Dashboard and Rendering Composition
Server-rendered pages use views/layout.php as the main layout and compose dashboard shell elements from views/dashboard/header-dashboard.php, views/templates/sidebar.php, and views/templates/barra.php. Project detail rendering occurs in views/dashboard/proyecto.php; its client behavior is paired with the task JavaScript bundle.
Client Assets and Task Interaction
Source assets are maintained under src/ and emitted under public/build/:
• src/js/tareas.js drives interactive task behavior, likely calling task controller routes.
• src/js/app.js contains shared browser behavior.
• src/scss/dashboard/_tareas.scss and related dashboard styles define the task/project UI.
Compiled files such as public/build/js/tareas.js and public/build/css/app.css are the runtime assets served to browsers.
Primary Flow
A request enters public/index.php, routes via Router.php, and reaches an auth, dashboard, or task controller. Controllers load Active Record models through the shared database connection, then either render PHP views or return task-operation results to browser JavaScript. Auth flows may also invoke classes/Email.php; authenticated dashboard flows render projects/tasks and delegate interactive task updates to src/js/tareas.js’s compiled output.
Main entry points: LoginController.php Login controller · DashboardController.php Dashboard controller · Router.php Custom router · ActiveRecord.php Active Record
Components 20
HTTP application
- Public front controller
public/index.php - Custom router
Router.php - Application bootstrap
includes/app.php - Session utilities
includes/funciones.php - Login controller · Handles registration, login, confirmation, and password recovery.
controllers/LoginController.php - Dashboard controller
controllers/DashboardController.php - Task controller
controllers/TareaController.php - Email service
classes/Email.php
Domain & persistence
- Database wiring
includes/database.php - Active Record · Provides CRUD, validation, mapping, and shared database access.
models/ActiveRecord.php - User model
models/Usuario.php - Project model
models/Proyecto.php - Task model
models/Tarea.php - Relational database · Defines account, project, and task relations.
docs/script.sql
Rendering & browser
- Browser
- Dashboard view composition · Layout, dashboard shell, and project detail rendering.
views/layout.php - Task interaction source
src/js/tareas.js - Task JavaScript bundle
public/build/js/tareas.js - Dashboard task styles
src/scss/dashboard/_tareas.scss - Application CSS bundle
public/build/css/app.css
Connections 27
- Browser → Public front controller: HTTP requests
- Public front controller → Application bootstrap: loads
- Public front controller → Custom router: dispatches through
- Application bootstrap → Database wiring: initializes
- Custom router → Login controller: auth routes
- Custom router → Dashboard controller: dashboard routes
- Custom router → Task controller: task routes
- Login controller → Session utilities: sessions
- Login controller → User model: accounts
- Login controller → Email service: confirmation and recovery
- Dashboard controller → Session utilities: authenticated access
- Dashboard controller → Project model: projects
- Dashboard controller → Task model: tasks
- Task controller → Task model: task operations
- Active Record → Database wiring: uses connection
- User model → Active Record: extends
- Project model → Active Record: extends
- Task model → Active Record: extends
- Database wiring → Relational database: connects to
- Login controller → Dashboard view composition: renders auth pages
- Dashboard controller → Dashboard view composition: renders dashboard
- Dashboard view composition → Task JavaScript bundle: serves task UI
- Browser → Task JavaScript bundle: loads
- Task JavaScript bundle → Task controller: asynchronous task requests
- Task interaction source → Task JavaScript bundle: compiled into
- Dashboard task styles → Application CSS bundle: compiled into
- Browser → Application CSS bundle: loads