https://github.com/codenitros/boatbookingsystem
https://github.com/codenitros/boatbookingsystem
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/codenitros/boatbookingsystem
- Owner: codenitros
- License: gpl-3.0
- Created: 2026-04-13T14:32:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-13T17:54:48.000Z (25 days ago)
- Last Synced: 2026-05-13T19:32:15.728Z (25 days ago)
- Language: Java
- Size: 96.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ค Sharavati Backwater Boating Honnavar Ticket Booking System
A JavaFX 17 desktop application for booking boat ride tickets at Sharavati Backwater Boating Honnavar, with thermal printing, database storage, and Excel export.
---
## โจ Features
| Feature | Details |
|---|---|
| User Authentication | Login with username/password and role-based access |
| Customer Details | Name + 10-digit Contact Number |
| Passenger Count | Spinner (1โ50 people) |
| Ride Duration | Radio buttons: 1 Hour (โน1500) or 2 Hours (โน2500) |
| Life Jackets | Mandatory, โน10 per person |
| Parking | Optional checkbox with vehicle types |
| Vehicle Types | Car โน20 ยท Bus โน50 ยท Tempo Traveller โน35 |
| Boat Assignment | Search and select from registered boats/drivers |
| Live Fee Calc | Total, Driver Amount, Counter Amount update instantly |
| Thermal Printing | Direct print to thermal printer + console preview |
| Database Storage | SQLite for ticket and boat data |
| Excel Export | Backup tickets to Excel file |
| View Tickets | List today's issued tickets |
| Fee Split | Driver: Boat + Jackets; Counter: Parking |
---
## ๐ ๏ธ Prerequisites
- **Java 17** (JDK 17+)
- **Maven 3.8+**
- **IntelliJ IDEA** (Community or Ultimate)
---
## ๐ Quick Start in IntelliJ
### 1. Open the Project
```
File โ Open โ select the BoatTicketSystem folder
```
IntelliJ will auto-detect the `pom.xml` and import dependencies.
### 2. Wait for Maven to download dependencies
The first run downloads JavaFX 17, SQLite JDBC, Apache POI, and other libraries (~10-15 MB total).
### 3. Run the app
- **Option A (Maven):** Right-click `pom.xml` โ Run Maven โ `javafx:run`
- **Option B (Main class):** Open `MainApp.java` โ click the green โถ Run button
- **Option C (Run Config):** The `.idea/runConfigurations/BoatTicketSystem.xml` is pre-configured
The app starts with a login screen. Default credentials are admin/admin (or check DatabaseManager for setup).
### If you see module errors, add VM options:
```
--add-opens javafx.graphics/com.sun.javafx.application=ALL-UNNAMED
```
Go to: **Run โ Edit Configurations โ VM Options**
---
## ๐ Project Structure
```
BoatTicketSystem/
โโโ pom.xml โ Maven dependencies
โโโ build-exe.bat โ Build script for creating executable
โโโ src/
โ โโโ assembly/
โ โ โโโ distribution.xml โ Assembly descriptor for packaging
โ โโโ main/
โ โโโ java/
โ โ โโโ module-info.java โ Java module descriptor
โ โ โโโ com/boatticket/
โ โ โโโ MainApp.java โ Entry point
โ โ โโโ controller/
โ โ โ โโโ BookingController.java โ Booking UI logic
โ โ โโโ db/
โ โ โ โโโ DatabaseManager.java โ SQLite database operations
โ โ โโโ model/
โ โ โ โโโ Ticket.java โ Ticket data model + fee constants
โ โ โ โโโ BoatOwner.java โ Boat owner data model
โ โ โโโ util/
โ โ โโโ ThermalPrinterManager.java โ Thermal printing utilities
โ โโโ resources/com/boatticket/
โ โโโ login.fxml โ Login UI layout
โ โโโ booking.fxml โ Booking UI layout
โ โโโ styles.css โ Styling
โโโ .idea/runConfigurations/ โ Pre-built IntelliJ run config
```
---
## ๐ฐ Fee Structure (all preset โ edit in `Ticket.java`)
```java
BOAT_RIDE_FEE_PER_HOUR = 1500 // per hour
BOAT_RIDE_FEE_2HOURS = 2500 // special rate for 2 hours
LIFE_JACKET_FEE = 10 // per jacket (mandatory)
PARKING_FEE_CAR = 20
PARKING_FEE_BUS = 50
PARKING_FEE_TEMPOTRAVELLER = 35
```
To change any fee, open `src/main/java/com/boatticket/model/Ticket.java` and edit the constants at the top.
---
## ๐จ๏ธ Generating a Ticket (Thermal Print)
1. Fill in the booking form (login required)
2. Select boat/driver, duration, parking if needed
3. Click **"Generate Ticket"**
4. The ticket is automatically printed to the default thermal printer
5. A preview is also shown in the console
The thermal ticket includes:
- Unique Ticket ID + booking timestamp
- Customer & ride details
- Boat/driver assignment
- Itemised fee breakdown (Boat, Jackets, Parking)
- Driver Amount + Counter Amount
- Total amount
---
## ๐ง Troubleshooting
**"JavaFX runtime components are missing"**
โ Make sure you're running via Maven (`mvn javafx:run`) or add `--module-path` to VM options.
**Dependencies not downloading**
โ Check internet connection, then: Right-click `pom.xml` โ Maven โ Reload Project.
**Build fails on module-info.java**
โ Ensure your IntelliJ is set to Java 17: File โ Project Structure โ SDK = 17.
---
## ๐ฆ Building a runnable JAR
```bash
mvn clean package
java -jar target/BoatTicketSystem-2.0-SNAPSHOT.jar
```
---
## ๐ Creating a Self-Contained Executable (Windows .exe)
This project is configured to create a self-contained executable that bundles all dependencies into a single JAR file and wraps it in a Windows executable.
### Build the distributable package:
**Option 1: Using the build script (recommended):**
```bash
# Double-click build-exe.bat or run:
build-exe.bat
```
**Option 2: Using Maven directly:**
```bash
mvn clean package
```
This will create:
- `target/BoatTicketSystem-2.0-SNAPSHOT.jar` - Fat JAR with all dependencies
- `target/BoatTicketSystem.exe` - Windows executable
- `target/BoatTicketSystem-2.0-SNAPSHOT-distribution.zip` - Complete distribution package
### What's included in the distribution:
- **Fat JAR** (created with Maven Shade) - Contains all dependencies (~25-35MB)
- **Windows executable** (`.exe`) launcher created with Launch4j
- **Batch file** launcher (`.bat`) as alternative
- **README** and documentation
### Running the application:
1. Extract the `BoatTicketSystem-2.0-SNAPSHOT-distribution.zip` file
2. Double-click `BoatTicketSystem.exe` or run `BoatTicketSystem.bat`
3. The application will start (requires Java 17+ on target machine)
### System Requirements for the executable:
- **Windows 7 SP1 or later** (64-bit recommended)
- **Java 17+** must be installed on the target machine
- **~30-40MB** free disk space for the extracted distribution
### How it works:
1. **Maven Shade Plugin** creates a fat JAR containing all dependencies
2. **Launch4j** wraps the JAR into a Windows executable with proper JRE detection
3. **Maven Assembly** packages everything into a distributable zip file
---
## ๐ง Advanced Build Options
### Build only the fat JAR (without exe):
```bash
mvn clean package -DskipTests
```
### Build only the executable (requires JAR to be built first):
```bash
mvn launch4j:launch4j
```
### Build only the distribution zip:
```bash
mvn assembly:single
```
### Run the application during development:
```bash
mvn javafx:run
```