FoodAllergenWatch is a web-based application designed to help users identify potential allergens in recipes from various cuisines. It scrapes recipes from popular websites and uses APIs to provide a comprehensive analysis of allergen presence by dish and country.
- Search for Recipes: Find recipes by dish name and country of origin.
- Allergen Detection: Identify common allergens (e.g., nuts, gluten, dairy) in recipes.
- Data Analysis: View the percentage of recipes containing specific allergens by country and dish.
- User-Friendly Interface: Simple and intuitive web interface for easy navigation and search.
FoodAllergenWatch/ ├── app/ │ ├── init.py │ ├── models.py │ ├── routes.py │ ├── utils.py │ ├── static/ │ │ ├── css/ │ │ │ └── styles.css │ │ ├── js/ │ │ │ └── scripts.js │ ├── templates/ │ │ └── index.html ├── scrapers/ │ ├── init.py │ ├── scraper_allrecipes.py │ ├── scraper_epicurious.py │ ├── scraper_seriouseats.py ├── data/ │ ├── init.py │ ├── fetch_edamam.py │ ├── fetch_tasty.py ├── migrations/ ├── venv/ ├── config.py ├── run.py ├── requirements.txt ├── .env └── LICENSE.md └── README.md
- Python 3.8+
virtualenv
- PostgreSQL (or any other SQL database)
-
Clone the repository:
git clone https://github.com/yourusername/FoodAllergenWatch.git cd FoodAllergenWatch
-
Set up a virtual environment:
bash
virtualenv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set up your .env file with the necessary environment variables:
SECRET_KEY=your_secret_key DATABASE_URL=your_database_url EDAMAM_API_KEY=your_edamam_api_key SPOONACULAR_API_KEY=your_spoonacular_api_key
-
Initialize the database:
```flask db init ```flask db migrate -m "Initial migration." ```flask db upgrade
-
Start the Flask development server:
```python run.py
-
Open your browser and navigate to http://127.0.0.1:5000 to use the application.
-
Install the Vercel CLI:
```npm install -g vercel
-
Log in to Vercel:
```vercel login
-
Create a vercel.json configuration file in your project root:
{ "version": 2, "builds": [ { "src": "run.py", "use": "@vercel/python" } ], "routes": [ { "src": "/(.*)", "dest": "/run.py" } ] }
-
Deploy the application:
```vercel
-
Follow the prompts to complete the deployment. Once deployed, Vercel will provide you with a URL where you can access your application.
Enter the name of a dish and the country of origin in the search form.
Click "Search" to see the list of potential allergens found in recipes for that dish.
Contributions are welcome! Please follow these steps:
1. Fork the repository.
2. Create a new branch (git checkout -b feature-branch).
3. Make your changes.
4. Commit your changes (git commit -am 'Add new feature').
5. Push to the branch (git push origin feature-branch).
6. Create a new Pull Request.
This project is licensed under the Cooperative Non-Violent Public License v4. See the LICENSE file for details.
Thanks to the providers of the recipe data and APIs used in this project.
Thanks, as well, to Aayush (a.k.a. [Divide-By-0](https://github.com/Divide-By-0/)) for the [project idea.](https://aayushg.com/ideas)
Inspired by the need for better food allergen awareness.