A console-based store management system built in Java β featuring inventory control, customer management, and a full shopping cart workflow.
- About
- Demo
- Features
- Tech Stack
- Architecture
- Folder Structure
- Prerequisites
- Installation & Build
- Running the Application
- Usage
- Roadmap
- Contributing
- Author
- License
- Acknowledgements
The Java Store Management System is a terminal-based Java application that simulates a retail store backend. It manages an in-memory inventory of items (books, shoes, and games), registers customers, and provides a complete shopping cart workflow from item selection through to checkout.
This project was built as a Java 2 academic project and demonstrates core object-oriented programming principles: inheritance, encapsulation, polymorphism, and clean separation of concerns across classes.
-------[ Store Main Menu ]-------
1. Add a new Item to Store.
2. Add a new Customer to Store.
3. Add an item to Customer shopping cart.
4. Remove an item from Customer shopping cart.
5. View the items in Customer shopping cart.
6. End shopping and go to checkout.
7. Empty Customer shopping cart.
8. Modify customer data.
9. Exit the program.
(Enter the Number Twice for Function description)
---------------------------------
Please Enter the number of Operation you want :
[ Add Item Operation: ]
Please enter the item Number : 101
Please enter the item Name : Java Programming
Please enter the Quantity : 15
Please enter the Price : 29.99
Enter the type of item (B)Book, (s)shoes, (G)Game? : B
Enter the Book title: Java in Action
Enter the Book author name: John Doe
[DONE] > Item added Successfully
The Customer No : 1, The Customer Name : Alice
The current items in the shopping cart :
Item no Item name Quantity Unit price Total price
101 Java Programming 2 29.99 59.98
Total price : 59.98
Note: The terminal output uses ANSI color codes β yellow for headings, green for success messages, and red for errors. Color rendering depends on your terminal emulator.
- Add items to the store with a unique item number, name, quantity, and price
- Three item types supported: Books (with title and author), Shoes, and Games
- Inventory quantity is automatically decremented on checkout
- Register new customers with unique customer IDs and names
- Modify existing customer number and name
- Customers are stored in memory for the session
- Add items to any registered customer's cart with quantity validation
- Remove individual items from the cart
- View a formatted cart summary with unit prices and totals
- Empty a customer's cart (also removes the customer from the session)
- Validates stock availability at checkout time
- Deducts purchased quantities from the store inventory
- Displays a full itemized receipt with total price
- Catches
InputMismatchExceptionon all numeric inputs β the program never crashes on bad input - Validates uniqueness of item numbers and customer IDs
- Rejects negative quantities and prices with clear error messages
- Prompts
(y/n)confirmations with re-prompt on invalid characters
- Enter any menu number twice (e.g.,
11,22,33β¦) to print a full description of that operation
No external libraries or frameworks are used. The project runs on the Java Standard Library alone.
The application follows a single-package OOP design with clear class responsibilities:
StoreInfo (abstract)
βββ JavaProject (main entry point + shared state)
β
βββ Items (inventory item base class)
β βββ books (Book subclass with title & author)
β
βββ Customer (customer identity + per-customer cart)
β
βββ ShoppingCart (all cart & checkout operations)
Key design decisions:
JavaProjectholds two sharedstaticArrayListcollections βCustomersanditemsListβ which act as the in-memory "database" for the session. All other classes import these viastatic import.StoreInfois anabstractclass whose sole role is to house static help-text methods, keeping descriptive output separate from logic.booksextendsItemsand overrides nothing; it simply addsbookTitleandbookAuthorfields. The item type character'b'is used at runtime to castItemsreferences back tobookswhere needed.- All data is in-memory only β nothing is persisted to disk between runs.
Java-2-Project/
β
βββ src/
β βββ javaproject/
β βββ JavaProject.java # Main class β entry point & main menu
β βββ StoreInfo.java # Abstract base β help text for each operation
β βββ Items.java # Store item model + AddItem() logic
β βββ books.java # Book subclass (adds title & author)
β βββ Customer.java # Customer model + AddCustomer/Modify logic
β βββ ShoppingCart.java # Cart operations: add, remove, view, checkout, empty
β
βββ nbproject/
β βββ build-impl.xml # NetBeans-generated Ant build implementation
β βββ genfiles.properties # NetBeans generated files metadata
β βββ project.properties # Project settings (Java 18, main class, paths)
β βββ project.xml # NetBeans project type descriptor
β
βββ build.xml # Apache Ant build script entry point
βββ manifest.mf # JAR manifest (Main-Class set by Ant at build time)
βββ java-Final-Project.pdf # Project specification / assignment document
βββ README.md
- Java Development Kit (JDK) 18 or later
- Download: Oracle JDK 18 or OpenJDK
- Apache Ant 1.9+ (required for the Ant build script)
- Download: ant.apache.org
- Or open directly in Apache NetBeans IDE (recommended β the project is a native NetBeans project)
Verify your installation:
java -version
# java version "18.0.x" ...
ant -version
# Apache Ant(TM) version 1.9.x ...- Clone the repository:
git clone https://github.com/aymanbismail/Java-2-Project.git
- Open Apache NetBeans IDE
- Go to File β Open Project and select the
Java-2-Projectfolder - NetBeans detects it as a Java SE project automatically
- Click the Build button (or press
F11) to compile and package the JAR
git clone https://github.com/aymanbismail/Java-2-Project.git
cd Java-2-Project
# Compile and build the JAR
ant jarThe compiled JAR is output to:
dist/JavaProject.jar
To clean build artifacts:
ant cleanjava -jar dist/JavaProject.jarPress Run (F6) β NetBeans compiles and runs the project in the embedded terminal.
# From the project root
javac -d build/classes src/javaproject/*.java
java -cp build/classes javaproject.JavaProjectOnce the application starts, you are presented with a numbered main menu. Enter the corresponding number and follow the prompts.
| Option | Operation | Description |
|---|---|---|
1 |
Add Item | Add a new item (Book / Shoe / Game) to the store inventory |
2 |
Add Customer | Register a new customer with a unique ID |
3 |
Add to Cart | Add a store item to a specific customer's shopping cart |
4 |
Remove from Cart | Remove an item from a customer's shopping cart |
5 |
View Cart | Display all items in a customer's cart with a total |
6 |
Checkout | Complete the purchase β deducts stock and clears the cart |
7 |
Empty Cart | Remove all items from a customer's cart and delete the customer |
8 |
Modify Customer | Update a customer's ID or name |
9 |
Exit | Exit the program |
Enter any option number twice to print a full description of what that operation does:
| Input | Shows description for |
|---|---|
11 |
Add Item |
22 |
Add Customer |
33 |
Add to Cart |
44 |
Remove from Cart |
55 |
View Cart |
66 |
Checkout |
77 |
Empty Cart |
88 |
Modify Customer |
When adding an item, you will be asked to select a type:
| Key | Type | Extra Fields |
|---|---|---|
B |
Book | Title, Author |
S |
Shoes | β |
G |
Game | β |
- File persistence β save and load inventory and customer data between sessions (CSV or JSON)
- Search functionality β search items by name or number before adding to cart
- Discount / coupon system β apply percentage or fixed discounts at checkout
- Multiple item types β extend beyond books, shoes, and games (e.g., electronics, clothing)
- Receipt generation β print a formatted receipt to a text file on checkout
- JUnit test suite β unit tests for all core operations
- Quantity update β option to restock item quantities in the store
- Customer purchase history β track past checkouts per customer within a session
Contributions are welcome! To contribute:
- Fork the repository on GitHub
- Create a branch for your feature or fix:
git checkout -b feature/your-feature-name
- Commit your changes with a clear message:
git commit -m "Add: description of what you added" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against the
masterbranch
- Keep changes focused β one feature or fix per PR
- Do not break existing menu behavior
- Follow the existing code style (Java naming conventions, ANSI color constants)
- Test your changes manually by running the full application before submitting
This project was created as an academic assignment. It is shared publicly for educational and portfolio purposes. No license is currently attached β please contact the author before reusing or redistributing this code.
- Oracle Java SE 18 Documentation β standard library reference
- Apache Ant β build automation
- Apache NetBeans IDE β project scaffolding and build configuration
- shields.io β badge generation