Skip to content

budaman/BaroApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

BaroApp

A JavaFX desktop application for bar inventory management at TopSportBaras. Staff can record item consumption and update warehouse stock, with all data persisted to a MySQL database.

Features

  • Record consumption of drinks and cigarettes with single-click buttons
  • Add new stock to the warehouse
  • View current inventory levels in real-time
  • Persistent storage via MySQL

Tracked items: Beer (0.5L), Whisky (40ml), Cognac (40ml), Coffee, Cigarettes, Tokens

Prerequisites

  • Java 8+
  • MySQL Server running on localhost:3306

Database Setup

Create the database and table:

CREATE DATABASE mokymai;
USE mokymai;

CREATE TABLE baras1 (
  id   INT PRIMARY KEY,
  name VARCHAR(100),
  kiekis DECIMAL(10, 3)
);

INSERT INTO baras1 (id, name, kiekis) VALUES
  (1, 'Alus',       0),
  (3, 'Konjakas',   0),
  (4, 'Viskis',     0),
  (5, 'Kava',       0),
  (6, 'Cigaretes',  0),
  (7, 'Zetonai',    0);

The default connection uses:

  • URL: jdbc:mysql://localhost:3306/mokymai
  • Username: root
  • Password: (empty)

To change these, edit baras/src/sample/Database.java.

Running the App

From IntelliJ IDEA:

  1. Open the project in IntelliJ IDEA.
  2. Ensure all JARs in baras/lib/ are on the project classpath.
  3. Run Main.java.

From the command line:

# Compile
javac -cp "baras/lib/*" baras/src/sample/*.java -d baras/out/production/baras/

# Run
java -cp "baras/lib/*:baras/out/production/baras/" sample.Main

Project Structure

BaroApp/
├── baras/
│   ├── lib/                        # JAR dependencies
│   │   ├── commons-dbcp2-2.1.1.jar
│   │   ├── commons-pool2-2.4.2.jar
│   │   ├── commons-logging-1.2.jar
│   │   └── mysql-connector-java-5.0.8-bin.jar
│   └── src/sample/
│       ├── Main.java               # Entry point, main window
│       ├── Database.java           # MySQL connection and queries
│       ├── KiekiuSaugykla.java     # In-memory inventory state
│       ├── SandelisScene.java      # Warehouse update window
│       ├── MygtukuIvestisInt.java  # Integer input dialog
│       ├── MygtukuIvestisFloat.java# Float input dialog
│       └── Style.css               # UI styling

Dependencies

Library Version
MySQL Connector/J 5.0.8
Apache Commons DBCP2 2.1.1
Apache Commons Pool2 2.4.2
Apache Commons Logging 1.2

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors