Documentation Index
Fetch the complete documentation index at: https://mintlify.com/IvBanzaga/Refugio/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start Guide
This guide will help you get Refugio running on your local machine in just a few minutes. Perfect for development, testing, or evaluation purposes.This quick start uses PostgreSQL. For MySQL setup or production deployment, see the Installation Guide.
Prerequisites
Before you begin, ensure you have:- PHP 7.4 or higher
- PostgreSQL 12+ (or MySQL 5.7+)
- Git (for cloning the repository)
- A terminal/command prompt
Installation Steps
Clone the Repository
Clone the Refugio repository to your local machine:
Replace the repository URL with your actual Refugio repository location.
Set Up the Database
Create a new PostgreSQL database:Create the database schema. Refer to the Database Schema documentation for complete table definitions.
The schema includes sample data with test users (admin@hostel.com/admin123) and room configurations.
Configure Database Connection
Create a
conexion.php file in the project root (this file is gitignored for security):conexion.php
First Login
Use one of the default test accounts to log in:- Admin Account
- User Account
Login with administrator privileges:
- Email:
admin@hostel.com - Password:
admin123
- Manage users (create, edit, delete)
- Approve or reject reservations
- View all bookings and statistics
- Configure rooms and beds
Exploring the Admin Panel
After logging in as admin, you’ll see the dashboard (viewAdmin.php):
Dashboard Overview
The admin dashboard displays:- Statistics Cards: Total users, pending reservations, occupancy rates
- Navigation Tabs:
- Dashboard - Overview and metrics
- Users - User management (CRUD operations)
- Reservations - Pending approval queue
- Rooms - Room and bed status
Managing Users
Navigate to the Users tab to:- Click “Add New User”
- Fill in the user details (name, email, member number, etc.)
- Assign a role (admin or user)
- Set initial password
- Save the user
Approving Reservations
Reservations require admin approval:- Go to the Reservations tab
- Review pending reservations
- Click “Approve” or “Reject”
- Users are notified of the status change
Exploring the User Panel
Log in as a user to see the member interface (viewSocio.php):
Making a Reservation
Select Dates
Use the interactive calendar to:
- View available beds per day
- See color-coded availability indicators
- Click on a date range for booking
Choose Room and Beds
Select your room and number of beds:The system dynamically shows available beds for your selected dates.
Dynamic Bed Selection (viewSocio.php:50)
Add Companions (Optional)
If booking multiple beds, add companion information:
- Member number (if companion is a member)
- Full name
- ID/DNI number
- Mark if they’re a club member
Companion Management (viewSocio.php:63)
Verification
To verify your installation is working correctly:Using the Verification Script
Run the included verification script:- Database connectivity
- Table structure
- Test data presence
- PDO functionality
Manual Verification
Check Database Tables
Check Database Tables
Connect to your database and verify tables exist:You should see:
- usuarios
- habitaciones
- camas
- reservas
- acompanantes
Test User Authentication
Test User Authentication
The login system uses secure password verification:
Login Authentication (login.php:16)
Common Quick Start Issues
Database Connection Failed
Database Connection Failed
Error:
SQLSTATE[08006] Connection failedSolution:- Verify PostgreSQL is running:
pg_isready - Check credentials in
conexion.php - Ensure database
refugioexists - Verify PostgreSQL is listening on localhost:5432
Login Fails with Correct Credentials
Login Fails with Correct Credentials
Error: Credentials invalid messageSolution:
- Ensure database was imported correctly
- Check if password hashing is working
- Verify PHP PDO extension is enabled
- Run:
php -m | grep pdo
Session/Cookie Warnings
Session/Cookie Warnings
Port 8000 Already in Use
Port 8000 Already in Use
Error: Address already in useSolution:
Use a different port:Then access at
http://localhost:8080Security Checklist
Before using in production:Change all default passwords
Update
conexion.php with strong database credentialsEnable HTTPS (required for production)
Review and update session cookie settings
Set appropriate file permissions (644 for PHP files)
Remove or secure
verificar_mysql.phpConfigure error logging (disable display_errors)
Next Steps
Now that you have Refugio running:Production Installation
Deploy Refugio to a production server with proper security
Configuration Guide
Customize settings, email notifications, and more
API Reference
Learn about the available functions and endpoints
Troubleshooting
Solutions to common issues and error messages
Congratulations! Your Refugio installation is ready. Start exploring the features and customize it for your mountain refuge. 🏔️