A desktop application for managing sales and inventory, built with JavaFX and MySQL. This system helps businesses track products, process customer orders, generate receipts, and monitor sales performance through an intuitive graphical interface.
- View total orders, today's income, and available products at a glance
- Interactive Area Chart and Bar Chart for visualizing income and order trends
- Add, Update, Delete products with full CRUD operations
- Supports multiple product categories (Cars, Engine Oil, Tires, Batteries, Brakes, and 20+ more)
- Product status tracking: Available, Out of Stock, Broken, Damage
- Import product images via file picker
- Real-time search and filtering across all product fields
- Add products to cart with cascading selection (Type → Brand → Product Name)
- Quantity spinner with configurable min/max values
- Automatic total calculation and balance/change display
- Generate and view receipts for completed transactions
- Create printable receipts for customer transactions
- Tracks customer ID, total, amount paid, and balance
- Java 23 or higher
- Maven 3.8+
- MySQL Server 8.0+
- A MySQL database named
Inventory
Create a MySQL database named Inventory with the following tables:
CREATE DATABASE IF NOT EXISTS Inventory;
USE Inventory;
CREATE TABLE product (
product_id INT PRIMARY KEY,
Type VARCHAR(100),
brand VARCHAR(100),
productName VARCHAR(100),
price DOUBLE,
status VARCHAR(50),
image VARCHAR(500),
date DATE
);
CREATE TABLE customer (
customer_id INT,
type VARCHAR(100),
brand VARCHAR(100),
productName VARCHAR(100),
quantity INT,
price DOUBLE,
date DATE
);
CREATE TABLE customer_receipts (
customer_id INT,
total DOUBLE,
amount DOUBLE,
balance DOUBLE,
date DATE
);-
Clone the repository:
git clone https://github.com/your-username/Sales-Inventroy.git cd Sales-Inventroy -
Configure database credentials: Edit
src/main/java/com/example/salesinventroy/database.javaand update the connection string if your MySQL credentials differ:Connection connection = DriverManager.getConnection( "jdbc:mysql://localhost:3306/Inventory", "root", ""); // Update username and password as needed
-
Build and run:
mvn clean install mvn javafx:run
Sales-Inventroy/
├── src/main/java/com/example/salesinventroy/
│ ├── HelloApplication.java # Application entry point
│ ├── HelloController.java # Login view controller
│ ├── DashboardController.java # Main dashboard controller (Products, Orders, Home)
│ ├── ReceiptController.java # Receipt view controller
│ ├── ProductData.java # Data model for products
│ ├── customerData.java # Data model for customer orders
│ ├── database.java # MySQL database connection utility
│ ├── getData.java # Shared data/utility class
│ └── initializable.java # Custom initialization interface
├── src/main/resources/com/example/salesinventroy/
│ ├── hello-view.fxml # Login screen layout
│ ├── dashboard.fxml # Main dashboard layout
│ └── receipt_view.fxml # Receipt view layout
└── pom.xml # Maven project configuration
| Technology | Version | Purpose |
|---|---|---|
| Java | 23 | Core language |
| JavaFX | 23 | GUI framework |
| FXML | - | UI layout |
| MySQL | 8.0.33 | Database |
| MySQL Connector/J | 8.0.33 | JDBC driver |
| FontAwesomeFX | 4.7.0-9.1.2 | UI icons |
| Maven | - | Build tool |
This project is for educational purposes.