Prerequisites
Before installing Apartado de Salas, ensure your server meets these requirements:- PHP 7.4+ with PDO MySQL extension
- MySQL 5.7+ or MariaDB 10.3+
- Apache or Nginx web server
- Git (for cloning the repository)
Installation Steps
Clone the Repository
Download the source code from GitHub:
The
main branch contains the legacy version. Use the clean-architecture branch for the refactored MVC implementation:Create the Database
Create a new MySQL database for the application:
The default database name is
sesiones. You can use a different name and update the configuration in the next step.Import Database Schema
Import the database schema and seed data:
If a schema file is not provided in the repository, you’ll need to create the database structure manually. Check the
/app/models/ directory for table structures referenced in the code.Configure Database Connection
Update the database configuration file at Replace the values with your database credentials:
app/config/database.php:host: Database server hostname (usuallylocalhost)dbname: Database name created in step 3user: MySQL usernamepassword: MySQL password
Configure Application Settings
Update the base URL in Set
app/config/app.php:BASE_URL to match your installation path:- Local:
http://localhost/Apartado-Salas - Production:
https://yourdomain.com
Front Controller Architecture
The application uses a Front Controller pattern where all requests are routed throughpublic/index.php:
- Clean URLs without
.phpextensions - Centralized request handling
- Consistent routing logic
- Protection of application files outside
public/
Database Structure
The system uses these core tables:- users: User accounts with role assignment
- rooms: Available rooms for reservation
- materials: Materials catalog
- room_materials: Room-specific material availability
- reservations: Reservation requests (parent record)
- reservation_slots: Date/time slots for each reservation
- reservation_materials: Materials assigned to reservations
All database operations use PDO with prepared statements for security. See Database Architecture for details.
Troubleshooting
404 Errors on All Routes
Problem: Login page works, but all other pages show 404 errors. Solution: Your web server isn’t routing requests throughindex.php. Check your .htaccess (Apache) or Nginx configuration.
Database Connection Failed
Problem: “Error de conexión a la base de datos” message. Solution:- Verify database credentials in
app/config/database.php - Ensure MySQL service is running:
sudo systemctl status mysql - Check PDO MySQL extension:
php -m | grep pdo_mysql
Blank Page After Login
Problem: Login succeeds but shows a blank page. Solution:- Enable error display in
public/index.php: - Check PHP error logs:
tail -f /var/log/apache2/error.log
Sessions Not Persisting
Problem: Login works but immediately logs out. Solution:- Verify PHP session directory is writable:
ls -la /var/lib/php/sessions/ - Check session configuration in
php.ini - Ensure cookies are enabled in your browser
Next Steps
Quick Start Guide
Try the system with demo credentials and create your first reservation
Architecture Overview
Learn how the MVC pattern is implemented in this project