A Java-based recipe recommendation app that fetches recipes based on ingredients you have and displays them using a beautiful JavaFX UI.
- Search for recipes based on available ingredients
- Fetch recipes from a third-party API (e.g., Spoonacular API)
- Display recipe titles and details in a user-friendly JavaFX interface
- Filter recipes based on the ingredients you provide
- Java 11 or higher
- Maven
- Dependencies:
- OkHttp for HTTP requests
- Gson for JSON parsing
- JavaFX for the UI
git https://github.com/SauravSreejith/bitebuddy.git
cd bitebuddyTo use the app, you will need to register for an API key from one of the following recipe APIs:
Once you have an API key, replace the YOUR_API_KEY placeholder in RecipeService.java with your actual API key.
mvn clean installmvn javafx:run- Launch the app.
- Enter a list of ingredients in the search box (e.g.,
tomato, cheese, pasta). - Click the Search Recipes button.
- The app will display a list of recipes based on the ingredients.
βββ src
β βββ main
β β βββ java
β β β βββ RecipeApp.java # Main JavaFX Application class
β β β βββ RecipeService.java # Handles API requests
β β β βββ RecipeParser.java # Parses API responses
β β β βββ Recipe.java # Recipe model class
β βββ resources
β βββ styles.css # Styles for the JavaFX UI
βββ pom.xml # Maven dependencies and plugins
βββ README.md # Project documentation
In your pom.xml, ensure you have the following dependencies:
<dependencies>
<!-- OkHttp for making HTTP requests -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.3</version>
</dependency>
<!-- Gson for parsing JSON responses -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.8</version>
</dependency>
<!-- JavaFX for the user interface -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.1</version>
</dependency>
</dependencies>This project is licensed under the MIT License - see the LICENSE file for details.