A robust hotel reservation system demonstrating practical implementation of data structures and algorithms in a real-world transaction processing environment. This school project features ACID-compliant booking operations, concurrent request handling, and secure payment processing.
- Overview
- Features
- Data Structures & Algorithms
- Tech Stack
- Installation
- Usage
- Project Structure
- Testing
- Documentation
- Contributing
- License
This project is a comprehensive Transaction Processing System (TPS) for hotel reservations that demonstrates the practical application of fundamental data structures and algorithms. The system ensures ACID compliance, handles concurrent requests efficiently, and provides real-time booking capabilities through a hybrid web-desktop architecture.
Key Highlights:
- β ACID-compliant transaction management with automatic rollback
- β Custom data structure implementations (Queue, HashTable, AVL Tree, Stack, Graph)
- β Performance optimizations achieving 10x faster queries
- β Hybrid architecture: Web app + Desktop admin panel
- β Secure payment processing via Xendit gateway
- User Authentication & Registration - Secure user accounts with session management
- Real-Time Room Availability - Instant availability checking with O(1) hash table lookups
- Reservation Management - Create, modify, and cancel bookings with transaction safety
- Payment Processing - Secure payment integration via Xendit (credit/debit cards, digital wallets)
- Promo Code System - Discount code validation and application
- Review & Rating System - Guest feedback and ratings
- Admin Dashboard - Comprehensive management interface (JavaFX desktop application)
- ACID Compliance - All operations maintain atomicity, consistency, isolation, and durability
- Concurrent Request Handling - Queue-based system prevents race conditions
- Transaction Rollback - Automatic rollback on failures using Stack data structure
- Audit Trail - Complete transaction logging for all operations
- Hash Table - O(1) average-time lookups for room status and user sessions
- AVL Tree - O(log n) price range queries and sorted room listings
- Queue - FIFO processing for fair request handling during peak loads
- Graph Algorithms - BFS/DFS for multi-room booking logic
- Database Indexing - Strategic indexes for 10x query performance improvement
| Structure | Implementation | Complexity | Use Case |
|---|---|---|---|
| Queue (FIFO) | BookingQueue.php |
O(1) enqueue/dequeue | Concurrent booking request management |
| Hash Table | HashTable.php |
O(1) average lookup | Room status, user sessions, active reservations |
| AVL Tree | BST.php |
O(log n) operations | Price range queries, sorted room inventory |
| Stack (LIFO) | TransactionStack.php |
O(1) push/pop | Transaction rollback, undo/redo operations |
| Graph | RoomGraph.php |
O(V + E) traversal | Room dependencies, multi-room bookings |
-
Sorting Algorithms (Java Admin Panel):
- Quick Sort - O(n log n) average case
- Merge Sort - O(n log n) worst case, stable
- Heap Sort - O(n log n) guaranteed performance
-
Graph Traversal:
- Breadth-First Search (BFS) - Shortest path finding
- Depth-First Search (DFS) - Room connection exploration
-
Hash Functions:
- djb2 algorithm - Efficient key distribution
-
Tree Operations:
- AVL rotations (left, right, left-right, right-left)
- Range queries with pruning
- PHP 8.2+ - Server-side programming
- Laravel 12.0 - Web framework
- SQLite/MySQL - Database (SQLite default, MySQL supported)
- React 18.3 - UI library
- TypeScript 5.5 - Type-safe JavaScript
- Tailwind CSS 3.1 - Utility-first CSS framework
- Alpine.js - Lightweight JavaScript framework
- Vite - Build tool and dev server
- Java 17+ - Programming language
- JavaFX 21 - Desktop application framework
- Maven - Build automation tool
- JDBC - Database connectivity
- Xendit API - Payment gateway integration
- Laravel Mail - Email notifications
- PHP 8.2 or higher
- Composer
- Node.js 18+ and npm
- Java 17+ (for admin panel)
- Maven 3.6+ (for admin panel)
- XAMPP (Windows) or LAMP (Linux) - Apache, MySQL, PHP stack
-
Clone the repository
git clone <repository-url> cd hotel-reservation-system
-
Install PHP dependencies
composer install
-
Configure environment
cp .env.example .env php artisan key:generate
-
Configure database (Edit
.envfile)DB_CONNECTION=sqlite DB_DATABASE=database/database.sqlite
-
Run migrations
php artisan migrate php artisan db:seed # Optional: seed sample data -
Install frontend dependencies
npm install npm run build
-
Start development server
# Terminal 1: Laravel server php artisan serve # Terminal 2: Vite dev server (for hot-reload) npm run dev
-
Access the application
- Web Application: http://localhost:8000
- Admin Login: http://localhost:8000/login
-
Navigate to admin panel directory
cd admin-panel -
Configure database connection
- Edit
src/main/resources/config.properties - Update database credentials
- Edit
-
Build the project
mvn clean compile
-
Run the application
mvn javafx:run
-
Create admin account (before first login)
# In Laravel project root php artisan tinkerApp\Models\Admin::create([ 'name' => 'Admin User', 'email' => 'admin@belmonthotel.com', 'password' => bcrypt('password'), 'is_active' => true ]);
For detailed installation instructions, see INSTALLATION.md and ADMIN_PANEL_SETUP.md.
- Register/Login - Create an account or login
- Search Rooms - Browse available rooms with filters
- Create Booking - Select dates and room, complete reservation
- Make Payment - Process payment via Xendit gateway
- Manage Bookings - View, modify, or cancel reservations
- Login - Use admin credentials
- Dashboard - View system statistics and metrics
- Manage Rooms - Add, edit, or delete rooms
- View Bookings - Monitor all reservations
- Process Payments - Track payment transactions
- Generate Reports - Export booking and revenue reports
hotel-reservation-system/
βββ app/
β βββ DataStructures/ # Custom data structure implementations
β β βββ BookingQueue.php # FIFO Queue
β β βββ HashTable.php # Hash Table with chaining
β β βββ BST.php # AVL Tree (self-balancing BST)
β β βββ TransactionStack.php # LIFO Stack
β β βββ RoomGraph.php # Graph with BFS/DFS
β βββ Http/Controllers/ # Request handlers
β βββ Models/ # Eloquent models
β βββ Services/ # Business logic
β βββ Mail/ # Email templates
βββ admin-panel/ # JavaFX desktop application
β βββ src/main/java/ # Java source code
β βββ pom.xml # Maven configuration
βββ database/
β βββ migrations/ # Database schema
β βββ seeders/ # Sample data
βββ resources/
β βββ js/ # React/TypeScript components
β βββ views/ # Blade templates
β βββ css/ # Stylesheets
βββ routes/ # Application routes
βββ tests/ # PHPUnit tests
βββ docs/ # Documentation
Run the test suite:
# Run all tests
php artisan test
# Run specific test file
php artisan test tests/Feature/ReservationTest.php
# Run with coverage
php artisan test --coverageTest Coverage:
- β Transaction Processing: 15+ test cases
- β User Authentication: 8+ test cases
- β Payment Processing: 6+ test cases
- β Database Interactions: 5+ test cases
- β Promo Code Validation: 7+ test cases
- Installation Guide - Detailed setup instructions
- API Documentation - API endpoint reference
- Endpoints Reference - Quick endpoint guide
- Admin Panel Setup - JavaFX admin panel guide
- React Setup - Frontend component setup
This project was developed as a school/academic project to demonstrate:
- Practical application of data structures and algorithms
- ACID transaction processing principles
- System design and architecture patterns
- Full-stack development with multiple technologies
- Performance optimization techniques
This is an academic project. Contributions, suggestions, and improvements are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Laravel Framework - https://laravel.com
- React - https://react.dev
- JavaFX - https://openjfx.io
- Xendit - Payment gateway integration
- Tailwind CSS - Utility-first CSS framework
For questions or inquiries about this project, please open an issue in the repository.
Note: This is an academic/school project demonstrating practical implementation of computer science concepts in a real-world application context.