🛒 AmazLite – Java E-Commerce Platform
AmazLite is a multi-threaded, client–server e-commerce platform built entirely in Java. It simulates a mini version of Amazon, supporting product listings, cart management, order validation, seller/customer roles, and persistent data storage through CSV files.
This project demonstrates full-stack Java development, combining networking, concurrency, GUI design, and file I/O, all structured in clean, object-oriented architecture.
Highlights
- Thread-Safe Backend: Multi-threaded server (MarketServer + MarketThread) handles concurrent client connections safely.
- Dual Roles: Sellers can manage stores and inventory; customers can browse, shop, and checkout.
- GUI + CLI Clients: Modern Java Swing GUI (GuiClient) and a lightweight command-line interface.
- Persistent Storage: FileIO stores all users, stores, and products in CSV format for easy recovery.
- Custom Exceptions: Includes MaximumQuantityReached and NameExists for enforcing business rules.
- Modular Architecture: Separation of concerns across layers for scalability and maintainability.
How to Run the Project
1 – Compile all source files
javac *.java
2 – Start the Server
java MarketServer
The server runs on port 5555 by default.
3 – Launch a Client
java GuiClient
4 – Connect
Host 127.0.0.1
Port 5555
Then register or log in as a Customer or Seller to begin using the marketplace!
File Overview
File Description
Main.java: Entry point for the project, initializes core components.
Market.java: Thread-safe in-memory data store managing users, stores, and products.
MarketServer.java: Server entry point; listens for incoming socket connections.
MarketThread.java: Manages communication with each client in its own thread.
MarketApi.java: Defines the request/response protocol between client and server.
GuiClient.java: Swing-based GUI for customers and sellers.
BrowseMarket.java: Command-line client for quick testing and browsing.
FileIO.java: Handles CSV-based reading and writing of user, store, and product data.
Product.java: Represents products (name, price, stock, quantity in carts, etc.).
Store.java: Represents stores managed by sellers.
User.java: Base class for both sellers and customers.
Seller.java: Extends User; adds store and product management functions.
Customer.java: Extends User; adds cart and purchase functionality.
MaximumQuantityReached.java: Exception for enforcing order quantity limits.
NameExists.java: Exception for handling duplicate user or store names.
Thread-Safety Highlights
Shared resources (e.g., carts, stores, products) are protected using ConcurrentHashMap and synchronized methods.
Each client is assigned to its own thread (MarketThread) for isolated communication.
Stock and cart operations are validated atomically to prevent race conditions.
Author
Raja Darshini Rajamani
📧 darshinirajamani@gmail.com
🌐 darshinirajamani.com
💻 GitHub Darshxx13
Acknowledgements
This project was developed to explore networked software design, concurrency, and data persistence in Java.
It demonstrates end-to-end system design, from backend multithreading to GUI interface and serves as a foundation for future scalable marketplace applications.