Skip to content

haniluvr/hotel-reservation-system-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 Hotel Reservation Transaction Processing System

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.

PHP Laravel React TypeScript Java JavaFX

πŸ“‹ Table of Contents

🎯 Overview

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

✨ Features

Core Functionality

  • 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)

Transaction Processing

  • 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

Performance Optimizations

  • 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

πŸ“Š Data Structures & Algorithms

Implemented Data Structures

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

Implemented Algorithms

  • 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

πŸ› οΈ Tech Stack

Backend

  • PHP 8.2+ - Server-side programming
  • Laravel 12.0 - Web framework
  • SQLite/MySQL - Database (SQLite default, MySQL supported)

Frontend

  • 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

Admin Panel

  • Java 17+ - Programming language
  • JavaFX 21 - Desktop application framework
  • Maven - Build automation tool
  • JDBC - Database connectivity

Payment & Services

  • Xendit API - Payment gateway integration
  • Laravel Mail - Email notifications

πŸš€ Installation

Prerequisites

  • 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

Web Application Setup

  1. Clone the repository

    git clone <repository-url>
    cd hotel-reservation-system
  2. Install PHP dependencies

    composer install
  3. Configure environment

    cp .env.example .env
    php artisan key:generate
  4. Configure database (Edit .env file)

    DB_CONNECTION=sqlite
    DB_DATABASE=database/database.sqlite
  5. Run migrations

    php artisan migrate
    php artisan db:seed  # Optional: seed sample data
  6. Install frontend dependencies

    npm install
    npm run build
  7. Start development server

    # Terminal 1: Laravel server
    php artisan serve
    
    # Terminal 2: Vite dev server (for hot-reload)
    npm run dev
  8. Access the application

Admin Panel Setup

  1. Navigate to admin panel directory

    cd admin-panel
  2. Configure database connection

    • Edit src/main/resources/config.properties
    • Update database credentials
  3. Build the project

    mvn clean compile
  4. Run the application

    mvn javafx:run
  5. Create admin account (before first login)

    # In Laravel project root
    php artisan tinker
    App\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.

πŸ’» Usage

Web Application

  1. Register/Login - Create an account or login
  2. Search Rooms - Browse available rooms with filters
  3. Create Booking - Select dates and room, complete reservation
  4. Make Payment - Process payment via Xendit gateway
  5. Manage Bookings - View, modify, or cancel reservations

Admin Panel

  1. Login - Use admin credentials
  2. Dashboard - View system statistics and metrics
  3. Manage Rooms - Add, edit, or delete rooms
  4. View Bookings - Monitor all reservations
  5. Process Payments - Track payment transactions
  6. Generate Reports - Export booking and revenue reports

πŸ“ Project Structure

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

πŸ§ͺ Testing

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 --coverage

Test 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

πŸ“š Documentation

πŸŽ“ Academic Context

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

🀝 Contributing

This is an academic project. Contributions, suggestions, and improvements are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“§ Contact

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.

About

School project of a Hotel Reservation System with Queue, HashTable, AVL Tree, Stack, Graph. ACID-compliant TPS with the use of Laravel and React for user side and JavaFX and Maven for admin side.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors