A simple and elegant desktop application built with JavaFX to help you digitize and manage your personal wardrobe, powered by a containerized PostgreSQL database.
- About The Project
- Application Showcase
- Architectural Design
- Features
- Built With
- Getting Started
- Project Structure
- Future Improvements
StyleSimplified is a desktop app designed to tackle the age-old problem of "I have a closet full of clothes but nothing to wear." By creating a digital inventory of your clothing items, you can easily see what you own, making it easier to plan outfits and rediscover forgotten pieces.
This application is built using a modern client-server architecture. The frontend is a JavaFX desktop application, which connects to a powerful and persistent PostgreSQL database running in a Docker container. This setup ensures a clean separation between the UI and the data layer, making the application robust and scalable.
This section provides a visual walkthrough of the application's current features.
The main entry point of the application, providing navigation to the three core sections: Wardrobe, Outfits, and Tags.
This is your digital closet. You can view all your clothing items, and each item is displayed as a card with its image and name.
From the wardrobe, you can navigate to the "Add Item" screen. Here, you can input the item's name, select its type (Top, Bottom, or Accessory), and upload a photo.
While adding an item, you can assign existing tags to better categorize your clothes.
By clicking on an item in the wardrobe, you can view its details, including a larger image and all associated tags.
The Outfits section allows you to create, view, and manage your outfits.
You can create a new outfit by selecting items from your wardrobe. As you add items, a thumbnail of the complete outfit is generated and displayed next to the "Create a New Outfit" button, giving you an instant preview. IF no thumbnail image is chosen, your outfit thumbnail will be defaulted to the first clothing item in the list.
Selecting an outfit from the list will show you all the clothing items that compose it.
You can easily add or remove items from an existing outfit to update its look.
Tags are a powerful way to organize your wardrobe. This section allows you to manage all your tags in one place.
You can create new tags, which become available to assign to any clothing item.
You can rename existing tags to keep your organization system consistent.
You can mark tags as "favorites," which can be used in the future to prioritize them in search or filter operations.
The application is built on a foundation of core Object-Oriented Programming (OOP) principles and established design patterns to ensure the codebase is modular, scalable, and easy to maintain.
- Encapsulation: Data (attributes) and the methods that operate on that data are bundled together within classes. Attributes are kept
private, and access is controlled through public methods (gettersandsetters), preventing direct, uncontrolled modification. This is seen in all model classes likeClothingItem,Outfit, andTag. - Inheritance: A class hierarchy is used to model the relationships between different types of clothing.
Top,Bottom, andAccessoryare specialized classes that inherit common properties and behaviors from a generalClothingItembase class. This promotes code reuse and establishes a clear "is-a" relationship. - Polymorphism: The application leverages polymorphism to treat different types of clothing items uniformly. For example, the wardrobe gallery can hold a collection of
ClothingItemobjects, which can be instances ofTop,Bottom, orAccessoryat runtime. This simplifies management and rendering of different item types. - Abstraction: The
ClothingItemclass isabstract, defining a common contract that all specific clothing types must follow, while hiding the complex implementation details of each one. This reduces complexity and allows the system to work with the general concept of a "clothing item" without needing to know the specifics of every type.
-
Model-View-Controller (MVC): This is the core architectural pattern used to structure the entire application.
- Model: The data layer, consisting of classes like
ClothingItem,Outfit, andTag. It represents the state of the application. - View: The presentation layer, defined by the
.fxmlfiles and styled with.css. It is responsible for everything the user sees. - Controller: The logic layer (
AddItemController,WardrobeController, etc.) that handles user input from the View and manipulates the Model. - Benefit: This separation makes the code highly organized and decoupled. Changes to the UI (View) do not require changes to the business logic (Model), and vice-versa, making development and debugging significantly easier.
- Model: The data layer, consisting of classes like
-
Singleton Pattern:
- Usage: This pattern is used multiple times to ensure a single, globally accessible instance for critical services. It is implemented in:
DatabaseManager: To manage a single database connection pool for the entire application.WardrobeService: To provide a centralized point for all wardrobe-related business logic.AuditService: To handle all action logging through one instance, preventing file access conflicts.
- Benefit: This prevents the creation of multiple, conflicting instances of services that manage shared resources (like database connections or files), ensuring consistent state and behavior.
- Usage: This pattern is used multiple times to ensure a single, globally accessible instance for critical services. It is implemented in:
-
Factory Pattern:
- Usage: The
UIFactoryclass is an explicit implementation of this pattern. It provides static methods to create complex, pre-styled UI components like image buttons and gallery thumbnails (createButton,createGalleryThumbnail). - Benefit: This encapsulates the complex logic of UI element creation. Instead of duplicating styling and layout code across multiple controllers, the application can now create consistent UI components with a single method call, making the code much cleaner and easier to maintain.
- Usage: The
-
Command Pattern:
- Usage: Actions like adding a new clothing item are encapsulated in a
Commandobject (AddClothingCommand). ACommandInvokeris responsible for executing these commands. - Benefit: This decouples the object that invokes an operation from the object that knows how to perform it. It makes the code cleaner and, more importantly, lays the groundwork for easily implementing features like Undo/Redo functionality in the future.
- Usage: Actions like adding a new clothing item are encapsulated in a
-
Utility Classes:
- Usage: The
SceneManagerclass is a prime example. It is afinalclass with a private constructor and only providesstaticmethods for handling a common, repeatable task: navigating between different scenes. - Benefit: This prevents code duplication across controllers. Instead of every controller having its own
navigateTomethod, they can all call the centralized, reusableSceneManager.navigateTo()method, which simplifies development and ensures navigation logic is consistent.
- Usage: The
- Comprehensive Wardrobe Management: Create, view, and organize your clothing items (Tops, Bottoms, Accessories) with custom attributes and images.
- Outfit Creation & Management: Combine your clothing items into custom outfits, complete with automatically generated or custom thumbnails. Add, view, and edit these outfits easily.
- Tagging System: Organize your wardrobe flexibly using tags. Create new tags, edit existing ones, and mark important ones as favorites. Assign these tags to any clothing item.
- Persistent Database Backend: Uses ORMLite and a PostgreSQL database running in Docker to ensure your data is safely stored and available between sessions. Images are saved locally.
- Modern User Interface: A clean, easy-to-navigate JavaFX interface styled with CSS, featuring a minimalist light theme with distinct, easy-to-use controls.
- Java - The core programming language.
- JavaFX - The modern GUI framework for the user interface.
- Maven - For project build management and dependencies.
- PostgreSQL - The relational database for data storage.
- Docker - For containerizing and managing the database service.
- ORMLite - For object-relational mapping between Java objects and the database.
To get a local copy up and running, follow these two main steps.
- JDK (Java Development Kit) - Version 17 or newer.
- Apache Maven - To build and run the JavaFX application.
- Docker Desktop - Must be installed and running on your system.
First, you need to start the PostgreSQL database. This command will pull the official Postgres image, start a container, and create a persistent volume to save your data even if the container is removed.
Open a terminal and run the following command. Choose a secure password and replace "your_password" with it.
docker run --name stylesimplified-db -d \
-e POSTGRES_PASSWORD=your_password \
-e POSTGRES_USER=wardrobe_user \
-e POSTGRES_DB=wardrobe \
-p 5432:5432 \
-v stylesimplified_pgdata:/var/lib/postgresql/data \
postgres--name stylesimplified-db: Gives the container a memorable name.-d: Runs the container in detached mode (in the background).-e: Sets environment variables for the database user, password, and name.-p 5432:5432: Maps the standard PostgreSQL port from your local machine to the container.-v stylesimplified_pgdata...: Creates a named volume to persist your database data.
To check if the container is running, use docker ps.
Before running the app, ensure your Java code is configured to connect to the database. The connection string in your WardrobeService or a similar configuration class should look like this:
String databaseUrl = "jdbc:postgresql://localhost:5432/wardrobe";
- Clone the repository:
git clone https://your-repository-url.com/StyleSimplified.git
- Navigate to the project directory:
cd StyleSimplified - Run the application using Maven:
This command will start the JavaFX application, which will then connect to your running Docker container.
mvn clean javafx:run
src/main/java/com/example/stylesimplified/: Main package root for all.javasource files.src/main/resources/com/example/stylesimplified/: Contains all non-code resources like.fxmland.css.wardrobe_images/: (Created at runtime) Stores copies of all uploaded clothing images.pom.xml: The Maven project configuration file, listing all dependencies (includingpostgresqlandormlite-jdbc).
- Advanced Filtering and Search:
- Filter tags by favorites and implement a search function within the tags list.
- Filter clothing items by type (Top, Bottom, Accessory), by assigned tags, and implement a robust text search in the wardrobe list.
- Implement filtering and text search for the outfits list.
- Favorite Outfits: Add the ability to mark entire outfits as favorites.
- AI-Powered Item Creation: Replace the manual input for specific clothing attributes (like waist rise, fit type, and length) with an API call to an online Large Language Model (LLM). This LLM will automatically analyze the item and fill in these details.
- Standardized Attributes: Refactor the specific clothing attributes to use predefined choices (e.g., dropdowns) instead of free text. This standardization is a crucial step towards building a robust recommendation engine.
- Smart Recommendations: Implement an outfit and item recommendation system. This will utilize:
- Analysis of the user's favorite outfits and tags.
- API calls to an online LLM for advanced, context-aware styling suggestions.










