Skip to content

Rosca-Teodora/StyleSimplified

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StyleSimplified

A simple and elegant desktop application built with JavaFX to help you digitize and manage your personal wardrobe, powered by a containerized PostgreSQL database.


Table of Contents


About The Project

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.

Application Showcase

This section provides a visual walkthrough of the application's current features.

1. Home Page

The main entry point of the application, providing navigation to the three core sections: Wardrobe, Outfits, and Tags.

Home Page

2. The Wardrobe

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.

Wardrobe Page

Adding a Clothing Item

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.

Add Clothing Item

Adding Tags to an Item

While adding an item, you can assign existing tags to better categorize your clothes.

Adding Tags to an Item

Viewing a Clothing Item

By clicking on an item in the wardrobe, you can view its details, including a larger image and all associated tags.

3. Outfits

The Outfits section allows you to create, view, and manage your outfits.

Outfits Page

Creating a New Outfit

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.

Create Outfit

Viewing an Outfit

Selecting an outfit from the list will show you all the clothing items that compose it.

Outfit View

Editing an Outfit

You can easily add or remove items from an existing outfit to update its look.

Edit Outfit

4. Tags

Tags are a powerful way to organize your wardrobe. This section allows you to manage all your tags in one place.

Tag Page

Adding a New Tag

You can create new tags, which become available to assign to any clothing item.

New Tag Container

Editing a Tag

You can rename existing tags to keep your organization system consistent.

Editing Tag

Favoriting a Tag

You can mark tags as "favorites," which can be used in the future to prioritize them in search or filter operations.

Architectural Design

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.

Core OOP Principles

  • 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 (getters and setters), preventing direct, uncontrolled modification. This is seen in all model classes like ClothingItem, Outfit, and Tag.
  • Inheritance: A class hierarchy is used to model the relationships between different types of clothing. Top, Bottom, and Accessory are specialized classes that inherit common properties and behaviors from a general ClothingItem base 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 ClothingItem objects, which can be instances of Top, Bottom, or Accessory at runtime. This simplifies management and rendering of different item types.
  • Abstraction: The ClothingItem class is abstract, 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.

Design Patterns

  • 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, and Tag. It represents the state of the application.
    • View: The presentation layer, defined by the .fxml files 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.
  • 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.
  • Factory Pattern:

    • Usage: The UIFactory class 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.
  • Command Pattern:

    • Usage: Actions like adding a new clothing item are encapsulated in a Command object (AddClothingCommand). A CommandInvoker is 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.
  • Utility Classes:

    • Usage: The SceneManager class is a prime example. It is a final class with a private constructor and only provides static methods for handling a common, repeatable task: navigating between different scenes.
    • Benefit: This prevents code duplication across controllers. Instead of every controller having its own navigateTo method, they can all call the centralized, reusable SceneManager.navigateTo() method, which simplifies development and ensures navigation logic is consistent.

Features

  • 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.

Built With

  • 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.

Getting Started

To get a local copy up and running, follow these two main steps.

Prerequisites

  • 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.

1. Running the Database Container

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.

2. Running the Application

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";

  1. Clone the repository:
    git clone https://your-repository-url.com/StyleSimplified.git
  2. Navigate to the project directory:
    cd StyleSimplified
  3. 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

Project Structure

  • src/main/java/com/example/stylesimplified/: Main package root for all .java source files.
  • src/main/resources/com/example/stylesimplified/: Contains all non-code resources like .fxml and .css.
  • wardrobe_images/: (Created at runtime) Stores copies of all uploaded clothing images.
  • pom.xml: The Maven project configuration file, listing all dependencies (including postgresql and ormlite-jdbc).

Future Improvements

  • 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.

About

A Java application that manages, organizes and recommends different outfits based on the clothes and styles added and chosen by the user

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors