This project is a distributed system designed to support an online store for IT products. The system follows a client-server-server architecture, where the client interacts with two servers: the User Management Server and the Inventory Management Server. The application facilitates user authentication, product search, and product purchases.
- Java RMI: Used for Remote Method Invocation (RMI), enabling communication between applications running on different virtual machines.
- Swing API: Used for creating the graphical user interface (GUI) of the application, providing a user-friendly and interactive experience.
- Client-Server-Server Model: The client interacts with two servers. The User Management Server handles user-related functions, while the Inventory Management Server handles product-related functions. This separated approach ensures clear responsibility allocation and improves the scalability and maintainability of the system.
- Simple Authentication Algorithms: User credentials are verified against a database on the User Management Server, ensuring security and preventing unauthorized access.
- Hash Maps: Used for storing user and product information, providing quick access and efficient data management.
- authenticate(username, password): The client sends authentication requests to the User Management Server, which responds with a boolean indicating the success or failure of the authentication.
- searchProducts(criteria): The client sends product search requests with specific criteria to the User Management Server, which returns a list of products matching the criteria.
- purchaseProduct(username, productCode, quantity): The client sends product purchase requests to the User Management Server, which responds with a boolean indicating the success or failure of the purchase.
- The User Management Server communicates with the Inventory Management Server to manage products using methods such as:
- getAvailableProducts()
- purchaseProduct(productCode, quantity)
- These methods include the necessary parameters, and the Inventory Management Server responds with the relevant data or purchase outcomes.
- When the user enters incorrect credentials or there are network issues, an error message is displayed, informing the user of the connection failure.
- After successful login, the user can choose the options "Search Product" and "Purchase Product."
- Search Product: The user enters search criteria, and the application displays the matching products.
- Purchase Product: The user enters the product code and quantity, confirming the purchase. Success or failure messages are displayed accordingly.
- Manages user authentication.
- Communicates with the Inventory Management Server for product-related operations.
- Supports two user categories: store customers and administrators.
- Manages product inventory.
- Provides product information based on search criteria.
- Handles requests for adding or removing products from administrators.
- Start the Servers: Start both the User Management Server and the Inventory Management Server.
- Run Client Application: Run the client application, which interacts with the servers via Java RMI.