A comprehensive JavaFX-based hotel management application designed to streamline hotel operations including room management, customer bookings, billing, and reporting.
- Secure login screen for staff access
- User authentication before accessing the main application
- Real-time overview of hotel operations
- Quick statistics and key metrics
- Visual summary of current bookings and occupancy
- View all available, occupied, and maintenance rooms
- Room types: Single, Double, Deluxe, Suite
- Set room prices per day
- Mark rooms as available, occupied, or under maintenance
- Track room amenities (AC, WiFi)
- Assign rooms to floors
- Register and manage customer information
- Store customer contact details
- Track customer booking history
- Maintain customer database
- Create new bookings for customers
- Assign rooms to bookings
- Set check-in and check-out dates
- View all active and historical bookings
- Manage booking status
- Generate bills for completed bookings
- Calculate charges based on room type and duration
- Track payment status
- View billing history
- Generate PDF bill reports
- Process customer checkouts
- Calculate final charges
- Generate checkout receipts
- Process payments
- Generate comprehensive hotel reports
- Export data to PDF format
- View historical data and analytics
- Track revenue and occupancy metrics
hotelmanagement/
├── pom.xml # Maven configuration
├── src/
│ └── main/
│ ├── java/
│ │ └── com/hotel/
│ │ ├── App.java # Application entry point
│ │ ├── model/ # Data models
│ │ │ ├── Bill.java # Bill entity
│ │ │ ├── Booking.java # Booking entity
│ │ │ ├── Customer.java # Customer entity
│ │ │ └── Room.java # Room entity
│ │ ├── service/
│ │ │ └── HotelService.java # Core business logic (thread-safe singleton)
│ │ ├── storage/
│ │ │ └── JsonStorageManager.java # JSON data persistence
│ │ ├── billing/
│ │ │ └── BillingManager.java # Billing calculations and PDF generation
│ │ └── ui/
│ │ ├── LoginController.java # Login screen controller
│ │ ├── MainWindow.java # Main application window
│ │ ├── tabs/ # UI tabs/screens
│ │ │ ├── DashboardTab.java # Dashboard view
│ │ │ ├── RoomTab.java # Room management view
│ │ │ ├── CustomerTab.java # Customer management view
│ │ │ ├── BookingTab.java # Booking management view
│ │ │ ├── BillingTab.java # Billing view
│ │ │ ├── CheckoutTab.java # Checkout processing view
│ │ │ └── ReportTab.java # Reports and analytics view
│ │ └── util/
│ │ └── StyleUtil.java # UI styling utilities
│ └── resources/
│ ├── fxml/
│ │ └── login.fxml # Login screen layout (FXML)
│ └── styles/
│ └── hotel.css # Application stylesheets
└── data/ # JSON data files
├── rooms.json # Room data persistence
├── customers.json # Customer data persistence
├── bookings.json # Booking data persistence
└── bills.json # Bill data persistence
- Language: Java 23
- UI Framework: JavaFX 21
- Build Tool: Maven
- Data Format: JSON (Jackson)
- Report Generation: iText PDF Library
- Concurrency: Java ReentrantReadWriteLock for thread-safe operations
- Data Binding: JavaFX ObservableList for reactive UI updates
Before setting up the project, ensure you have:
- Java Development Kit (JDK) 23 or higher
- Maven 3.6.0 or higher
- Git (optional, for version control)
# Check Java version
java -version
# Check Maven version
mvn -version# If using git
git clone <repository-url>
cd hotelmanagement
# Or extract the zip file and navigate to the directory
cd hotelmanagementThe application requires a data directory to store JSON files:
# The data directory should already exist, but if not:
mkdir data# Navigate to project root
cd hotelmanagement
# Build using Maven
mvn clean compileMaven will automatically download all required dependencies (JavaFX, Jackson, iText, etc.) during the first build.
# Run directly from Maven
mvn javafx:run- Open the project in your IDE
- Right-click on
App.java→ Run - Or use the IDE's run button
mvn package
java -jar target/HotelManagement-1.0-SNAPSHOT.jarThe application requires authentication. Use the following default credentials:
- Username:
admin - Password:
password
(Note: Customize credentials in the LoginController.java as needed)
All data is persisted in JSON format in the data/ directory:
rooms.json- Room inventory and statuscustomers.json- Customer informationbookings.json- Booking recordsbills.json- Billing records
The application features automatic data saving with a background thread, ensuring no data loss.
The HotelService is implemented as a thread-safe singleton using:
- Double-checked locking pattern
ReentrantReadWriteLockfor concurrent read/exclusive write access- Auto-save thread for periodic data persistence
All data collections use JavaFX's ObservableList for:
- Real-time UI updates
- Automatic synchronization between model and view
- Change notifications
UI Tab Controllers
↓
HotelService (Thread-safe)
↓
JsonStorageManager
↓
data/ (JSON files)
- SINGLE
- DOUBLE
- DELUXE
- SUITE
- AVAILABLE
- OCCUPIED
- MAINTENANCE
- Air Conditioning (AC)
- WiFi
- Automatic calculation based on room type and booking duration
- PDF report generation using iText
- Multiple payment status tracking
- Revenue reporting and historical data
| Class | Purpose |
|---|---|
App.java |
Application entry point, initializes login screen |
HotelService.java |
Core business logic, thread-safe singleton |
JsonStorageManager.java |
Data persistence layer |
BillingManager.java |
Billing calculations and PDF generation |
Room.java |
Room entity with JavaFX properties |
Booking.java |
Booking entity and logic |
Customer.java |
Customer information |
Bill.java |
Bill record and payment tracking |
# Compile with debug info
mvn clean compile -X
# Skip tests (if applicable)
mvn clean compile -DskipTests
# Rebuild everything
mvn clean installIssue: JavaFX module not found
Solution: Ensure Java version is 23+ and dependencies are downloaded
mvn clean installIssue: Data not persisting
Solution: Verify the data/ directory exists and has write permissions
ls -la data/Issue: Application won't start
Solution: Check if port is already in use or try:
mvn clean javafx:runEdit the following files as needed:
App.java- Window title, size, and startup configurationhotel.css- Color scheme and styling- Model classes - Add new fields or properties
To extend this project:
- Add new features to appropriate tab controllers
- Create model classes in the
model/package - Add service methods in
HotelService.java - Update JSON storage if new data structures are added
- Create corresponding FXML files in
resources/fxml/
This project is provided as-is for educational and commercial use.
LuxeStay - Hotel Management System
Last Updated: April 2026 Version: 1.0-SNAPSHOT