Skip to content

About

This is a Java based client-server application. It enables buyers and sellers to interact through bidding and messaging in real time. It features secure login, item management, and synchronized data storage.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

206 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Link to your Github Repo

AUCTION HOUSE - CS180 FINAL PROJECT Phase 3

ACTIVE TEAM MEMBERS

  • Joey Kokinda
  • Shawn Lightner
  • Benjamin Atkinson
  • Stephanie Kulinski
  • Vishwa Kamalbabu

SUBMISSION

  • Vocareum: Stephanie Kulinski
  • Report: Stephanie Kulinski
  • Presentation: Stephanie Kulinski

INSTRUCTIONS FOR RUNNING THE PROJECT

Requirements

  • Java Development Kit (JDK) 8 or higher
  • A Java IDE (IntelliJ IDEA, Eclipse, etc.)

Running the Application

  1. Navigate to src/com/ah/client/ui/ and run AuctionHouseMain.java
  2. This will automatically start both the client and server components
  3. From the login screen, you can:
    • Login with an existing account
    • Create a new buyer or seller account

Testing

  • Everytime the test cases are run, the testDb folder must be deleted/cleared beforehand
  • The AuctionHouseMain.java file acts as our testing for the GUI and network I/O, since the GUI completely relies on network I/O

FEATURES IMPLEMENTED

Base Requirements

  • Seller accounts - Full seller account functionality with item listing capabilities
  • Buyer accounts - Complete buyer functionality with bidding and messaging
  • New user account creation - Registration for both buyer and seller accounts
  • Password protected login - Secure login system with password validation
  • Account deletion - Both buyers and sellers can delete their accounts
  • Item listing creation - Sellers can create listings with details (name, starting bid, duration)
  • Item listing deletion - Sellers can remove their listings
  • Item search - Buyers can search for items by name
  • Bidding system - Complete system with automatic bid increments
  • Auction duration timer - Time-based auction expiration with countdown display
  • Messaging system - Buyers can message sellers and sellers can respond
  • Upload/display item pictures - NOT IMPLEMENTED

Additional Requirements for Teams of 5

  • Seller Ratings - Buyers can rate sellers with star system and comments
  • Seller store pages - Seller profiles with descriptions and ratings
  • Seller search - Buyers can search for sellers by username
  • Seller can end auction early - Option for sellers to end auctions before expiration
  • "Buy it now" price - Sellers can set immediate purchase prices
  • "Buy it now" purchasing - Buyers can use the buy now option
  • View previously auctioned items - History of items bid on and sold

ADDITIONAL FEATURES IMPLEMENTED

  1. Enhanced Messaging System

    • Conversation view with threading by user
    • Message history preservation
    • Real-time message updates
  2. Financial System

    • Balance management for buyers
    • Funds verification for bidding
    • Adding funds to account
  3. UI Improvements

    • Tabbed dashboard interfaces
    • Real-time data refreshing
    • Interactive item listings
  4. Search Functionality

    • Item search by name
    • Seller search by username
    • Filtering options for better results
  5. Buyer Dashboard Features

    • Bid history tracking
    • Purchase tracking (including Buy Now items)
    • Status indicators for bids (Winning, Outbid, Won)
  6. Seller Dashboard Features

    • Item management tools
    • Buyer communication management
    • Sales history tracking

ARCHITECTURE & DESIGN

Our Auction House implementation follows a client-server architecture:

  1. Client Components

    • BuyerClient & SellerClient for communication with server
    • Separate UI dashboards for buyers and sellers
    • Real-time data synchronization
  2. Server Components

    • Database for persistent storage
    • Client handler for processing requests
    • Synchronization mechanisms for data integrity
  3. Data Models

    • User (abstract base class)
    • Buyer and Seller (specialized user types)
    • Item (with bidding, timing, and purchase logic)
    • Message (for buyer-seller communication)

KNOWN LIMITATIONS

  1. Image Support: The system doesn't support item images
  2. Real-time Notifications: No push notifications for bid updates
  3. I couldn't figure out a way to update table gui, so user needs to logout and login to refresh the tables.

