GithubHelp home page GithubHelp logo

aafmisra / rapid-recipe Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.71 MB

Rapid Recipe: a React app for Project 2 of GA SEI

Home Page: https://rapid-recipe.herokuapp.com/

HTML 5.18% JavaScript 82.06% CSS 12.76%

rapid-recipe's Introduction

Rapid-Recipe 🍲 πŸ› 🍝

About This App

Rapid Recipe search page

I love to cook. My father is from India, and thanks to him I have tried and learned how to cook many different cuisines. My partner, on the other hand, knows how to cook about 5 things and most of them involve pasta. Rapid Recipe is for both of us.

Even though I love cooking, I often find myself making the same dishes over and over, either out of convenience or because it's just too much work to go looking for new recipes on the internet. It's hard to do when you don't know what you want to eat. I made Rapid Recipe because it was something I really wanted to exist. Now, when my partner and I meal plan, we can use Rapid Recipe to find new dishes using ingredients we already have.

Planning

User stories

Who will use Rapid Recipe?

Everyone eats, so Rapid Recipe should be usable for as many people as possible.

Why will they use it?

Anyone who already loves cooking and wants to add variety. Anyone who is learning to cook and wants to try new things. Budget conscious people who want to make delicious things using what they already have. Anyone with an allergy or diet restriction who needs safe recipes.

What is Rapid Recipe?

It is an app that allows users to input ingredients to search for recipes in Edamam's database.

Notes and wireframes

Rapid Recipe Wireframe This wireframe shows my vision for a landing page with a simple design, with search form and results gallery components.

Rapid Recipe Component Hierarchy This chart illustrates the planned organization of the app's components, and where I will manage state and props.

Bronze, Silver, Gold, Platinum plans

Bronze (MVP)

  • Built with React
  • Includes data from Edamam Recipe Search API
  • Uses at least 4 separate components
  • Deployed using Heroku
  • Uses flexbox or CSS grid for layout
  • Allows users to search recipes with ingredients to include
  • Allows users to search recipes with ingredients to exclude
  • Allows users to search recipes with health-conscious options

Silver

  • Fully responsive
  • Feature that allows users to generate a shopping list of ingredients they need to buy for each recipe so they don’t have to create it manually

Gold

  • Bookmark feature, so users can come back to recipes later or make them again
  • Feature that allows users to write and store their own recipes

Features

Search

Users can input ingredients they want to include in their recipe, as well as ingredients to exclude. In addition, they can choose from an extensive list of dietary filters like vegan, keto, and low-carb to find meals that fit their dietary restrictions.

Bookmark

Users can click a bookmark icon on any recipe they find, and it will get added to their "My Recipes" section. These recipes are saved client-side using local storage, so the bookmarks persist between browser sessions without a login. Users can also remove recipes from their bookmarked section.

Grocery List

Each recipe card also has an "Add to Grocery List" button. When the user clicks it, that recipe's ingredients are added to the "My Groceries" section. On that page, users can click individual items to cross them off the list, and click a button to clear the list when they are done. This feature also uses local storage to maintain the list between browser sessions.

Technologies Used

Rapid Recipe was built with ReactJS, JSX/HTML, and CSS. React router was used for all navigation, making it a single-page application. Edamam Recipe Search API was used for the recipe searches. This awesome API is what allowed for detailed search parameters.

Biggest Challenges

My biggest challenge for this project was extracting the value of the various search inputs and turning it into something that could be plugged into the API fetch url. The checkbox inputs were particularly challenging, as they come with a unique set of properties and behaviors to consider.

Biggest Successes

The thing I'm most proud of on this project is the number of features I was able to add. I think the biggest relief, though, came when I finally conquered the checkbox search filters. Adding that functionality was pretty essential to my concept, and the long list of filters is one of the big benefits of using Edamam over other recipe databases, so I was pretty excited when I finally got it working. Rather than using state to control each checkbox, I created a Set of checked checkboxes.

A snippet I'm particularly proud of

I'm pretty proud of my handleSubmit function, which is the onSubmit handler for my search form. Input values from the "exclude" text input are split on the spaces (allowing users to input multiple ingredients at once), and then an array is created with those substrings being converted to the API search parameter syntax, and then joined as one string to be plugged into the fetch url. A similar process is performed on the checkbox inputs. An array is created from the Set of checked checkboxes which is then mapped and joined to be plugged in as one string into the fetch url.

handleSubmit = event => {
  event.preventDefault();
  let splitString = this.state.excludeSearchString
    .split(' ')
    .map(subStr => {
      return `&excluded=${subStr}`;
    })
    .join('');
  let setArray = Array.from(this.selectedCheckboxes);
  let filterArray = setArray
    .map(entry => {
      return `&${entry.name}=${entry.value}`;
    })
    .join('');
  this.getRecipes(splitString, filterArray);
};

Unsolved Issues and Ideas for the Future

In the future, I'd love for users to be able to create and store their own recipes.

One small piece of functionality I wasn't able to include involves the bookmark icon. I think the user experience would be improved if bookmarked recipes displayed a filled-in icon. I'd like to tackle this in the future.

Installation Instructions

Fork and clone this repo to download your local copy of the files. Use yarn start or npm start to launch the development server.

Create a free account on Edamam to get your app ID and API key. Store those in an .env.local file with the names used in the fetch url.

Contributions

Please submit an issue on this repo if you find a bug in the code. To make suggestions on features or other behavior, please make a pull request. Thanks!

Gratitude

Thank you to all my GA teachers and fellow students for help and support throughout this project week!

rapid-recipe's People

Contributors

aafmisra avatar

Stargazers

Jack Wrenn avatar

Watchers

 avatar

rapid-recipe's Issues

Feedback

Feedback

Overall result: Complete!

Code Quality

Generally well organized files and clean, easy to read code. Good management of data/state by putting it in the top-most level where it was needed to avoid multiple API calls. My only suggestions would be:

  • For best practices, make sure you put any static files (e.g. svg's, images, etc.) in the public folder rather than src.
  • Try to avoid using class components if the component doesn't require state. Instead, use stateless / functional components! You did in a few, but some others were still class components, so just be sure to double check those in the end!

Technical Requirements

Met all of them! Renders in browser with no errors, deployed to heroku, used the technologies required. Met all silver goals and even one gold goal, great work!

Creativity and Interface

Nice and clean interface, very easy for the user to understand what the app is for and how to use it on their own. Wonderful styling and great grid work with the recipe cards. My only suggestions for an improved user experience would be:

  • Give the user some sort of feedback when they click on some things, like the Add to Grocery List button, it isn't immediately obvious to the user whether or not it was successful. Same with searching, I know the API takes a while to feed back data but, something indicating that the search is being made would be nice!
  • Finding another way for the user to input their ingredients when the ingredient has two or more words, as opposed to having the user type a + in between (e.g. maybe instead of separating with space, separate by commas?)

Functionality

Works perfectly as intended, on both browser and mobile versions! App does seem to break, however, if no results are found (I tried lemon and excluded sugar), so some work on error handling could be done. But assuming the user uses the app perfectly, it works great and again I love that you made it both browser and mobile responsive!

Presentation

Great README! Really easy to read and understand, covers all the necessary points as well even including installation instructions.

Really wonderful job overall πŸ˜„

( p.s. feel free to close the issue once you've read it! )

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.