____ ___ __ ____ ___ /\ _`\ /\_ \ /\ \__ /\ _`\ /\_ \ \ \ \L\ \//\ \ __ \ \ ,_\ __ \ \ \L\ \ __ \//\ \ \ \ ,__/ \ \ \ /'__`\ \ \ \/ /'__`\ \ \ ,__/'__`\ \ \ \ \ \ \/ \_\ \_/\ \L\.\_\ \ \_/\ __/ \ \ \/\ \L\.\_ \_\ \_ \ \_\ /\____\ \__/.\_\\ \__\ \____\ \ \_\ \__/.\_\/\____\ \/_/ \/____/\/__/\/_/ \/__/\/____/ \/_/\/__/\/_/\/____/
Are you hungry and willing to cook today? Do you have a lot of ingredients in your fridge but don't know what to cook? Do you want to try something new? Plate Pal is here to help you! Plate Pal is a recipe organizer that helps you to find recipes based on the ingredients you have. It also allows you to save your favorite recipes and share them with your friends. Plate Pal is your culinary partner! In the heart of every kitchen lies not just ingredients and utensils, but cherished recipes that tell stories of family gatherings, beloved traditions, and adventurous culinary experiments. A Recipe Organizer serves as the guardian of these culinary treasures, offering a dedicated space to compile, categorize, and curate every dish that holds meaning. Whether you're a seasoned chef or a budding cook, this tool ensures that your recipes are easily accessible, neatly organized, and preserved for generations to come. Dive into the world of organized cooking and let your flavors tell their tales!
Recipe Storage: Store all your favorite recipes in one repository (We can call it Favorites).
Searching: Find recipes based on ingredients, name, or other keywords.
Recipe Creation: Create your own recipes and store them in the repository.
Recipe Deletion: Delete recipes from the repository.
Recipe Editing: Edit your recipes and update them in the repository.
Daily Specials: Get recommendations for popular recipes.
To say thanks for sharing your time and knowledge, for every 50 dishes you cook, we will plant a tree in your honor.
To run our software, simply execute the Main.java
file. This is the primary entry point of our application. Follow these steps to get started:
src/app/Main.java
file in the project explorer.Main.java
file and select Run 'Main.main()'
to start the application.If you encounter any issues, please do not hesitate to contact us via email for assistance. Our support team is always ready to help. You can find our contact information in the 'About Us' section of this document.
##################### Development Plan ######################
Discarded API
We have identified an API that can be utilized for our project. The details and endpoint can be accessed at Recipe - Food - Nutrition API.
Here's the screenshot of using a tool to try out the API:
I also test the example output of running my Java code:
API Ninjas
After comparing several APIs, we decided to use the API Ninjas for our project. The reason is that the Ninja API provides more information about the recipes, including the ingredients, instructions, nutrition, and calories. It also provides more endpoints for us to use. The Ninja API is also easier to use and has a better user interface.
Hooray! We have successfully solved the problems and can use the APIs in our project.
In our software design, we apply Clean Architecture. The following diagram shows the relationship between the entities in our project.
Preliminary Diagram Design
Based on the entities, we can draw the following UML Diagram:
Final Diagram Design
Here are two examples of the UML Diagrams we have designed for our project.
createRecipe
use case:
The architecture ensures communication between higher and lower-level modules via abstractions and has better independence, maintainability, and flexibility.
Cooked
use case:
The process demonstrates Clean Architecture, with distinct roles for the UI, Controller, Interactor, DataAccessObject, and Presenter, promoting maintainability through clear interfaces and following the Single Responsibility Principle (SRP).
Design Pattern
Now, let me introduce how we apply the Observer Design Pattern in our program. For example, when the user does an action, assume it triggers a series of operations in the ViewWarehouseViewModel, including setting the state and firing a property change. 'Set state' updates the ViewWarehouseState, while 'fire property change' go through this way notifies observers that their state has changed. This is particularly relevant for the WarehouseView, which implements the PropertyChangeListener interface. After receiving this notification, the WarehouseView responds to the event, typically by calling getDataAndDisplay to update the user interface. Through this strategy, we ensure that the ViewModel, as the publisher, can effectively notify about state changes without directly interacting with the observer. This allows the WarehouseView, acting as a listener, to always display the latest recipe information. As a result, every time a user visits the warehouse, they are presented with the most updated and comprehensive list of recipes.
In addition to this, we also used the strategy design pattern. We want the program to have some predefined recipes to serve, partly from local database and partly from the recommendation of the API. In order to achieve this, Main calls the methods of Context. like this, to create predefined recipe. The strategy pattern allows our "Context" class to choose dynamically which algorithms to execute without having to implement those algorithms inside the class, Specifically, the "LocalStrategy" provides access to a local database, while the "APIStrategy" provides access to the latest globalized recipes via an API. Both strategies implement the "Strategy" interface, which ensures the consistency of behavior between different strategies. In this way, every time the user open or update our application, they can get the most updated and popular recipes from local database and API.
Organization
Our directory structure adopts a 'layered' approach, enhancing modularity and clarity. Each layer focuses on specific functionalities, improving maintainability. The code is well-organized and uses camel case naming for better readability. Modular design facilitates testing and reduces code coupling. Documentation and comments elucidate decisions, aiding team understanding and increasing collaborative efficiency