How thaisodupe-coder/auctionsystem works
1. Overall shape
This is a Java desktop client-server auction system. The runtime splits into a JavaFX client, a socket-based backend server, and a PostgreSQL database running in Docker. The server owns the business rules and persistence; the client is mostly UI plus network request/response handling.
2. Runtime boundaries
The client and server are started separately, which is reflected in the codebase:
- AppClient / Launcher boot the JavaFX UI.
- AuctionServer bootstraps the backend socket listener.
- Shell/batch scripts and Maven goals wrap startup on different OSes.
This separation is the main architectural boundary in the repository.
3. UI layer
The frontend lives under controller/ and resources/.../view/:
- FXML files define screens such as login, register, main page, item details, seller view, and add item.
- Controllers like LoginController, MainPageController, and ItemDetailsController handle user actions and UI state.
The UI does not talk directly to the database; it delegates to the client networking layer.
4. Client networking layer
network/ClientManager is the client-side socket abstraction. It serializes domain intent into network/message/Request objects and receives Response objects back from the server. This layer is the client’s only gateway to server-side state and is the key interface to show between UI and backend in a diagram.
5. Server concurrency and request handling
On the server side, AuctionServer accepts incoming connections and ClientHandler handles each connected client. The README mentions multithreading, thread pools, and scheduled execution, so the server is designed for concurrent client sessions and timed auction completion. The socket layer is the transport boundary into the backend.
6. Business services
Core application logic is concentrated in service/:
- UserManager handles account-related workflows.
- AuctionManager handles auction lifecycle, bidding, and item/lot operations.
These services sit between the network layer and the domain model, enforcing rules before any persistence change is made.
7. Domain model
The model/ package captures the business entities:
- model/user: user hierarchy and roles (Admin, Seller, Bidder, NormalUser, UserRole, UserDecorator).
- model/item: abstract Item plus concrete categories such as Art, Electronics, and Vehicle, with factories for each.
- model/auction: Auction, AuctionStatus, BidTransaction, and AuctionObserver.
This structure suggests a domain-rich design with inheritance, factories, and observer-style notifications for auction state changes.
8. Persistence and database
util/PersistenceService is the database boundary. The project uses JDBC against PostgreSQL, with schema initialization in src/main/resources/db/init.sql. The database is provided via docker-compose.yml, so persistence is external to the Java process and is brought up as an infrastructure dependency.
9. Validation and failure paths
Custom exceptions in exception/ define the main failure modes:
- AuthenticationException
- InvalidBidException
- AuctionClosedException
These represent business-rule failures, not technical crashes, and should be drawn as part of the service/domain boundary rather than the UI layer.
10. Data flow for a typical bid
A bid likely flows as: JavaFX controller action → ClientManager request → ClientHandler → AuctionManager/domain validation → persistence update via PersistenceService → Response back to the client. AuctionObserver suggests the system may also notify interested parties when auction state changes, which is important for “real-time bidding” behavior.
11. Packaging and build
The project is Maven-based (pom.xml) and modular (module-info.java). It builds both a regular jar and an executable jar-with-dependencies, and uses JavaFX dependencies/plugin support. This matters because the client is a desktop GUI app rather than a web frontend.
12. Operational tooling
GitHub Actions CI is present under .github/workflows/ci.yml. Runtime orchestration relies on Docker Compose for PostgreSQL plus OS-specific scripts under windows/ and linux_macos/. These are deployment/support artifacts, not core runtime components, but they are part of how the system is operated end-to-end.
Main entry points: ClientManager.java ClientManager · AuctionManager.java AuctionManager · ClientHandler.java ClientHandler · UserManager.java UserManager
Components 21
Client
JavaFX desktop UI and client-side request handling.
- AppClient · Bootstraps the desktop client application.
auctionsystem/src/main/java/com/auction/AppClient.java - Launcher · Alternative entrypoint for launching the client UI.
auctionsystem/src/main/java/com/auction/Launcher.java - Login · Handles authentication screen actions.
auctionsystem/src/main/java/com/auction/controller/LoginController.java - Main page · Coordinates the primary browsing and auction UI.
auctionsystem/src/main/java/com/auction/controller/MainPageController.java - Item details · Shows selected item and bidding details.
auctionsystem/src/main/java/com/auction/controller/ItemDetailsController.java - Register · Handles account creation flow.
auctionsystem/src/main/java/com/auction/controller/RegisterController.java - Add item · Supports seller item creation workflow.
auctionsystem/src/main/java/com/auction/controller/AddItemController.java - Seller view · Seller-oriented inventory and auction management screen.
auctionsystem/src/main/java/com/auction/controller/SellerViewController.java - ClientManager · Client-side gateway for sending requests and receiving responses.
auctionsystem/src/main/java/com/auction/network/ClientManager.java - Request · Client-to-server command payload.
auctionsystem/src/main/java/com/auction/network/message/Request.java - Response · Server-to-client result payload.
auctionsystem/src/main/java/com/auction/network/message/Response.java
Server
Socket backend, business services, and persistence access.
- AuctionServer · Accepts incoming client connections and routes them to handlers.
auctionsystem/src/main/java/com/auction/server/AuctionServer.java - ClientHandler · Processes one connected client session.
auctionsystem/src/main/java/com/auction/server/ClientHandler.java - UserManager · Handles authentication and user-related workflows.
auctionsystem/src/main/java/com/auction/service/UserManager.java - AuctionManager · Controls auction lifecycle, bidding, and item operations.
auctionsystem/src/main/java/com/auction/service/AuctionManager.java - PersistenceService · Database access boundary used by services.
auctionsystem/src/main/java/com/auction/util/PersistenceService.java
Domain
Core auction, item, and user models.
Infrastructure
Database and runtime orchestration.
- init.sql · Initial database schema and setup script.
auctionsystem/src/main/resources/db/init.sql - Docker Compose · Runs the PostgreSQL database used by the application.
docker-compose.yml
Connections 22
- AppClient → Login: loads · Client startup opens the initial UI flow.
- Launcher → AppClient: starts · Wrapper entrypoint launches the JavaFX application.
- Login → ClientManager: auth request · Login actions are sent through the network gateway.
- Register → ClientManager: create account · Registration uses the same client transport.
- Main page → ClientManager: browse/bid · Main page actions issue server requests.
- Item details → ClientManager: bid/update · Item detail actions go through the client manager.
- Add item → ClientManager: publish item · Seller item creation is sent to the backend.
- Seller view → ClientManager: manage items · Seller view uses server-backed operations.
- ClientManager → Request: serializes · Client intent is encoded as a request message.
- ClientManager → Response: receives · Responses are read back from the server.
- Request → ClientHandler: socket · Requests cross the client-server boundary.
- AuctionServer → ClientHandler: accepts · Server dispatches each client connection to a handler.
- ClientHandler → UserManager: user ops · Authentication and account flows are delegated to user service.
- ClientHandler → AuctionManager: auction ops · Bid and auction commands are delegated to auction service.
- UserManager → PersistenceService: reads/writes · User workflow persists through JDBC boundary.
- AuctionManager → PersistenceService: reads/writes · Auction workflow persists through JDBC boundary.
- AuctionManager → Auctions: enforces · Auction rules are expressed in the domain model.
- AuctionManager → Items: uses · Auction logic manipulates item entities.
- UserManager → Users: uses · Account logic works with the user model.
- Auctions → Users: observer/actor · Auctions involve bidders and state notifications.
- PersistenceService → init.sql: schema · Database setup comes from the initialization script.
- Docker Compose → init.sql: starts with · PostgreSQL is provisioned alongside the schema initialization.