Skip to content

kashyapmaddala/Team_Project_CS180

Repository files navigation

Clothing Marketplace - CS 18000 Team Project

Java Maven License

A Java-based clothing marketplace platform supporting user accounts, item listings, and transactions.

Team Members:

  • Adrian Mathew
  • Anagh Sheth
  • Enrique Zavala
  • Kashyap Maddala

Table of Contents

Prerequisites

  • Java JDK 11 or later
  • Apache Maven 3.8.1+
  • Git (for cloning the repository)

Here is a link for instructions on how to install Maven for any platform

Installation

  1. Clone repository:
git clone https://github.com/kashyapmaddala/Team_Project_CS180
  1. Install dependencies and build project (Current path must be root directory)
mvn clean install

Project Structure

Our project has multiple Java classes, a Java interface for each class (non-tester, non JUnit), JUnit for the four main classes, and other Enums and Exception classes.

Java Classes (non JUnit)

  • Item.java represents an item that can be listed or sold (clothing items).
  • User.java represents a single user in the database that can add reviews, list, buy, or sell items.
  • ItemManager.java manages many different item objects and reads them from/writes them to a file (where it's either a current listing, sold, or deleted). Items can be added, deleted, or their listing status can be changed.
  • UserManager.java manages many different users and reads their details from/writes them to a file. New users can be added or deleted and then this information can be saved (no duplicate usernames/users).
  • DataBase.java is only for testing purposes but tests an ItemManager and UserManager object. (No methods in this class).
  • Message.java is a class that represents a message object. It does not have methods besides setters and getters.
  • ApplicationClient.java represents the class with the required methods for a client in the client-server system. It deals with the user.
  • ApplicationClientGUI.java represents the class with a functional GUI that represents a client in the client-server system. The user interacts with the GUI (runs on Event Dispatch Thread).
  • ApplicationServer.java represents the class with the required methods for a server in the client-server system. It handles the data
  • ApplicationClientOutdated.java represents an outdated version of our client in the client-server system. (It is not in use!)
  • ApplicationServerOutdated.java represents an outdated version of our server in the client-server system. (It is not in use!)
  • ApplicationClientGUI.java contains the GUI that users can interact with, functioning similar to the client class but more visual.

Java Interfaces

  • itemInterface.java represents an interface with the required methods for a single item.
  • UserInterface.java represents an interface with the required methods for a single user.
  • UserManagerInterface.java represents an interface with the required methods for a user manager.
  • ItemManagerInterface.java represents an interface with the required methods for an item manager.
  • MessageInterface.java represents an interface with the required methods for a message object.
  • ClientInterface.java represents an interface with the required methods for a client in the client-server system.
  • ServerInterface.java represents an interface with the required methods for a server in the client-server system.

Java JUnit Test Classes

  • ItemTest.java tests the Item.java class methods via some test cases.
  • UserTest.java tests the User.java class methods via some test cases.
  • ItemManagerTest.java tests the ItemManager.java class methods via some test cases.
  • UserManagerTest.java tests the UserManager.java class methods via some test cases.
  • ApplicationClientTest.java tests the server-client system via some test cases.
  • ApplicationServerTest.java tests the server-client system via some test cases.

Java Enums

  • Gender.java contains constant values that any Item could have (MEN, WOMEN, UNISEX)
  • ItemCategory.java contains constant values for the possible types of items that could be sold (CLOTHING, FOOTWEAR, ACCESSORIES)
  • ItemStatus.java contains constant values for the possible states of an item's listing (ACTIVE, SOLD, DELETED)
  • Size.java contains constant values for the possible sizes of an item (EXTRA_SMALL, SMALL, MEDIUM, LARGE, EXTRA_LARGE)
  • SubCategory.java contains the type of item it is given its current category (SHIRTS, SNEAKERS)

Java Exceptions

  • ItemNotFoundException.java is an exception class for exceptions that are thrown if an item is not found in the database.
  • UserNotFoundException.java is an exception class for exceptions that are thrown if a user is not found in the database.

Database files (in src/main/resources)

  • items.json
  • item_history_copy.json
  • user_information.txt
  • message_history.txt
  • message_history.json
  • items_copy.json
  • user_information_copy.txt
  • itemIDtracker.txt

Dependencies

Running Tests

To run the JUnit tests, please run the following command (Current path must be root directory):

mvn clean test

After running the JUnit tests, ensure that the repository is reset with git checkout . so that the database is set to how it was before.

Building the Project

If you are running this through IntelliJ, ensure that you create a new configuration to allow multiple instances to run.

  1. At the top panel, hover above the icon showing "Run" and press the option "Edit Configurations" (Run -> Edit Configurations).
  2. Select the option to add a new configuration (either press the '+' button in the top left or press the text "Add new run configuration".
  3. When asked what type of configuration, press Application.
  4. Press "Modify options" (Alt + M on Windows) and press "Allow multiple instances" (Alt + U on Windows).
  5. When asked for the main class, type "ApplicationClient" (this is the class that should be able to have many instances).
  6. Give this configuration any name.
  7. Press "Apply" then "OK".
  8. Repeat steps 1 through 7 but in step 5, use "ApplicationClientGUI" instead (this allows multiple instances of our GUI class as well).

To run the program (if done through terminal -- NOT RECOMMENDED BECAUSE THERE ARE TOO MANY FILES TO COMPILE INDIVIDUALLY),

  1. Ensure that the current directory is ...../Team_Project_CS180 (this is the root directory).
  2. Compile every Java class. (javac ......)
  3. On one terminal window and type java src/main/java/marketplace/ApplicationServer.java
  4. Open a new terminal window and type java src/main/java/marketplace/ApplicationClient.java

To run with IntelliJ (user interface -- RECOMMENDED),

  1. Ensure that the current file configuration is selected (at the top right corner, immediately to the left of the play button, you can select the configuration).
  2. Navigate to the ApplicationServer.java file (src/main/java/marketplace/ApplicationServer.java)
  3. Click the green "play" button (to run)
  4. Navigate to the ApplicationClient.java file (src/main/java/marketplace/ApplicationClient.java)
  5. Switch the configuration to the previously created one.
  6. Click the green "play" button (to run).

Phase 1

Phase 1 of our team project is submitted by Kashyap Maddala on Vocareum.

The following files were created during Phase 1:

  • Item.java
  • User.java
  • ItemManager.java
  • UserManager.java
  • DataBase.java
  • itemInterface.java
  • UserInterface.java
  • ItemTest.java
  • UserTest.java
  • ItemManagerTest.java
  • UserManagerTest.java
  • Gender.java
  • ItemCategory.java
  • ItemStatus.java
  • Size.java
  • SubCategory.java
  • ItemNotFoundException.java
  • items.json
  • item_history_copy.json
  • user_information.txt
  • message_history.txt
  • message_history.json

Phase 2

Phase 2 of our team project is submitted by Kashyap Maddala on Vocareum.

The following files were created during Phase 2:

  • ItemManagerInterface.java
  • UserManagerInterface.java
  • MessageInterface.java
  • UserNotFoundException.java
  • Message.java
  • ApplicationServer.java
  • ApplicationClient.java
  • ApplicationServerOutdated.java
  • ApplicationClientOutdated.java
  • ClientInterface.java
  • ServerInterface.java
  • ApplicationClientTest.java
  • ApplicationServerTest.java
  • items_copy.json
  • user_information_copy.txt

Phase 3

Phase 3 of our team project includes the implementation of a graphical user interface (GUI) for the marketplace application.

The following files were created during Phase 3:

  • ApplicationClientGUI.java
  • itemIDtracker.txt

Phase 3 Features

  • Modern, user-friendly graphical interface
  • Real-time item browsing and searching
  • Interactive messaging system
  • Visual item management
  • Account management dashboard
  • Responsive design with dark theme
  • Real-time updates for listings and messages

Phase 3 Submissions

  • Phase 3 workspace: Submitted by Kashyap Maddala on Vocareum
  • Phase 3 project report: Submitted by Enrique Zavala on Brightspace
  • Phase 3 presentation video: Submitted by Enrique Zavala on Brightspace

Complete Project Structure

The project now includes all files from Phases 1, 2, and 3:

Core Classes

  • Item.java: Represents clothing items with properties like name, price, size, and status. Handles item categorization and seller information.
  • User.java: Manages user accounts, authentication, balance, and transaction history. Tracks user ratings and item history.
  • ItemManager.java: Manages the marketplace's item collection, file persistence, and search capabilities.
  • UserManager.java: Handles user registration, authentication, and data persistence. Manages user sessions and search functionality.
  • Message.java: Represents user-to-user messages with content and sender/receiver info.
  • ApplicationServer.java: Manages server-side operations, client connections, and data synchronization.
  • ApplicationClient.java: Handles client-side operations, user input processing, and server communication.
  • ApplicationClientGUI.java: Provides a modern GUI with real-time browsing, messaging, and account management features.

Interfaces

  • itemInterface.java: Defines required methods for item management and properties.
  • UserInterface.java: Specifies user management methods and properties.
  • ItemManagerInterface.java: Defines item collection management and search operations.
  • UserManagerInterface.java: Specifies user collection management and authentication methods.
  • MessageInterface.java: Defines message handling methods and properties.
  • ClientInterface.java: Specifies client-server communication methods.
  • ServerInterface.java: Defines server-client communication methods.

Test Classes

  • ItemTest.java: Tests Item class functionality and properties.
  • UserTest.java: Tests User class methods and user operations.
  • ItemManagerTest.java: Tests item management and persistence operations.
  • UserManagerTest.java: Tests user management and authentication.
  • ApplicationClientTest.java: Tests client-server communication.
  • ApplicationServerTest.java: Tests server operations and data handling.

Enums

  • Gender.java: Defines clothing gender categories (MEN, WOMEN, UNISEX).
  • ItemCategory.java: Specifies item types (CLOTHING, FOOTWEAR, ACCESSORIES).
  • ItemStatus.java: Defines item states (ACTIVE, SOLD, DELETED).
  • Size.java: Specifies clothing sizes (EXTRA_SMALL to EXTRA_LARGE).
  • SubCategory.java: Defines specific item types within categories.

Exceptions

  • ItemNotFoundException.java: Handles cases when requested items aren't found.
  • UserNotFoundException.java: Handles cases when requested users aren't found.

Resource Files

  • items.json: Stores current marketplace listings
  • item_history_copy.json: Maintains item transaction history
  • user_information.txt: Stores user account data
  • message_history.txt: Records user message history
  • message_history.json: Structured message data storage
  • items_copy.json: Backup of item listings
  • user_information_copy.txt: Backup of user data
  • itemIDtracker.txt: Stores what should be next ID number

Note: ApplicationServerOutdated.java and ApplicationClientOutdated.java are kept for reference but are not in active use.

About

This is our team project for CS 18000 at Purdue University.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages