Skip to content

TriTacLe/NTNU-IDI-IDATT1003-mappe-del-1-2024-TriTacLe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grade A

Portfolio Project - IDATT1003

STUDENT NAME = "Tri Tac Le"
STUDENT ID = "10082"


Project Description

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.


Project Structure

Source Files 📁:

  • Located in the src/main/java directory.
  • The primary package is edu.ntnu.idi.idatt1003, encompassing classes like IngredientManager, RecipeBook, and MainApp.

Packages 📦:

  • model: Defines core entities such as Ingredient, Recipe, and Storage.
  • 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.

JUnit Test Classes:

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


Link to Repository

GitHub Repository - IDATT1003 Portfolio Project


How to Run the Project

Open the Project :

  1. Launch IntelliJ IDEA.
  2. Select File > Open and navigate to the project's root directory.

Ensure Maven is Configured ⚙️:

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

Build the Project :

  1. Open the Maven tool window by selecting View > Tool Windows > Maven.
  2. In the Maven tool window, expand the project and navigate to Lifecycle.
  3. Double-click on clean, compile, and then install to build the project.

Run the Application :

  1. Locate the main class of your application (the class containing the main method).
  2. Right-click on the main class file and select Run 'MainClass'.

Input and Output :

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

Expected Behavior:

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

How to Run the Tests

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

Run Specific Test:

  • To run a specific test, right-click on the test class or method in the FoodStorageTest.java file and select Run 'FoodStorageTest'.

References 🔗

References are included in the project report.

About

idatt1003-mappe-del-1-2024-TriTacLe created by GitHub Classroom

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%