This is a Flask web application for organizing and managing your kitchen ingredients and finding appropriate recipes based on those ingredients. The application allows users to perform OCR (Optical Character Recognition) on receipts to extract food items, manage their ingredients, and search for recipes.
-
User Registration and Login
- Users can register for an account with a unique username and a secure password.
- Existing users can log in to their accounts.
- Passwords are securely hashed and stored in the database.
-
Password Change
- Logged-in users can change their passwords securely.
-
Ingredient Management
- Users can upload a receipt image.
- The application performs OCR on the receipt to extract food items.
- Users can view the extracted food items and their expiry dates.
- Ingredients are associated with the user's account for future reference.
-
Recipe Search
- Users can search for recipes based on the ingredients they have stored.
- The application retrieves recipes using the Spoonacular API, providing detailed instructions and information about the recipes.
- Expiry dates of ingredients are obtained (as a heuristic at the moment), from the OpenAI API.
Before running the application, make sure you have the following installed (If the pip command below does not work):
- Python 3.x
- Flask
- Flask-Session
- Requests
- SQLite3
- Werkzeug
As the application is currently in development, if you wish to use it, please provide your own OpenAI API key. I am not currently on a paid plan, and therefore do not wish to exceed my rate limit. Once obtained, please go into helpers.py and in the ExpiryDate
function, put in your API in the openai.api_key
section.
-
Clone the repository to your local machine.
-
Install the required packages:
pip3 install -r requirements.txt
-
Run the application:
python app.py
or
flask run
-
Access the application in your web browser at http://localhost:5000/., or click on the link that appears on the terminal after you run the program.
-
Registration and Login
- Register for an account or log in with your existing credentials.
-
Uploading a Receipt
- On the homepage, you can upload a receipt image.
- The application will extract food items from the receipt using OCR.
-
Managing Ingredients
- View the extracted food items and their expiry dates on the homepage.
- Ingredients are associated with your account.
-
Searching for Recipes
- Click on an ingredient to view recipes that use that ingredient.
- The application retrieves recipes from the Spoonacular API and displays step-by-step instructions and recipe information.
-
Changing Password
- If you are logged in, you can change your password by navigating to the "Change Password" page.
-
Logging Out
- To log out of your account, click the "Logout" button.
This project was created with Flask, SQLite, the Spoonacular API and OpenAI API.