Skip to main content
This page covers every step needed to get Hotel Guevarini running in a local development environment.

Prerequisites

Web server

XAMPP, WAMP, or Laragon — any stack that bundles Apache and MySQL/MariaDB.

PHP 7.4+

The backend is built on PHP 7.4. Verify with php -v in a terminal.

MySQL or MariaDB

Included with XAMPP, WAMP, and Laragon. Accessible via phpMyAdmin or any MySQL client.

Composer

PHP dependency manager required to install PHPMailer. Download at getcomposer.org.

Steps

1

Clone or download the project

Clone the repository using Git:
git clone https://github.com/EmirPolito/CRUD-HOTEL-GUEVARINI-Publico.git
Then move the CRUD-HOTEL-GUEVARINI-Publico folder into the public directory of your web server.
C:\xampp\htdocs\CRUD-HOTEL-GUEVARINI-Publico\
2

Install PHP dependencies

Open a terminal, navigate to the project root, and run:
composer install
Composer reads composer.json and downloads PHPMailer ^7.0 into the vendor/ directory. This directory must be present for email features to work.
3

Set up the database

  1. Start your MySQL/MariaDB server (via the XAMPP or WAMP control panel, or by launching Laragon).
  2. Open your MySQL client (phpMyAdmin, DBeaver, MySQL Workbench, or the CLI).
  3. Import base_de_datos.sql from the project root.
Using the MySQL CLI:
mysql -u root -p < base_de_datos.sql
What the script creates:
  • Database: hotel_guevarini_publico
  • Tables: roles, usuarios, clientes, habitaciones, reservaciones
  • Seed data: two roles (Administrator, Client), two test user accounts, two sample clients, sample rooms, and a sample reservation
4

Configure database credentials

Open php/conexion.php and replace the placeholder values with your local MySQL credentials:
<?php

class Conexion
{
    private $host     = "localhost"; // Your DB server address
    private $db_name  = "hotel_guevarini_publico";
    private $username = "root";      // Your MySQL username
    private $password = "";          // Your MySQL password (empty by default on local stacks)
    public  $conn;

    public function obtenerConexion()
    {
        $this->conn = null;
        try {
            $this->conn = new PDO(
                "mysql:host=" . $this->host . ";dbname=" . $this->db_name,
                $this->username,
                $this->password
            );
            $this->conn->exec("set names utf8");
            $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $exception) {
            echo "Error de conexión: " . $exception->getMessage();
        }
        return $this->conn;
    }
}
Never commit real database credentials to version control. Add php/conexion.php to your .gitignore or use environment variables before pushing to a shared repository.
5

Configure SMTP for email

Hotel Guevarini sends transactional emails for account verification and password recovery. You must provide SMTP credentials in the following four files:
  • php/auth/procesar_registro.php — sends the verification email on new registration
  • php/auth/enviar_recuperacion.php — sends the password recovery link
  • php/auth/reenviar_verificacion.php — resends the verification email on request
  • php/usuarios/guardar_usuario.php — sends verification when an admin creates a user
In each file, locate the PHPMailer configuration block and fill in your credentials:
$mail->Host     = 'sandbox.smtp.mailtrap.io'; // Your SMTP server
$mail->Username = 'YOUR_SMTP_USERNAME';        // Your SMTP username
$mail->Password = 'YOUR_SMTP_PASSWORD';        // Your SMTP password
$mail->Port     = 587;                         // Your SMTP port
For local development, Mailtrap is an excellent option. It captures all outgoing email in a safe sandbox inbox without delivering to real addresses, so you can test the full verification and recovery flows without a production mail server.
6

Launch the application

Make sure both Apache and MySQL are running, then open the login page in your browser:
http://localhost/CRUD-HOTEL-GUEVARINI-Publico/views/login.php
Log in with one of the pre-configured test accounts:
RoleEmailPassword
Administratoradmin@correo.com12345
Clientcliente@correo.com12345