Skip to content

Latest commit

Β 

History

105 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚀 Sharavati Backwater Boating Ticket Booking System

A JavaFX 17 desktop application for booking boat ride tickets for the Honnavar and Kasarkod tenants, 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 com.boatticket.config

πŸ’° Fee Structure (all preset β€” edit in Ticket.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 = 40

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

mvn clean package
java -jar target/BoatTicketSystem-2.0-SNAPSHOT.jar

πŸš€ Building tenant-specific artifacts

Build each tenant explicitly. The packaged configuration, boat list, branding, local data directory, and update feed are selected by its Maven profile.

Build the distributable package:

mvn clean package -Phonnavar
mvn clean package -Pkasarkod

To build both artifacts in one command on Windows:

.\scripts\build-tenants.ps1

This creates either HonnavarBoatTicketSystem-<version>.jar or KasarkodBoatTicketSystem-<version>.jar. The release workflow creates the corresponding self-contained Windows MSI installer.

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

Windows release installer

The release workflow produces an MSI with a built-in Java runtime. The installer prompts for the installation directory and whether to create a desktop shortcut, and it also adds a Start Menu shortcut. Its icon is derived from src/main/resources/icons8-boat-48.png and stored as src/main/resources/BoatBookingSystem.ico for Windows packaging.

Unsigned MSI files may show an Unknown Publisher or Microsoft Defender SmartScreen warning. This cannot be suppressed safely by the build workflow; it requires a trusted code-signing certificate and publisher reputation.

Build only the fat JAR (without exe):

mvn clean package -DskipTests

Build only the executable (requires JAR to be built first):

mvn launch4j:launch4j

Build only the distribution zip:

mvn assembly:single

Run the application during development:

mvn javafx:run

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages