A fully functional Object-Oriented e-commerce console application built with Java as a term project. The application allows users to register, log in, browse a marketplace, manage a shopping cart, handle favorites, place orders with credit card payments, and more — all through a command-line interface backed by a remote MySQL database.
Note: Since the project submission has been completed, the remote MySQL database is no longer accessible. Therefore, the application cannot connect to the server and will not function at runtime. The source code is preserved here for review and grading purposes only.
- User Authentication – Register and log in with username/password
- Marketplace Browsing – View all available products from the database
- Shopping Cart – Add products to cart and manage them
- Favorites – Mark products as favorites for quick access
- Order Management – Place orders with quantity selection and credit card payment
- Credit Card Management – Add and remove credit cards to/from your account
- Stock Tracking – Automatic stock decrease upon order confirmation
- Persistent Data – All data is stored in a remote MySQL database
| Technology | Purpose |
|---|---|
| Java | Core programming language |
| MySQL | Remote relational database |
| JDBC | Java Database Connectivity for DB operations |
oopProjectSubmit/
├── OopProjectHalilKayra.java # Main entry point of the application
├── CommandLineUi.java # Command-line user interface (menus & interactions)
├── AuthManager.java # Authentication logic (login, register, session)
├── User.java # User model with cart, favorites, orders & cards
├── Product.java # Product model with stock management
├── Order.java # Order model linking user, product & payment
├── CreditCard.java # Credit card model
├── ProductsOrdered.java # Tracks ordered products and their quantities
├── Database.java # All database CRUD operations
├── DatabaseConnection.java # MySQL connection manager
└── OOPTermProjectReport.pdf # Project report document
The entry point of the application. Initializes the marketplace by fetching all products from the database and starts the command-line UI.
Handles all user interaction through the console. Provides menus for login, registration, marketplace browsing, cart management, favorites, ordering, and credit card operations.
Manages user authentication including:
login()– Validates credentials and initializes user sessionregister()– Creates a new user account in the databaseinitializeActiveUser()– Loads user's cart, favorites, orders, and credit cards upon login
Represents a user with personal information and associated data:
- Personal info: username, name, surname, email, date of birth, addresses
- Collections: shopping cart, favorite products, credit cards, ordered products
- Methods for adding/removing favorites, cart items, credit cards, and confirming orders
Represents a marketplace product with:
- Properties: id, name, color, category, stock, weight, description, price
- Stock management:
isStockEnough()anddecreaseStock()methods - Unique identification by combination of product name and color
Represents a single order linking:
- The ordering user
- The ordered product and quantity
- The payment credit card
createOrder()method to finalize the purchase
Represents a credit card with card number, owner name, security code, and expiration date.
Tracks all products a user has ordered along with their respective quantities and payment information.
Contains all database CRUD operations including:
- User management (add/get users)
- Marketplace operations (fetch products, update stock)
- Cart operations (add to cart, get cart items)
- Favorites operations (add/remove favorites)
- Order operations (add orders, get order history)
- Credit card operations (add/remove cards)
Manages the MySQL database connection using JDBC with configured host, port, credentials, and database name.
- Startup – The application connects to the remote MySQL database and loads all marketplace products.
- Authentication – The user is prompted to either log in or register a new account.
- Session Initialization – Upon successful login, the user's cart, favorites, orders, and credit cards are loaded from the database.
- Marketplace – The user can browse available products, view details, and add items to their cart or favorites.
- Cart & Ordering – The user can review their cart, select a credit card, and place orders. Stock is automatically updated.
- Data Persistence – Every action (adding to cart, placing an order, managing favorites/cards) is immediately reflected in the database.
The application was originally connected to a remote MySQL database hosted on alwaysdata.net.
The database is no longer accessible. The project submission period has ended and the remote database server has been shut down. As a result, the application cannot establish a connection and will not run as expected.
Original Database Configuration:
- Host:
mysql-dbdeneme.alwaysdata.net - Port:
3306 - Database:
dbdeneme_2025 - Driver: JDBC (
java.sql)
##Documentation
The full project report is available in the repository: