This project was developed to fulfill the requirements of the Object Oriented Programming course module (IIC 1153) at the University of Sri Jayewardenepura, Faculty of Technology
Assignment Requirements β’ Features β’ Quick Start β’ Project Structure β’ User Interface
SaleSync β βsales syncβ
Phonetic: /seΙͺlz sΙͺΕk/
SaleSync is a Java application designed as a simple store manager system. It serves as a practical demonstration of Object-Oriented Programming (OOP) principles and related Java features as required by the IIC 1153 - Object Oriented Programming
The system addresses a practical business or operational problem faced by a local startup company by providing solutions for:
- Employee Management
- Product Inventory Management
- Billing System
- ποΈ OOP Principles: Application of Encapsulation, Abstraction, Inheritance, and Polymorphism
- π Java Concepts: Use of Interfaces & Packages, Collections & Generics, File Handling, and Exception Handling
- ποΈ Data Persistence: Integration with MongoDB for data storage (implied file handling for data).
- π₯οΈ User Interface: Implementation of a JavaFx GUI.
- π₯ Version Control: Effective use of Git/GitHub for collaborative development
This project addresses the core requirements of the IIC 1153 Group Assignment[cite: 7, 8]:
- Problem Identification: Identify a current operational or management issue faced by a local startup company and propose a software solution
- OOP Implementation: Design and implement the solution in Java, applying sound OOP design principles
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- Exception Handling
- Collections & Generics
- File Handling
- Interfaces & Packages
- Teamwork & VCS: Demonstrate effective teamwork and use of a Version Control System (Git/GitHub)
- Commit and push regularly
- Use descriptive commit messages
- Demonstrate branch usage and merging.
The SaleSync application supports the following key functionalities:
- β Role-Based Access: Distinguishes between Admin, Cashier, and Product Manager roles.
- β Employee Management: CRUD (Create, Read, Update, Delete) operations for employee records.
- β Product Inventory: Full CRUD operations to manage product stock and details.
- β Data Persistence: Uses a NoSQL database (MongoDB) to store all application data.
- β GUI Interface: Provides a user-friendly graphical interface using JavaFX.
- β Robustness: Utilizes exception handling techniques to build a robust, error-tolerant application[cite: 15].
Before running the application, ensure you have the following installed:
| Requirement | Notes |
|---|---|
| β Java JDK | Version 17 or higher. |
| π¦ Maven | Version 3.6+ for building and dependency management. |
| π€ Mongock | Version 5.5+ for managing database migration |
| ποΈ MongoDB | Running locally or accessible via a connection string. |
Note: If your installed JDK version differs from the project's default, update the
<source>and<target>values in themaven-compiler-pluginsection ofpom.xml.
Follow these steps to set up and run the SaleSync application:
git clone [https://github.com/banuka20431/SaleSync.git](https://github.com/banuka20431/SaleSync.git)
cd SaleSyncUse Maven to compile the code and package the application:
mvn clean packageYou can run the application using the Maven exec plugin:
mvn exec: java -Dexec.mainClass="org.oop_project.Main"Please make sure your MongoDB server is running. The application is configured by default to connect to mongodb://localhost:27017 with the database name SaleSync.
The project follows a standard package structure demonstrating the separation of concerns (MVC pattern elements) and the application of OOP principles:
SaleSync/
βββ π LICENSE
βββ π pom.xml # Maven build configuration
βββ π README.md
βββ π lib/
β βββ π javafx.properties # JavaFX runtime configuration
βββ π src/
βββ π main/
βββ π java/
β βββ π org/
β βββ π oop_project/
β βββ π― Main.java # Launches JavaFX application
β βββ π database_handler/ # Data access and business logic
β β βββ DatabaseConnectionManager.java
β β βββ π enums/
β β β βββ Role.java
β β β βββ UnitType.java
β β βββ π migrations/ # Database versioning
β β β βββ DatabaseChangeUnit_001.java
β β β βββ DatabaseChangeUnit_002.java
β β β βββ DatabaseChangeUnit_003.java
β β β βββ DatabaseChangeUnit_004.java
β β β βββ DatabaseChangeUnit_006.java
β β β βββ DatabaseChangeUnit_007.java
β β βββ π models/ # Domain models (inheritance)
β β β βββ Admin.java
β β β βββ Cashier.java
β β β βββ Employee.java # Base class
β β β βββ Product.java
β β β βββ ProductManager.java
β β βββ π operations/ # Business operations
β β βββ EmployeeOperations.java
β β βββ Operations.java
β β βββ ProductOperations.java
β βββ π utils/ # General utilities
β β βββ Generate.java
β β βββ JsonReader.java
β β βββ Text.java
β βββ π view/ # JavaFX presentation layer
β βββ SaleSyncApp.java # JavaFX Application subclass
β βββ π controllers/ # UI event handlers
β β βββ AdminController.java
β β βββ CashierController.java
β β βββ CheckoutController.java
β β βββ LoginController.java
β β βββ ProductController.java
β βββ π helpers/ # UI helper classes
β β βββ BillRow.java
β β βββ EmployeeRow.java
β β βββ Navigators.java
β β βββ ProductRow.java
β β βββ Validator.java
β βββ π view/ # Nested resources accessors
β βββ (see resources section)
βββ π resources/
βββ π org/
βββ π oop_project/
βββ π view/
βββ π css/
β βββ style.css
βββ π fxml/
β βββ admin-panel.fxml
β βββ cashier-portal.fxml
β βββ checkout.fxml
β βββ login.fxml
β βββ product-dashboard.fxml
βββ π images/ # Image assets (filenames omitted)
Login Panel
Admin Panel
Inventory Manager
Cashier Portal
The application will launch the JavaFX GUI upon execution. You will first be prompted to log in. A default Admin user is created on the first run for initial access.
Features Access
- Admin: Full access to Employee and Product Management.
- Product Manager: Access to Product Inventory Management.
- Cashier: Access to the Billing System.
As a collaborative group assignment, effective use of Git and GitHub is mandatory to demonstrate teamwork.
Follow these steps to ensure proper Version Control System (VCS) usage:
Work on a Feature Branch: Create a new branch for each task to isolate changes and allow for merging demonstrations.
git checkout -b feature/implement-loginCommit Regularly: Commit your changes frequently with descriptive commit messages.
git commit -m "FEAT: Added basic validation logic to LoginController"Push to GitHub: Keep the collaborative project repository up to date.
git push origin feature/implement-loginOpen and Merge a PR: Use Pull Requests (PRs) on GitHub to merge your branch back into main once the feature is complete and reviewed.