Git Product home page Git Product logo

business-seeking's Introduction

Business Seeking

Projects uses React's functionalities like ;

  • Creating Static Components
  • Passing Information to Components
  • Setting the State of Ravenous Components
  • Interacting with the Yelp API

Info about app

  • As a user, I should be able to search for restaurants,
    • should be able to view a list of restaurants returned by the Yelp API
    • should be able to sort through restaurants using a filter

Set-up

npm install
npm start 

Fetch Polyfill Usage for Old Browsers

fetch() is a browser API, older browsers may not support it. To increase the accessibility of Ravenous to a wider audience of users, we’ll need to add a fetch() polyfill to support older browsers.

run npm install whatwg-fetch --save to install the whatwg-fetch polyfill and add it to your package.json file.

How to solve CORS policy problem?

fetch() don't function correctly due to CORS restrictions. cors-anywhere

We can bypass this restriction with an API called CORS Anywhere. CORS Anywhere will take requests sent to its API endpoint, make them for the requesting app with the proper CORS permissions, and then return the response back to the requesting app.

Prepend the URL path passed to the first argument in fetch() with the following:

https://cors-anywhere.herokuapp.com/

Yelp Authorization header

When we make requests to the Yelp API, we have to present a form of identification for the browser. This is because the Yelp API wants to know that we are authorized to access the API.

This identification is presented using our API key as a browser header.

Improvements to App

  • Make addresses clickable and have them open the address in Google Maps in a new tab

  • Make images clickable and have them open the business’ website in a new tab

  • Clicking on a different sorting option automatically requires the Yelp API, rather than having to manually click “Let’s Go” again

  • Implement a type of sort (for example, by entering a distance or radius from a central location)

  • Allow you to search by pressing “Enter” (or “Return”) on your keyboard, as opposed to manually clicking Add autocompletion of addresses to the “Location” input

business-seeking's People

Contributors

mdn102 avatar dependabot[bot] avatar

Stargazers

Roman 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.