Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotel Reservation System

A desktop Hotel Reservation System built in Java (Swing) with an SQLite database. Guests can browse rooms, make and manage reservations, and generate a printable booking receipt; administrators can manage rooms and reservations and review a full transaction audit log.

About the Project

This is an Object-Oriented Programming project that demonstrates core OOP principles together with database connectivity through JDBC.

Features

Guest (USER)

  • Sign up / sign in
  • Browse and filter rooms by type
  • Make a reservation with a date-picker calendar (conflict / double-booking checks)
  • View, reschedule, and cancel reservations
  • Generate a booking receipt (view in-app and save to a .txt file)
  • Update username and password

Administrator (ADMIN)

  • Add, edit, and delete rooms
  • View all reservations and change their status
  • View the full transaction log (audit trail of every booking action)

OOP Concepts Demonstrated

Concept Where
Abstraction models.Room is an abstract class with an abstract getPerks() method also interfaces that used CRUD Operations
Inheritance SingleRoom, DoubleRoom, DeluxeRoom, SuiteRoom extend Room; frames extend JFrame
Polymorphism Room.fromType(...) factory returns the correct subclass; getPerks() resolves at runtime
Encapsulation Private fields with getters/setters (e.g. classes.UserSession, models.Room)
Constructors / Methods Throughout all classes
Exception handling try/catch around all JDBC and file I/O operations
Database connectivity db.DatabaseManager + DAO classes using JDBC / SQLite

Project Structure

src/
  Main.java                 Application entry point
  classes/UserSession.java  Logged-in user session
  config/DesignConfig.java  UI colors, fonts, sizing
  db/DatabaseManager.java   Schema setup, seeding, connections
  dao/                      Data access + managers (Auth, Room, Reservation, User, logging)
  models/                   Abstract Room hierarchy (Single/Double/Deluxe/Suite)
  util/ReceiptGenerator.java Booking receipt formatter
  frames/                   Swing UI (Login, User dashboard, Admin dashboard)
lib/                        sqlite-jdbc driver (.jar)
database/hotel.db           SQLite database file

src/Table.java is a local-only developer utility for resetting the database and is intentionally git-ignored.

Getting Started (Local Setup)

Prerequisites

  • JDK 17 or newer (the code uses text blocks and switch expressions). Check with:
    java -version
    javac -version
  • The bundled SQLite JDBC driver in lib/ (already included: sqlite-jdbc-3.53.1.0.jar). No internet or extra install required.

1. Clone the repository

git clone https://github.com/Badoobi/HotelReservationSystem.git
cd HotelReservationSystem

2. Compile

From the project root (Windows PowerShell):

$files = Get-ChildItem -Recurse -Filter *.java -Path src | ForEach-Object { '"' + $_.FullName + '"' }
cmd /c ("javac -cp `"lib\*`" -d out " + ($files -join ' '))

This compiles all sources into the out/ directory.

3. Run

java -cp "out;lib\*" Main

On macOS/Linux, use a colon instead of a semicolon on the classpath: java -cp "out:lib/*" Main

On first launch the app creates the database schema (if needed) and seeds the default rooms automatically, then opens the login window.

4. Logging in

  • Create a guest account from the login screen (Create Account).
  • To create an admin account, register with the password ADMIN (development convenience — the account is granted the ADMIN role).

Notes

  • Passwords are stored in plain text. This build is intended for a classroom demo only and is not hardened for production use.
  • Generated receipts are written to a receipts/ folder (git-ignored).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages