To set up and run the application using Docker, follow these steps:
-
Install Docker and Docker Compose:
-
macOS and Linux:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker compose version -
Windows: Download and install Docker Desktop from Docker's official website.
-
-
Build and start the containers:
docker compose up --build
-
Access the application:
- Frontend: http://localhost:3000
- Backend: http://localhost:5000
To set up the application using a virtual environment, follow these steps:
-
Navigate to the backend directory:
cd recipe-search/src/backend -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run the backend server:
python3 run_app.py
To set up the frontend, follow these steps:
-
Download and install Node.js from nodejs.org.
-
Navigate to the frontend directory and install dependencies:
cd recipe-search npm install -
Run the frontend server:
npm start
This web app requires some initial data collection to work. There's a script that does this for a predetermined corpus of web data (which takes around 30 minutes to complete) and saves the data to a JSON file, which the app then accesses when running.
-
Run the crawler:
python3 crawler.py
-
Filter Recipes: Start at
binary_filter.py, where it will filter recipes by only including desired cultures and exclude any ingredients the user inputs. The output will be infiltered_recipes.json. -
Rank Recipes: Next,
vsm.pywill rank the filtered recipes fromfiltered_recipes.jsonbased on a query of form{ingredient: rating, ingredient: rating, ...}by using cosine similarity. The output of the VSM will be inranked_recipes.json.
The main components are the exclude_ingredient_list and cuisine_list in binary_filter.py and the query in vsm.py. These can be modified, but it may not give good results as we will limit what selections will work when designing the UI.
Make sure you are in the recipe-search directory. Then, to run the frontend, do:
npm start