CHANGES TO PHASE 2

  • Fixed all test cases
  • Added requests to networking system
  • Running the GUI acts as our main methods to test IO functionality

Auction House - Phase 1

Compilation and Running

  • Clone Repo to desired IDE
  • Compile: javac -d out src/com/ah/database/*.java src/com/ah/interfaces/*.java
  • Run tests: java -cp out:lib/junit.jar org.junit.runner.JUnitCore com.ah.tests.SellerTest com.ah.tests.MessageTest com.ah.tests.DatabaseTest com.ah.tests.ItemTest com.ah.tests.BuyerTest
  • Note: no main, just db and test cases

Submission

  • Submitted by: Joey Kokinda, Shawn Lightner, Benjamin Atkinson, Stephanie Kulinski, Vishwa Kamalbabu
  • Vocareum: Joey Kokinda

Database:

  • Manages items, sellers, and buyers lists, persisting them to db/items, db/sellers, and db/buyers as <itemID>.item, <username>.txt, and <username>.buyer.
  • Creates db/ directories on startup or loads existing data with loadDatabase().
  • Thread-safe: Uses synchronized blocks on lists for writes and deletes.
  • Key methods: getItems(), getSellers(), getBuyers(), write(), delete(), loadDatabase().

Testing:

  • DatabaseTest: Verifies persistence by writing a Seller to db/sellers/seller1.txt and deleting it, checking file existence.

Relationships:

  • Central hub, persisting Item, Seller, and Buyer objects.
  • Used by Seller and Buyer to access user lists (e.g., db.getSellers() in Seller.checkUsername()).

Seller:

  • Represents a seller with username, password, sellerRating, itemIDList, messages, and balance.
  • Handles username uniqueness (checkUsername), login (login), item management (addItemID, deleteItemID), rating updates (setSellerRating), and messaging (sendMessage).
  • Thread-safe: sendMessage() uses synchronized on messages.
  • Persisted as <username>.txt in db/sellers/.

Testing:

  • SellerTest: Tests creation, getters/setters, username uniqueness, and item list management.

Relationships:

  • Depends on Database for persistence and user lists.
  • Interacts with Buyer in sendMessage().
  • Linked to Item via itemIDList and Item’s seller field.
  • Uses Message for messaging.

Buyer:

  • Represents a buyer with username, password, balance, and messages.
  • Includes stubs for createBuyer, login, deleteSeller (should be deleteBuyer), and getBalance.
  • Supports messaging with sendMessage() and getMessages().
  • Thread-safe: sendMessage() uses synchronized on messages.
  • Persisted as <username>.buyer in db/buyers/.

Testing:

  • BuyerTest: Placeholder test verifying object creation (incomplete due to time constraints).

Relationships:

  • Depends on Database for persistence and to access Seller list.
  • Interacts with Seller in sendMessage().
  • Linked to Item via maxBidder field.
  • Uses Message for messaging.

Item:

  • Represents an auction item with itemID, name, seller, maxBidder, bidPrice, listingExpiration, etc.
  • Manages auction state (updateState), bidding (submitBid), buy-now (setBuyPrice), and search (searchKeyword, searchSeller).
  • Not thread-safe (to be fixed in Phase 2).
  • Persisted as <itemID>.item in db/items/.

Testing:

  • ItemTest: Verifies submitBid updates bid price correctly.

Relationships:

  • Depends on Database for persistence.
  • Linked to Seller via seller field and Buyer via maxBidder.
  • Referenced by Message via itemID.

Message:

  • Represents a message with msgID, content, senderID, receiverID, and itemID.
  • Provides getters; sendMessage() and getMessages() are placeholders (logic in Seller/Buyer).
  • Stored within Seller and Buyer messages lists.
  • Thread safety handled by Seller and Buyer.

Testing:

  • MessageTest: Verifies sending a message (seller side) and persistence.

Relationships:

  • Used by Seller and Buyer for messaging.
  • References Item via itemID.
  • Persisted via Seller and Buyer.

Auction House - Phase 2

Compilation and Running

  • Clone Repo to desired IDE
  • Compile: javac -d out src/com/ah/database/*.java src/com/ah/interfaces/*.java
  • Run tests: java -cp out:lib/junit.jar org.junit.runner.JUnitCore com.ah.tests.SellerTest com.ah.tests.MessageTest com.ah.tests.DatabaseTest com.ah.tests.ItemTest com.ah.tests.BuyerTest

Submission

  • Submitted by: Joey Kokinda, Shawn Lightner, Benjamin Atkinson, Stephanie Kulinski, Vishwa Kamalbabu
  • Vocareum: Stephanie Kulinski

Updates to Phase 1

User:

  • Represents a user and their account with username, password, and userFile.
  • Handles username and password setting (setUsername) (setPassword), login (login), and user file creation for all buyers and sellers

Testing:

  • UserTest: Tests creation, getters/setters, and login.

Relationships:

  • Superclass for the Seller and Buyer classes
  • Seller and Buyer now extend User to access username, password, and userFile.
  • Constructor is called from Seller and Buyer classes
  • Seller and buyer classes now interact with the database by calling add, sync, and remove when there is an update to the user account

Client

BuyerClient:

Purpose: Client for buyer interactions with the auction server, handling login, account creation, bidding, and messaging. Functionality:

  • login, createAccount, deleteAccount: Manage buyer accounts.
  • placeBid: Place bids on items.
  • sendMessage: Send messages to sellers about specific items or anything
  • getItemsBidOn, getBalance: Retrieve buyers bidding history and balance. Usage: Connects to the server (default localhost).

SellerClient:

Purpose: Client for seller interactions with the auction server, managing items, auctions, and account stuff. Functionality:

  • login, createAccount, deleteAccount: Manage seller accounts
  • addItem, deleteItem, setBuyPrice, endAuction: Manage items and auctions.
  • listItems: List items owned by the seller
  • getSellerRating: Retrieve the sellers rating Usage: Connects to the server (default host: localhost, port: 12345). Includes a basic command-line interface for interaction (e.g., create account, add items, list items). SellerClient main method can be run to test functionality. Following successful connection, an integer 0-8 can be input to test the various SellerClient methods as indicated by comments in the main method. All communication methods can be tested in this manner.

Client:

Purpose: Base class for client-server communication, implementing ClientInterface. Functionality:

  • connect, disconnect: Establish and close socket connections to the server
  • sendRequest: Send requests to the server using ObjectOutputStream and ObjectInputStream

Relationships: BuyerClient and SellerClient extend this class for specific buyer and seller operations

Server

Purpose: Handles client requests for the auction system, including account management, bidding, and messaging.

Classes:

  • Server: Listens for incoming client connections on port 4242 and spawns a ClientHandler thread for each client.
  • ClientHandler: Processes client requests (e.g., login, create account, send message, place bid) and interacts with the Database.

Functionality:

  • Supports buyer and seller account creation, login, and deletion
  • Handles messaging between buyers and sellers with handleMessage
  • Manages item bidding for buyers with handleBid
  • Persists data to the Database /db

Usage:

  • Run with java -cp out com.ah.server.Server 4242 db to start the server and listen for client connections
  • ClientHandlerTest tests the methods in ClientHandler - the test should print the stack trace for invalid username or password

Communication

Purpose: Details the requests made by the client that will be sent to the server

Classes:

  • AccountCreationRequest: Request sent when the user wants to create an account
  • AccountDeletionRequest: Request sent when the user wants to delete their account
  • AuthRequest: Request sent when the user wants to login to their account
  • ItemBidRequest: Request sent when the user wants to bid on an item
  • MessageRequest: Request sent when the user wants to send a messsage
  • Request: Superclass for all messages that contains the message type
  • StatusRequest: Request sent when the user wants to see if their bid was a success

Functionality:

  • Specifies the type of request/message that is being sent from the client to the server

Relationships:

  • All classes in the communication package extend the request class
  • The request objects are sent between the client and the server, which call the necessary methods in the database, message, seller, buyer, and item classes based on the message

javaAuctionHouse

About

This is a Java based client-server application. It enables buyers and sellers to interact through bidding and messaging in real time. It features secure login, item management, and synchronized data storage.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages