STUDENT NAME = "Tri Tac Le"
STUDENT ID = "10082"
This Java-based application, developed using Maven, assists users in efficiently managing their food ingredients and recipes 🥕. Key features include:
- Ingredient Management: Add, remove, and list ingredients with specified quantities and expiration dates, helping to minimize food waste 📅.
- Recipe Management: Create and store recipes in a digital cookbook, associating them with specific ingredients 🧑🏽🍳.
- Recipe Suggestions: Recommend recipes based on the ingredients currently available in storage, facilitating convenient meal planning.
The application employs Java's robust libraries and Maven for dependency management, ensuring a user-friendly and efficient experience. Its modular design allows for future enhancements, such as database integration or the addition of a graphical user interface.
- Located in the
src/main/java
directory. - The primary package is
edu.ntnu.idi.idatt1003
, encompassing classes likeIngredientManager
,RecipeBook
, andMainApp
.
model
: Defines core entities such asIngredient
,Recipe
, andStorage
.repository
: Manages data persistence for ingredients and recipes using in-memory storage.service
: Contains business logic, including ingredient validation and recipe recommendations.ui
: Implements the text-based user interface (TUI).util
: Provides utility classes for input validation and data initialization.
- Stored in the
src/test/java
directory, mirroring the source package structure. - Includes test cases for models, services, and repository classes to ensure functionality and reliability.
This organization adheres to the standard Maven project layout, promoting maintainability and scalability.
GitHub Repository - IDATT1003 Portfolio Project
- Launch IntelliJ IDEA.
- Select File > Open and navigate to the project's root directory.
- IntelliJ IDEA should automatically detect the
pom.xml
file and configure the project as a Maven project. - If not, right-click on the
pom.xml
file and select Add as Maven Project.
- Open the Maven tool window by selecting View > Tool Windows > Maven.
- In the Maven tool window, expand the project and navigate to Lifecycle.
- Double-click on
clean
,compile
, and theninstall
to build the project.
- Locate the main class of your application (the class containing the
main
method). - Right-click on the main class file and select Run 'MainClass'.
- Input: The program reads recipes from a file. The file should contain recipes formatted with the recipe name, ingredients, instructions, and the number of servings.
- Output: The program outputs the recipes to the console or saves them to a file with proper formatting.
- The program should load recipes from a specified file, parse the content, and store the recipes in a structured format.
- It should handle file operations such as reading from and writing to files.
- The program should log any errors encountered during file operations.
- The recipes should be displayed or saved with proper formatting, ensuring readability.
- To run your tests, you can use the Maven tool window. Ensure Maven is installed as a plugin in IntelliJ.
In the Maven tool window, navigate to Lifecycle and double-click on
test
.
- To run a specific test, right-click on the test class or method in the
FoodStorageTest.java
file and select Run 'FoodStorageTest'.
References are included in the project report.