A desktop inventory management system built with JavaFX for small to medium-sized businesses. SmartStock provides comprehensive stock tracking, supplier management, and low-stock alerts to streamline your inventory operations.
- Features
- Technology Stack
- Prerequisites
- Installation
- Configuration
- Running the Application
- Project Structure
- Database Schema
- License
- Add, edit, and delete products with detailed information
- Track SKU, pricing, and stock levels for each product
- Assign products to categories and suppliers
- Real-time product search functionality
- Record stock-in and stock-out transactions
- Maintain complete transaction history with references and notes
- Visual indicators for stock levels in product tables
- Automatic detection of products below minimum stock threshold
- Desktop notifications when low stock is detected
- Dedicated low stock view for quick action
- Organize products into customizable categories
- Add descriptions to categories for better organization
- Maintain supplier contact information
- Track supplier email, phone, and address details
- Link products to their respective suppliers
| Component | Technology |
|---|---|
| Language | Java 21 |
| UI Framework | JavaFX 21 |
| Build Tool | Gradle (Kotlin DSL) |
| Database | MariaDB |
| UI Controls | ControlsFX |
Before running SmartStock, ensure you have the following installed:
- Java Development Kit (JDK) 21 or higher
- MariaDB Server (version 10.5 or higher recommended)
- Gradle (or use the included wrapper)
-
Clone the repository
git clone https://github.com/DevKorrir/SmartStock-JavaFx.git cd SmartStock-JavaFx -
Create the database
CREATE DATABASE smartstock_db;
-
Configure database connection (see Configuration)
-
Build the project
./gradlew build
-
Copy the example configuration file:
cp src/main/resources/db.properties.example src/main/resources/db.properties
-
Edit
db.propertieswith your database credentials:db.driver=org.mariadb.jdbc.Driver db.url=jdbc:mariadb://localhost:3306/smartstock_db db.username=your_username db.password=your_password
Note: The
db.propertiesfile contains sensitive credentials and is excluded from version control via.gitignore.
./gradlew run./gradlew jlinkThis creates a distributable package in build/distributions/.
smartstock/
├── src/main/java/com/example/smartstock/
│ ├── MainApp.java # Application entry point
│ ├── Launcher.java # Launcher for module compatibility
│ ├── controllers/ # UI controllers
│ │ ├── MainController.java
│ │ ├── CategoryController.java
│ │ ├── SupplierController.java
│ │ ├── TransactionController.java
│ │ ├── LowStockController.java
│ │ ├── ProductFormDialog.java
│ │ └── StockTransactionDialog.java
│ ├── dao/ # Data Access Objects
│ │ ├── ProductDAO.java
│ │ ├── CategoryDAO.java
│ │ ├── SupplierDAO.java
│ │ └── StockTransactionDAO.java
│ ├── db/ # Database connection
│ │ └── DatabaseConnection.java
│ ├── models/ # Data models
│ │ ├── Product.java
│ │ ├── Category.java
│ │ ├── Supplier.java
│ │ └── StockTransaction.java
│ └── util/ # Utility classes
│ └── AlertUtil.java
├── src/main/resources/
│ ├── styles/
│ │ └── main.css # Application styling
│ └── db.properties.example # Database config template
├── build.gradle.kts # Build configuration
└── README.md
The application uses the following core tables:
| Column | Type | Description |
|---|---|---|
| category_id | INT | Primary key |
| name | VARCHAR | Category name |
| description | TEXT | Category description |
| Column | Type | Description |
|---|---|---|
| supplier_id | INT | Primary key |
| name | VARCHAR | Supplier name |
| contact_person | VARCHAR | Contact person name |
| VARCHAR | Email address | |
| phone | VARCHAR | Phone number |
| address | TEXT | Physical address |
| Column | Type | Description |
|---|---|---|
| product_id | INT | Primary key |
| name | VARCHAR | Product name |
| sku | VARCHAR | Stock keeping unit |
| category_id | INT | Foreign key to categories |
| supplier_id | INT | Foreign key to suppliers |
| unit_price | DECIMAL | Price per unit |
| current_stock | INT | Current stock quantity |
| minimum_stock | INT | Low stock threshold |
| Column | Type | Description |
|---|---|---|
| transaction_id | INT | Primary key |
| product_id | INT | Foreign key to products |
| transaction_type | ENUM | IN or OUT |
| quantity | INT | Transaction quantity |
| transaction_date | DATETIME | Transaction timestamp |
| reference | VARCHAR | Reference number |
| notes | TEXT | Additional notes |
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
For issues and feature requests, please open an issue on the GitHub repository.