If you want to run this code locally, just make sure you have Ruby on Rails, and then install the gems in the Gemfile (with bundle install –without production), and then run “rake db:reset”. Then just run “rails s” in the root directory
Note: You will need to install ImageMagick, which is a dependency for one of the gems.
To install ImageMagick on Mac OS X with MacPorts, just type:
sudo port install ImageMagick
If you don’t have MacPorts, you can get it here:
https://www.macports.org/
Be sure to run db:reset so some sample ingredients and a few sample recipes can get seeded into the database. These are already seeded on heroku. Users can only add pre-existing ingredients to their pantries. The list of valid ingredients for this iteration can be found below. Along with the recipe and ingredient seeds, there is also seeded user with username: “test@example.com” password: “password”. This user already has “salt” and “pepper” as ingredients added in their pantry - feel free to add more or just check out the roulette feature immediately.
If you want to run the all tests (unit + functional + UI) tests locally, just type:
rspec
To run only UI tests, type:
rspec . --tag type:feature
If you want to see our code on production, go here:
http://reciperoulette.herokuapp.com/
Enjoy!
When you first open the app, you should be directed an empty page. On the top right will find two links: sign up and login. You can choose to make your own account or log in with an existing one (such as the one mentioned above). Once logged in, you will see a dashboard page.
On the left side, you will see a panel that allows you modify your pantry. You can enter your desired ingredient into the text box and a list of valid ingredients are suggested below it. When ready to add the ingredient to your pantry, you can click the ‘Add Ingredient’ button. It should then appear in your pantry. If you try to add an ingredient that isn’t included in the database, you will be prompted with an option that will allow you to create that ingredient for the first time.
Below the text box is the list of ingredients that already exist in your pantry. You can remove an ingredient by clicking on the ‘X’ to the right of the ingredient name. You can mark an ingredient as ‘Active’ for your roulette search (explained in the ‘Roulette’ section below) with the check box to the left of the ingredient name. Marking no check boxes is the same as marking all the check boxes. You can also organize your pantry by dragging and dropping the ingredients.
On the right side of the dashboard, you will see a panel with a list of recipes you have saved in the past. Clicking on the name of a recipe will bring you to the page for that recipe. How to save recipes is explained below in the ‘Recipe’ section. You can delete or refer to recipes that you’ve saved.
At the bottom of the dashboard, you will find a series of check boxes under the header ‘Recipe Filters’ as well as a button labeled ‘Play Roulette’. Marking a check box will permit recipes of that type to appear in the roulette search. Marking no check boxes in the same as marking all the check boxes. To find new recipes, click on the ‘Play Roulette’ button! See the ‘Roulette’ section below.
Roulette search uses the list of your active ingredients and selected tags to find matching recipes. You do not need to have all the ingredients in a recipe for it to show up, but at least one of the tags in the recipe must have been selected.
On the roulette pages, you can see a recipe, a ‘Block’ button and a ‘Skip’ button. Clicking on the image of the recipe will send you to that recipe’s page (see ‘Recipe’ section). Clicking on ‘Block’ will prevent that recipe from appearing again in your future roulette searches and will load a new recipe on your roulette page. Clicking on ‘Skip’ will load a new new recipe on your roulette page, and the recipe may appear in your future roulette plays.
The border around the recipe indicates how many of the recipe’s ingredients are present in your active ingredients list. Its color ranges from red (indicating very few matching ingredients) to green (indicating mostly matching ingredients).
On the recipe page you can see all the information about your recipe: its name, an image, its preparation and cooking time, the ingredients and the instructions. The ‘Block’ button from the roulette pages is also present and has the same functionality except it sends you back to your dashboard page instead of a new roulette page. The ‘Save’ button allows you to save this recipe to your saved recipes list for future viewing.
salt, pepper, egg, rice, tomato, sour cream, spinach, bell pepper, ham, onion, carrot, sugar, cinnamon, ketchup, mustard, garlic, paprika, oregano, olive oil, vegetable oil, honey, soy sauce, tuna, basil, cheese, lemon, lime, chicken breast, ground beef, ground turkey, bacon, corn, butter, spaghetti, parsley, mayonnaise, cornstarch, lamb, steak, ginger, potato, thyme, milk, noodles, bay leaf, whole chicken, celery, tomato sauce, tortilla, syrup, bread, avocado, pork, lettuce, bbq sauce
Roast Chicken, Scrambled Eggs, Spaghetti, Chicken Fajitas, Quesadilla, French Toast, Ham and Egg Fried Rice, Avocado BLT, Pulled Pork Sandwhich, Mashed Potatoes, Chicken Pot Pie, Chicken and Dumpling Soup