Smart Room Booking System is a complete, self-hosted room reservation platform built for music schools, rehearsal studios, co-working spaces, and any venue that needs smart room management.
Built with PHP 8.0+ and MySQL — no framework dependencies. The system includes a Progressive Web App (PWA) with push notifications, a full gamification engine with token economy, and a unique QR code check-in system with GPS geofencing to prevent no-shows.
Homepage — browse rooms grouped by building with live availability indicators
Tech Stack
Layer
Technology
Backend
PHP 8.0+ (vanilla, no framework)
Database
MySQL 5.7+ / MariaDB 10.6+
Frontend
HTML5, CSS3, Vanilla JS
UI Libraries
jQuery, jQuery UI, Bootstrap 4, GSAP, Font Awesome
Optional — required for push notifications & PWA install
3. Quick Install (Recommended)
The easiest way to get started. No command line needed.
1
Upload Files
Extract the ZIP and place all project files in your web server's document root (e.g., /var/www/html/booking/ or C:\xampp\htdocs\booking\).
2
Open the Installer
Visit http://your-domain/install.php in your browser.
3
Step 1 — Requirements Check
The installer automatically verifies PHP version, required extensions, and directory permissions. Fix any issues shown in red before proceeding.
Installer Step 1 — automated requirements and environment check
4
Step 2 — Database Setup
Enter your database host, port, username, password, and database name. The installer creates the database automatically if it doesn't exist and imports all 18 tables from the schema.
Installer Step 2 — enter database credentials; the schema is imported automatically
5
Step 3 — App Configuration
Set the application name and choose which feature modules to enable:
QR Code Check-In — QR scanning and GPS geofencing system
Installer Step 3 — set app name and toggle feature modules
6
Step 4 — Create Admin Account
Create the first administrator account with name, email, username, and password.
Installer Step 4 — create the first administrator account
7
Step 5 — Finalize
The installer generates the .env configuration file, runs composer install, and creates a lock file to prevent re-installation. Delete install.php when prompted.
Register a normal account via the registration page
Promote it to admin in the database:
UPDATE users SET isAdmin = 1 WHERE username = 'your_username';
Step 7 — Verify
Visit http://your-domain/ — you should see the login page:
Login page — supports remember-me and password reset
5. Configuration
All configuration is managed through the .env file. A template is provided in .env.example.
Variable
Description
Default
DB_HOST
Database host
localhost
DB_PORT
Database port
3306
DB_USERNAME
Database username
—
DB_PASSWORD
Database password
—
DB_DATABASE
Database name
—
APP_NAME
Application display name
Hall Booking
APP_DEBUG
Show detailed errors
false
FEATURE_TOKENS
Enable token economy & reward shop
true
FEATURE_GAMIFICATION
Enable badges, streaks, ranks, leaderboard
true
FEATURE_QR_CHECKIN
Enable QR check-in & GPS geofencing
false
6. Feature Flags
Three major features can be independently toggled via the .env file:
Token Economy
Set FEATURE_TOKENS=false to disable:
Token earning and spending
The reward shop
Token balance display in navigation
Gamification
Set FEATURE_GAMIFICATION=false to disable:
Badges, streaks, and rank progression
Leaderboard and milestone celebrations
Weekly progress ring
ℹ️ Note: Gamification depends on the token system. Setting FEATURE_TOKENS=false automatically disables gamification regardless of its own flag.
QR Code Check-In
Set FEATURE_QR_CHECKIN=false to disable:
QR code scanning and check-in
GPS geofence verification
Auto-release of no-show bookings
ℹ️ Note: QR check-in can also be toggled at runtime from the admin panel — no restart or file editing needed.
7. Admin Panel Usage
Access the admin panel at /admin/admin_panel.php (requires an admin account).
Dashboard
The admin dashboard shows 20+ real-time metrics including: users online, bookings today/this week, hours logged, rooms occupied, peak hours, system health (DB size, PHP version, uptime), recent bookings, and recent logins.
Admin dashboard — 20+ real-time metrics at a glance
Room & Building Management
Buildings: Create buildings with name, address, GPS coordinates, and geofence radius. Use the interactive Leaflet.js map to set coordinates by clicking, searching, or entering manually.
Building management — list of all buildings with address and geofence settingsInteractive Leaflet.js map — set GPS coordinates and geofence radius per building
Rooms: Create rooms within buildings. Set name, upload an image (drag-and-drop), add amenity tags (20+ predefined + custom), set min/max booking durations, and toggle maintenance mode.
Room management — overview of all roomsRoom editor — image upload, amenity tags, duration limits
Printable QR code per room — download as PNG for door signage
User Management
View all users with search and filters
Change user booking levels (3 customizable tiers)
Suspend or reactivate accounts with reason
Promote users to admin
Award tokens manually
User management — search, filter, change levels, suspend, or promote
Booking Levels
Configure 3 user levels from the admin panel:
Setting
Description
Range
Level Name
Display name (e.g., "Student", "Teacher", "VIP")
Up to 30 characters
Days in Advance
How far ahead this level can book
1–365 days
Max Bookings/Day
Maximum daily reservations
0–50 (0 = unlimited)
Booking levels — configure advance days and daily limits per tier
Announcements
Create announcements with 3 types (Info, Warning, Celebration), optional priority, and expiration date. Announcements are delivered via in-app notification, push notification, and email broadcast simultaneously.
Announcement system — multi-channel delivery (in-app, push, email)
Badge & Reward Management
Create, edit, toggle, and delete custom badges and shop rewards with full control over pricing, quantities, and duration.
Badge management — create and toggle achievement badgesReward management — set prices, quantities, and durations
Token Economy
Monitor token circulation, adjust earning rates, and manage the overall economy from the admin panel.
Token economy — configure earning rates and monitor circulation
Email Configuration
Configure SMTP settings entirely from the admin panel: host, port, encryption (TLS/SSL/none), username, password, sender name, and sender email. Use the Test Email button to verify your configuration.
SMTP configuration — host, port, encryption, credentials, and test button
Reports & Logs
5 report types with custom date ranges:
Room Utilization — Bookings and total minutes per room
Daily Trends — Bookings and unique users per day
Peak Hours — Booking distribution by hour
User Activity — Top bookers with check-in rates
Summary — Total bookings, hours, cancellations, averages
Booking logs support filtering, pagination, and CSV/PDF export.
Booking logs — filterable list with CSV/PDF export
8. User Guide
Browsing Rooms
The homepage displays all rooms organized by building. Each room card shows the room photo, amenity icons, and current availability status.
Room listing — browse all rooms with amenity tags and availability
Booking a Room
Click a room card to view its detail page (image, amenities, heatmap, availability)
Select a date and time using the visual time-slot picker or dropdown selectors
Click Book — the system checks for conflicts in real-time
Confirm the booking details
View your bookings under My Bookings
Select date and time slot for your bookingConfirm booking details before submission
Booking confirmed — success notification with booking detailsMy Bookings — upcoming and past reservations with quick actions
Quick Book Widget
Use the quick-book widget on the homepage to instantly find and book available rooms for a specific date and time range.
Quick Book — find available rooms instantly by date and time
QR Check-In (when enabled)
A QR code is printed/posted on each room's door
Open the app (PWA) and go to Check-In or use the scan button
Scan the room's QR code with your device's camera
The system verifies your GPS location against the building's geofence
If within range, you're checked in. If not, you see your exact distance
To leave early, scan the QR code again — remaining time is freed instantly
QR check-in admin settings — toggle, geofence radius, check-in window, and auto-release
5 themes: Dark Cosmos, Cherry Blossom, Spring Garden, Morning Sunrise, Modern Minimal
Add new languages by dropping a JSON file in lang/
12. Troubleshooting
“Connection failed” error
Verify database credentials in .env
Ensure MySQL/MariaDB service is running
Check that the database exists
Blank page / 500 error
Set APP_DEBUG=true in .env temporarily
Check PHP error logs
Verify all required PHP extensions are enabled
Composer errors
Ensure PHP is in your system PATH
Test autoloading: php -r "require 'vendor/autoload.php'; echo 'OK';"
Re-run: composer install
Push notifications not working
Site must be served over HTTPS
VAPID keys must be generated (Admin Panel → Push Settings)
openssl and curl PHP extensions must be enabled
Check error_log for push-related errors
Upload / image issues
Ensure images/ directory is writable by the web server
Check PHP upload_max_filesize and post_max_size in php.ini
13. Production Checklist
Delete install.php after setup
Set APP_DEBUG=false in .env
Use a strong, unique database password
Enable HTTPS (required for push notifications and PWA)
Block access to .env via web server config
Set secure session cookie parameters in php.ini
Configure proper file permissions
Set up cron jobs for booking reminders
Configure SMTP email settings in the admin panel
Generate VAPID keys for push notifications
Set up regular database backups
14. Support
If you encounter any issues or have questions, please reach out through the Codester item comments or support system. We aim to respond within 24 hours.
What's Included
Complete PHP source code (no obfuscation, no license server, no encoded files)
15 language translation files
5 theme stylesheets
Database schema
5-step web-based installer
.htaccess with security hardening
Service worker for PWA
This documentation + README, INSTALL, FEATURES, API reference, and CHANGELOG