PortalHub is a full-stack PHP/MySQL accounting consultancy portal designed to centralise and automate every touchpoint between a firm’s administrators, advisors, and clients. This page introduces the platform’s purpose, the three user roles it serves, the capabilities each role can access, and the underlying technology stack that powers the system.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Nieto2020/portalhub/llms.txt
Use this file to discover all available pages before exploring further.
What Is PortalHub?
PortalHub is a role-based web application purpose-built for accounting consultancy firms. It replaces fragmented spreadsheets, email threads, and manual payment tracking with a single, access-controlled environment. Every feature — from scheduling an advisory session to downloading a fiscal document — is surfaced through a dashboard that adapts to the authenticated user’s role, ensuring that each actor sees only the data and actions relevant to them. The platform is self-hosted, ships with a Docker-based development environment, and stores all data in a relational MySQL schema with enforced foreign-key constraints andutf8mb4 character encoding.
User Roles
PortalHub defines three roles at the database level (cat_roles) and enforces them throughout the middleware layer using PHP constants (ROL_ADMIN = 1, ROL_ASESOR = 2, ROL_CLIENTE = 3).
| Role | Description |
|---|---|
| Admin | Full platform control — global user management, advisor assignment, executive reports, and system-wide announcements. |
| Asesor | Manages a dedicated client portfolio — controls appointments, reviews uploaded documents, tracks service progress, and authors reports. |
| Cliente | Self-service access — views their financial dashboard, uploads fiscal documents, monitors payment status, and sends messages to their assigned advisor. |
Key Capabilities
PortalHub ships with six core modules available across roles according to their permissions:- Appointments (
citas) — Clients book advisory sessions that advisors can reschedule or cancel, with a cancellation-reason field and automatic status transitions (Programada → Reprogramada → Cancelada). - Documents (
documentos) — Role-scoped file repository for fiscal and accounting files. Each document carries a type, version counter, and optional CFDI-validation flag. Uploaded files are stored underbackend/uploads/and protected by an.htaccessrule that blocks direct browser access. - Payments (
pagos_facturacion) — Full payment lifecycle:Pendiente → Registrado → Aprobado, linked to a specific accounting service and optionally to an invoice (Pendiente → Emitida). - Messaging (
mensajes) — Internal chat and ticketing system supporting text and file attachments between any two users. - Notifications (
notificaciones) — Event-driven notification records delivered to a destination user, flagged as read/unread with a typed event label. - Reports (
reportes) — Advisors author monthly, quarterly, annual, or special reports with a draft/publish/archive workflow. Admins have read access across all reports.
Technology Stack
| Layer | Technology |
|---|---|
| Runtime | PHP 8.3-FPM |
| Database | MySQL 8.4 |
| Web server | Nginx (latest) |
| Containerisation | Docker & Docker Compose |
| Frontend | Vanilla HTML/CSS/JavaScript (ES6+) |
Security Model
PortalHub applies several layers of protection out of the box:- Session timeout — Sessions expire after 30 minutes of inactivity (
SESSION_TIMEOUT = 1800), enforced server-side on every authenticated request. - CSRF protection — The
config.phpbootstrap detects HTTPS (including reverse-proxy headers) and promotes session cookies toSecure, supplemented byHttpOnlyandSameSite=Laxattributes. - Role-based access control — Backend middleware validates the authenticated user’s role constant before executing any module logic, preventing privilege escalation.
- Password hashing — All passwords are stored as BCRYPT hashes in the
password_hashcolumn of theusuariostable. - First-login enforcement — The
require_password_changeflag onusuariosforces new accounts to set a personal password before accessing the platform.
Explore Further
Architecture Overview
Understand the project structure, module boundaries, and how the frontend and backend communicate over a JSON API.
User Guides
Step-by-step walkthroughs for Admin, Asesor, and Cliente workflows inside the portal.
API Reference
Explore every backend endpoint — request shapes, response envelopes, and authentication requirements.
Features
Deep dives into appointments, documents, payments, messaging, notifications, and reports.