Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

nihahawas/CodeAlpha_Hotel_Reservation_System

Repository files navigation

🏨 Hotel β€” Reservation Management System

image

CodeAlpha Java Internship β€” Task 4


πŸ“‹ Project Overview

A fully-featured Hotel Reservation System built with Java, MySQL, JDBC, and the DAO design pattern. Supports complete hotel operations including room management, customer registration, booking, check-in/check-out, payment simulation, and analytics reporting.


✨ Features

Feature Description
πŸ›οΈ Room Management View all/available rooms, search by category (Standard/Deluxe/Suite)
πŸ‘€ Customer Management Register guests, search by email/ID, view history
πŸ“‹ Reservation Management Book, cancel, check-in, check-out
πŸ’³ Payment Simulation Cash, Credit Card, Debit Card, Online β€” with transaction IDs
πŸ“Š Reports & Analytics Revenue, occupancy stats, reservation summaries
🎨 Colored Console UI Beautiful ANSI-colored terminal interface

πŸ—οΈ Project Architecture

CodeAlpha_HotelReservation/
β”œβ”€β”€ src/main/java/com/codealpha/hotel/
β”‚ β”œβ”€β”€ Main.java ← Entry point
β”‚ β”œβ”€β”€ config/
β”‚ β”‚ └── DatabaseConfig.java ← Singleton DB connection
β”‚ β”œβ”€β”€ model/
β”‚ β”‚ β”œβ”€β”€ Room.java ← Room entity (with RoomCategory enum)
β”‚ β”‚ β”œβ”€β”€ Customer.java ← Customer entity
β”‚ β”‚ β”œβ”€β”€ Reservation.java ← Reservation entity (with status enum)
β”‚ β”‚ └── Payment.java ← Payment entity (with method/status enums)
β”‚ β”œβ”€β”€ dao/
β”‚ β”‚ β”œβ”€β”€ RoomDAO.java ← Room DAO interface
β”‚ β”‚ β”œβ”€β”€ CustomerDAO.java ← Customer DAO interface
β”‚ β”‚ β”œβ”€β”€ ReservationDAO.java ← Reservation DAO interface
β”‚ β”‚ β”œβ”€β”€ PaymentDAO.java ← Payment DAO interface
β”‚ β”‚ └── impl/
β”‚ β”‚ β”œβ”€β”€ RoomDAOImpl.java ← JDBC implementation
β”‚ β”‚ β”œβ”€β”€ CustomerDAOImpl.java ← JDBC implementation
β”‚ β”‚ β”œβ”€β”€ ReservationDAOImpl.java ← JDBC implementation
β”‚ β”‚ └── PaymentDAOImpl.java ← JDBC implementation
β”‚ β”œβ”€β”€ service/
β”‚ β”‚ └── HotelService.java ← Business logic layer
β”‚ └── ui/
β”‚ └── ConsoleUI.java ← Full ANSI console interface
β”œβ”€β”€ src/main/resources/
β”‚ └── database.properties ← DB credentials
β”œβ”€β”€ sql/
β”‚ └── hotel_db.sql ← Database schema + sample data
β”œβ”€β”€ pom.xml ← Maven config (MySQL connector)
└── README.md

πŸ› οΈ Technologies Used

  • Java 11+ β€” Core language
  • MySQL 8.x β€” Database
  • JDBC β€” java.sql for database connectivity
  • DAO Pattern β€” Interface + Implementation separation
  • Maven β€” Dependency management (auto-downloads MySQL connector)
  • OOP β€” Encapsulation, abstraction, singleton pattern
  • ANSI Colors β€” Beautiful console UI

πŸš€ How to Run

Prerequisites

  • JDK 11 or higher
  • MySQL 8.x installed and running
  • Maven installed (or use VS Code Java Extension Pack)

Step 1 β€” Set up Database

-- In MySQL Workbench or terminal:
mysql -u root -p < sql/hotel_db.sql

Step 2 β€” Configure Database

Edit src/main/resources/database.properties:

db.url=jdbc:mysql://localhost:3306/hotel_db?useSSL=false&serverTimezone=UTC
db.username=root
db.password=YOUR_PASSWORD_HERE

Step 3 β€” Run with Maven

mvn compile exec:java -Dexec.mainClass="com.codealpha.hotel.Main"

OR Run with VS Code

  • Open project in VS Code
  • Install Extension Pack for Java
  • Open Main.java β†’ Click β–Ά Run

πŸ“± System Menu Structure

MAIN MENU
β”œβ”€β”€ [1] Room Management
β”‚ β”œβ”€β”€ View All Rooms
β”‚ β”œβ”€β”€ View Available Rooms
β”‚ β”œβ”€β”€ Search by Category
β”‚ └── View Room Details
β”œβ”€β”€ [2] Customer Management
β”‚ β”œβ”€β”€ Register Customer
β”‚ β”œβ”€β”€ View All Customers
β”‚ β”œβ”€β”€ Search by Email
β”‚ └── View by ID
β”œβ”€β”€ [3] Reservation Management
β”‚ β”œβ”€β”€ Book a Room ← validates availability
β”‚ β”œβ”€β”€ Cancel Reservation ← auto-refund
β”‚ β”œβ”€β”€ Check-In Guest
β”‚ β”œβ”€β”€ Check-Out Guest
β”‚ β”œβ”€β”€ View All Reservations
β”‚ β”œβ”€β”€ View Details
β”‚ └── View by Customer
β”œβ”€β”€ [4] Payment Management
β”‚ β”œβ”€β”€ Process Payment (Cash/Card/Online)
β”‚ └── View All Payments
└── [5] Reports & Analytics
 └── Revenue, occupancy, reservation stats

πŸ—„οΈ Database Schema

4 tables: rooms, customers, reservations, payments β€” with foreign key relationships and 11 pre-loaded sample rooms (Standard/Deluxe/Suite).


πŸ‘€ Author


πŸ“œ License

Educational project for CodeAlpha Java Internship Program.

About

A clean Java backend application for a Hotel Reservation System. Features include searching rooms by category (Standard, Deluxe, Suite), managing bookings, simulating a secure payment checkout, and handling cancellations. Built using core Object-Oriented Programming (OOP) principles for the CodeAlpha Java Programming Internship.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /