A JavaFX-based application for managing supermarket operations, including product and employee management for admins, and purchase handling with receipt generation for employees.
- Secure login system for both Admin and Employee roles.
- Credential validation fully functional.
- View sales and income statistics.
- Manage products and employees.
- Partial implementation of sales trend analytics (advanced analytics planned).
- Process customer purchases.
- Add items to cart, calculate change, and generate receipts.
- Basic functionality complete; UI enhancements pending.
- Powered by MySQL for reliable data storage.
- Core tables implemented: Admins, Employees, Products, Customers, Receipts.
- Additional database features and tables are planned.
- Built using FXML for structured, responsive layouts.
- Styled with CSS for a modern and clean look.
- Sales Analytics: Advanced reporting (e.g., monthly trends, product performance) is not yet implemented.
- Inventory Management: Full stock tracking and alerts for low inventory are planned.
- Employee Features: Shift management and performance tracking are incomplete.
- Testing: Unit tests are limited; full test coverage is a future goal.
- Java: JDK 17
- Maven: For dependency management
- MySQL: MySQL Server 8.0+
- IDE: IntelliJ IDEA (recommended)
- Images: Ensure the following are in
src/main/resources/com/supermarket/images/
:- logo.png
- escIcon.png
- searchIcon.png
- LogOutIcon.png
- moneyIcon.png
- todaysales-icon.png
- inventory-stutsIcon.png
git clone https://github.com/mido-io/Supermarket-Management-System.git
cd Supermarket-Management-System
-
Install MySQL and start the server
Ensure MySQL Server 8.0+ is installed and running -
Create the database and tables:
mysql -u root -p < sql/schema.sql mysql -u root -p < sql/seed-data.sql
3.Update database credentials in DatabaseConnection.java:
private static final String URL = "jdbc:mysql://localhost:3306/supermarket";
private static final String USER = "root";
private static final String PASSWORD = "";
- Launch IntelliJ IDEA
- Select "Open" and navigate to the
Supermarket-Management-System
directory - Click "Load Maven Project" if prompted
- Go to
File > Project Structure > Project
- Set Project SDK to JDK 17
- Download JavaFX SDK 17
- Go to
File > Project Structure > Libraries
- Click "+" → "Java"
- Select the JavaFX SDK
lib
folder - Click "OK"
- Go to
File > Project Structure > Modules > Dependencies
- Click "+" → "JARs or directories"
- Select
lib/mysql-connector-j-8.3.0.jar
- Click "OK"
- Go to
Run > Edit Configurations
- Add new "Application" configuration with these settings:
- Main class: com.supermarket.Main
- VM options: --module-path /path/to/javafx-sdk-17/lib --add-modules javafx.controls,javafx.fxml
- Working directory:
$PROJECT_DIR$
- Click "Apply" → "OK"
-
Click the Run button (▶) in IntelliJ
-
Login credentials:
Admin:-
- Username:
MideoHubAdmin
- Password:
MideoHub
Employee:-
- Username:
MideoHubEmp
- Password:
MideoHub
Database Connection Error
- Verify MySQL service is running
- Check credentials in DatabaseConnection.java
- Confirm
database/tables
exist via:
SHOW DATABASES;
** JavaFX Runtime Error**
- Validate JavaFX SDK path in VM options
- Ensure
--add-modules
includes
javafx.controls,javafx.fxml
FXML Loading Issues
- Confirm FXML files exist in: src/main/resources/com/supermarket/fxml/
- Verify controller paths in FXML match the Java package structure.
Missing Images
- All images must be in: src/main/resources/com/supermarket/images/
Contributions are welcome!