Desktop raffle ticket management system built with JavaFX. Designed for local raffle campaigns with an operator-friendly workflow for managing items, selling tickets, tracking players, and running a live draw.
Sell & Win Raffle is a local-first desktop application for organizing and running raffle campaigns end-to-end:
- Manage raffle items (prizes)
- Sell tickets and assign ticket IDs automatically
- Track players and ticket inventory
- Run a live draw and announce winners
Data is stored locally using CSV files and item-specific image folders under the userโs home directory, keeping setup simple and backups straightforward.
- ๐ท๏ธ Create raffle items with title, description, ticket count, and ticket price
- ๐ผ๏ธ Store and browse item images (with a configurable default image)
- ๐ค Sell tickets to players and auto-assign ticket IDs
- โป๏ธ Reuse ticket IDs when player records are removed
- ๐ฆ Track remaining ticket inventory per item
- ๐ Search player status by name, phone number, or ticket ID
- ๐ฒ Run a live draw and show the winner (or indicate when a selected ticket was not sold)
- ๐งฐ Package as a JAR and a Windows .exe (Launch4j)
| Area | Details |
|---|---|
| ๐ป Language | Java 21 |
| ๐งฉ UI | JavaFX 21, FXML, CSS |
| ๐๏ธ Build | Maven |
| โ Testing | JUnit 5 |
| ๐พ Storage | Local CSV files |
| ๐ฆ Packaging | JavaFX Maven Plugin, Launch4j artifacts in out/artifacts/ |
Create a new item with:
- Title
- Description
- Number of tickets
- Ticket price
When an item is created, the app prepares:
- A folder for the itemโs images
- A ticket record CSV for that item
- An entry in the main
data.csvcatalog
Each item gets its own image folder under the application data directory. Operators can set a default image for the main dashboard and browse all images for an item in the item viewer.
For a selected item, the operator can add players by entering:
- Player name
- Phone number
- Number of tickets to purchase
The app randomly assigns available ticket IDs and writes the updated player state back to the itemโs record file.
The player status screen supports searching by:
- Ticket ID
- Phone number
- Player name
The draw screen animates ticket number generation and stops on the selected ticket:
- If the ticket belongs to a player, the winner is displayed.
- If the ticket has not been sold, the UI clearly indicates that outcome.
At runtime, the application writes data to the userโs home directory:
~/Sell & Win Raffle/
data/
data.csv
records/
<item-title>.csv
<item-title>/
image files...
Stores the master item catalog with:
- Image path
- Title
- Description
- Available tickets
- Ticket price
Stores the ticket ledger for a single raffle item with:
- Ticket ID
- Player name
- Phone number
- Number of tickets associated with that buyer
src/
main/
java/
raffle/
controllers/
main/
models/
utils/
resources/
fxml_files/
icons/
stylesheets/
test/
raffle/
controllers/
main/
models/
utils/
raffle.main.Appโ loads the JavaFX application, shows the loading screen, and navigates between viewsraffle.main.EntryPointโ thin entry point class used to launch the app
The UI is split into focused JavaFX controllers:
MainViewControllerAddItemControllerAddPlayerControllerDrawControllerViewItemControllerPlayerStatusControllerLoadingController
ItemPlayer
ItemDataReaderAndWriterPlayerDataReaderAndWriter
These utility classes handle CSV parsing and serialization.
Operator-facing safeguards include:
- Empty-field validation on item and player forms
- Positive-number validation for ticket counts and ticket price
- Basic phone number validation
- File accessibility checks before writing CSV files
- Confirmation dialogs before deleting items or player records
- Java 21
- Maven 3.9+
- Windows is the primary packaged target for the included
.exeartifact
mvn clean javafx:runmvn testmvn clean packageThe repository contains automated tests for:
- Controllers
- Models
- CSV reader/writer utilities
- Main application entry points
Current repository test coverage signals include:
- 12 test classes
- 47 JUnit tests
The repository includes generated application artifacts in:
out/artifacts/Sell_and_Win_Raffle_jar/
That folder contains:
Sell_and_Win_Raffle.jarSell & Win Raffle.exe
The JavaFX UI currently includes these views:
- Loading view
- Main view
- Add item view
- Add player view
- Draw view
- View item view
- Player status view
- CSV-based persistence (not database-backed)
- Designed for local use (not multi-user)
- Images managed through the local file system
- Draw can stop on a ticket that has not been sold (and the UI reports that explicitly)
- Replace CSV storage with a relational database for stronger concurrency support
- Add sales reports and export features
- Add installer-based distribution for non-technical operators
- Track draw history and operational audit logs
- Improve image management and default image workflows