Giter VIP home page Giter VIP logo

recipe-tandemonium's Introduction

Welcome to Recipe Tandemonium!

This started as a coding challenge and then I challenged my self to take a step further.

Run the App

Simply run yarn install on the root folder then run yarn start

Design

A freecodecademy.org course from a couple years back was my inspiration behind the design and template of the app, using create-react-app for the initial creation.

Data

A static query for taco is done with an api call to originally grab taco recipes and save them in a state to be used to pass down to other component. We also load the recipes into localStorage.

Dietary Restrictions

I used an online JSON creator -- http://www.objgen.com/, except a very cool plugin for vegan I found.
My assumptions for dietary restrictions:
* Dairy-free
* Nut-free
* Gluten-free
* Halal
* Vegan, Vegetarian - https://github.com/hmontazeri/is-vegan

{
  "Dairy-Free": [
    "milk",
    "sour cream",
    "soured cream",
    "butter",
    "cheese"
  ],
  "Nut-Free": [
    "peanut",
    "almond",
    "walnut",
    "pecan",
    "cashew"
  ],
  "Halal": [
    "pork"
  ],
  "Gluten-Free": [
    "flour",
    "wheat",
    "couscous"
  ]
}

Components

The following are the components I choose to create. I use the naming convention, name.type.extension. The idea is that I would use .connect.js later on for Redux storing data states globally instead of using localStorage.

Recipe

I used the react-router to properly retrieve router each recipe to its own page to based on the title. Based on the title of the another call to the api is made to grab the recipe.

Recipes

This takes a list of recipes and displays it on the page. Simple as that. :-)

SearchRecipes

This is the parent component for searching. Which passes the getRecipe state back to the Root component to render on the page.

DietaryRestrictions

This is where we build the identification for each recipe's dietary restrictions. This function was written so that it could be use anywhere within the app for checking the ingredients of a recipe based on the dietary restriction.

Further Developments & Issues

Finish the app

I did not implement the easy swapping of APIs but I would have implemented a simple component and view for a user to switch between a few APIs. The even more advanced implement would be to create a component that can interpret different API and retrieve their ingredients to find taco recipes. You can most like do something like this with the purchase an api that would provide extra support and functionality.

Where I struggled

  • With the dropdown filter, located in the SearchRecipes component, you will in the console log that I am grabbing the correct list of recipes based on the api query, but I failed to implement the proper way to render that and send it back to the Recipes Component. I think redux may be the more efficient way to hand this and not local storage which caching and such can come into play.

  • I had some trouble using the isVegan plugin and ran out of time to implement this into the filter isVegan Error

  • I did not use redux because I did not have the confidence to use at this time.

Final Thoughts

Thank you for checking out my repository. ๐Ÿ‘จ๐Ÿพโ€๐Ÿ’ป๐ŸŒฎ

recipe-tandemonium's People

Contributors

kevindennyii avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.