This is a Flask-based web application that allows users to search for recipes using the Spoonacular API. Users can search for recipes by keywords, view detailed recipe information, and get cooking instructions.
- Search for recipes using keywords.
- View a list of matching recipes with brief details.
- Click on a recipe to view detailed information, including ingredients and instructions.
- Python: Ensure you have Python 3.7+ installed.
- Spoonacular API Key: Sign up at Spoonacular to get your own API key.
-
Clone this repository:
git clone https://github.com/prajwal032004/recipe-finder-app.git cd recipe-finder-app -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Replace the
API_KEYinapp.pywith your Spoonacular API key:API_KEY = 'your_spoonacular_api_key'
-
Run the Flask application:
python app.py
-
Open your browser and navigate to:
http://127.0.0.1:8000 -
Use the search bar to find recipes or click on a recipe to view more details.
Path: /home
Method: GET
Renders the homepage with an empty search query and no recipes displayed initially.
Path: /
Method: GET, POST
- POST: Handles recipe search queries submitted via the search form and fetches matching recipes.
- GET: Displays recipes based on the
search_queryparameter or an empty search if none is provided.
Path: /recipe/<int:recipe_id>
Method: GET
Fetches detailed information about a specific recipe using its recipe_id and displays the details along with cooking instructions.
- app.py: The main application file containing routes and logic.
- templates/: Contains HTML templates for rendering pages.
index.html: The homepage template for search and results.view_recipe.html: Template for detailed recipe information.
- static/: (Optional) Add static files like CSS or JavaScript here.
The dependencies are listed in requirements.txt. Install them using pip install -r requirements.txt.
Include screenshots of the app (search page and recipe details page) for better understanding.
This project is licensed under the Self License. See the LICENSE file for details.
Make sure to get your own API key from Spoonacular and replace the placeholder in app.py.
Happy Coding!