This is a Flask-based web application where users can browse, search, and manage Korean recipes. The app scrapes Korean recipe titles from a CNN article and automatically fetches the related YouTube cooking video with the highest views. Users can upload images, edit, delete, and export recipe data, making it a comprehensive tool for discovering and organizing Korean dishes.
- Explore a curated list of Korean recipes automatically gathered from a trusted source.
- Watch the most relevant YouTube cooking video for each recipe directly from the app.
- Search and filter through the recipes using keywords.
- Upload their own images for recipes.
- Edit or delete existing recipes to keep their collection up-to-date.
- Export their saved recipe data for offline use or sharing.
- Enjoy a smooth and efficient experience thanks to rate-limiting features that optimize performance.
- 🔍 Web Scraping: Extracts Korean recipe titles from a CNN article.
- 🎧 YouTube API Integration: Fetches relevant cooking videos based on the recipe title.
- 🏢 PostgreSQL Database: Stores scraped data and YouTube metadata.
- 🎨 Image Upload: Allows users to upload images for recipes.
- ✏️ Edit & Delete Recipes: Modify or remove saved recipes.
- 📌 Pagination & Search: Easily browse and find recipes.
- ⏳ Rate Limiting: Prevents excessive API requests and ensures smooth performance.
- 📂 Data Import/Export: Supports bulk data operations.
- Backend: Flask, Flask-SQLAlchemy
- Database: PostgreSQL
- API Integration: YouTube Data API v3
- Other: Python-dotenv for environment variables
git clone https://github.com/ChasVanDav/KoreanRecipeApp.git
cd KoreanRecipeApp
python -m venv venv
# Activate virtual environment:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Create a .env
file in the root directory and add:
YOUTUBE_API_KEY=your_youtube_api_key_here
DATABASE_URL=postgresql://your_username@localhost/your_database_name
Restore the database from the provided dump file. Run this command:
pg_restore -h localhost -U postgres -d target_database_name -F c path_to_database_dump.sql
python init_db.py
python app.py
Access the app at: http://127.0.0.1:5000/
🍔 Fork the repository
🌱 Create a new branch
git checkout -b feature-branch
📂 Commit your changes
git commit -m "Added new feature"
🚀 Push to the branch
git push origin feature-branch
🔥 Open a Pull Request
This project is licensed under the MIT License.
This project has taught me so much and has helped me grow as a developer in many ways. As you have seen earlier in this document, this project packs A LOT including webscraping, API routes, options to upload images, export data as a CSV file, pagination, and much more. One of my proudest moments often happened late into the night after spending hours debugging. Setting up the Youtube API route was probably the most difficult and happiest aspect of this project. My least favorite was tussling with pagination and testing. All in all, it was a really great experience to see what I could do and how quickly I could adapt to new and evolving requirements.
The deployment process was another aspect of this project that was a bit trying but so satisfying once I got this website live. I decided to use Render after debating between AWS and Heroku - these are the top options for deploying a full stack app with a database. I started the process with AWS, but quickly looked for another option as the set up had so many options at each step I felt in over my head. Heroku seemed to be similar to Render. However, Render was the option that was the most user friendly for deploying my website. I guess it would be worth it to decipher AWS deployment if I needed more control over various aspects of deployment.
There were two parts to the deployment process:
- Web service
- Database Instance (PostgreSQL)
Web service deployment is pretty straightforward as Render connects directly to your Github repository. I just needed to add the necessary environment variables and update the build and deploy commands. This is where I learned about gunicorn 🦄!
Database deployment was where I was having the most trouble. I was struggling to wrap my head around the following facts:
- Render creates its own environment variables for the database instance.
- This environment variable needs to be copy/pasted to the web service environment variables (NOT LOCAL DATABASE VALUES 🙄)
- The database instance is EMPTY! --> So I needed to do a
pg_restore
to populate the data in my local database into this instance.
Once, I figured all of that out, it was good to go and I felt so accomplished!
That pretty much sums up the lovely roller coaster that is developing. I enjoyed this one and will be working more on it when I have free time, to make it better! I have several stretch goals, including adding users, ingredient list, including AI to pick a Korean recipe based on the ingredients you already have, and much more. Feel free to contribute, I would love that!
Thanks for reading my stream-of-consciousness!✨