Skip to main content

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.

This guide walks you through every step required to get a local PortalHub instance running from a fresh clone. You will configure database credentials, initialise the MySQL schema, choose between the PHP built-in server and Docker, and open the login screen in your browser.

Prerequisites

Make sure the following tools are available on your machine before you begin:
  • PHP 8.0 or higher — required for the built-in server option and for running backend scripts directly.
  • MySQL or MariaDB — a running database server accessible with an admin-level account.
  • Docker & Docker Compose (optional) — needed only if you prefer the containerised path; Docker Desktop satisfies both requirements on macOS and Windows.
  • A modern browser — any browser with ECMAScript 6+ support (Chrome, Firefox, Edge, Safari).

Setup

1

Clone the Repository

Clone the project and enter the application directory:
git clone <url-del-repositorio>
cd consultoria-contable
2

Configure Database Credentials

Open backend/config/conexion.php — this file bootstraps a PDO connection using constants defined in backend/config/config.php. The constants are resolved from environment variables with sensible defaults:
define('DB_HOST', getenv('MYSQL_HOST')     ?: 'mysql');
define('DB_NAME', getenv('MYSQL_DATABASE') ?: 'consultoria');
define('DB_USER', getenv('MYSQL_USER')     ?: 'consultancy');
define('DB_PASS', getenv('MYSQL_PASSWORD') ?: 'consultancy123');
For a local (non-Docker) setup, either export environment variables in your shell or edit config.php directly and replace the defaults with your local MySQL credentials.For Docker, supply the same variables in a .env file at the project root — the mysql service reads them automatically via env_file. See the Deployment page for the full .env reference.
3

Initialise the Database

Import the schema to create all tables, indexes, and foreign-key constraints:
mysql -u root -p < database/schema.sql
Optionally, seed the database with test users and sample records for each role:
mysql -u root -p < database/seed.sql
The seed.sql file creates one account per role — admin, asesor, and cliente — so you can explore every part of the portal without creating data manually.
4

Start the Server

Choose the option that matches your environment:
Point PHP’s built-in web server at the backend directory, which acts as the document root for all API endpoints:
php -S localhost:8000 -t backend
The server starts immediately — no configuration files required. This option is ideal for quick local development but is not suitable for production.
5

Open PortalHub in Your Browser

Navigate to the login page that corresponds to your chosen server option:
http://localhost:8000/frontend/pages/auth/login.html
You should see the PortalHub authentication screen. Use the credentials provided by seed.sql to log in with the role you want to explore. Refer to the seed file for the exact email addresses and temporary passwords seeded for the admin, asesor, and cliente accounts.

After You Log In

Any account that has the require_password_change flag set to 1 in the usuarios table — including all accounts created by an administrator — will be redirected to a mandatory password-change screen on first login. You must set a new personal password before accessing the dashboard.
The application timezone defaults to America/Mexico_City, set via date_default_timezone_set() in backend/config/config.php and mirrored by the ENV TZ=America/Mexico_City directive in the PHP-FPM Dockerfile. If your MySQL server is in a different timezone, timestamps may appear offset until the server timezone is aligned.

Build docs developers (and LLMs) love