Tutorial created in collaboration with Enyel Sequeira, taught by JavaScript Mastery.

Overview

Travel Advisor

Live Site

Travel Advisor

Introduction

Build and Deploy an advanced Travel Companion Application using Google Maps. With Geolocation, Google Maps API, Searching for places, Fetching restaurants, hotels and attractions based on location from specialized Rapid APIs, data filtering and much more, this Travel Advisor App is the best Maps Application that you can currently find on YouTube and on the entire internet.

In this video, you'll learn:

  • Advanced React Best Practices such as folder & file structure, hooks and refs
  • Creating a User Interface using Material UI
  • Working with Google Maps API
  • And most importantly fetching data from unlimited sources using RapidAPI
  • Essentially, you'll become the master of working with APIs

Stay up to date with new projects

New major projects coming soon, subscribe to the mailing list to stay up to date https://javascriptmastery.eo.page/mailing-list.

Setup: run npm i && npm start to start the development server

Comments
  • Unable to read

    Unable to read "sw.lat" in the API

    Here is the error that I got after following the tutorial until 1:03:45.

    TypeError: undefined is not an object (evaluating 'sw.lat')

    Can somebody help me please ?

    opened by doriandevtech 9
  • Error

    Error

    I am stuck @ 1:05:26 ...

    I am getting this error <TypeError: Cannot read properties of undefined (reading 'lat') at getPlacesData (bundle.js:287:25)>

    any help !!

    opened by Pannu786 3
  • TypeError: Cannot read property 'ne' of null

    TypeError: Cannot read property 'ne' of null

    Why I get this error, make no sense?

    TypeError: Cannot read property 'ne' of null (anonymous function) src/App.js:23 20 | }, []) 21 | 22 | useEffect(() => {

    23 | console.log(bounds.ne) | ^ 24 | getPlacesData() 25 | .then((data) => { 26 | setPlaces(data);

    opened by csiki96 1
  • Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'filter')

    Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'filter')

    Getting the error below, any suggestions to fix it?

    Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'filter') (anonymous function) src/App.js:45 ` getPlacesData(type, bounds.sw, bounds.ne) .then((data) => { setPlaces(data.filter((place) => place.name && place.num_reviews > 0)); setFilteredPlaces([]); setRating(''); setIsLoading(false);

    opened by jazer313 0
  • Uncaught TypeError: Cannot read properties of undefined (reading 'length')     at Map (Map.jsx:19:1)

    Uncaught TypeError: Cannot read properties of undefined (reading 'length') at Map (Map.jsx:19:1)

    I followed the tutorial but about a week after completing I cant seem to get the 'length' property to work with the GoogleMapReact component without getting this error back. Looking forward to feedback.

    opened by Pablo-98 0
  • Map not working properly

    Map not working properly

    This page can't load Google Maps correctly.

    This was the message I got while trying to follow the tutorial. Thanks a lot, you are doing a great job :)

    opened by Faithesther20 0
  • Not rendering correctly

    Not rendering correctly

    Tried following the Travel Companion App up to https://youtu.be/GDa8kZLNhJ4?t=1287 (time where I stopped) but after adding the header, list, map, in the app.js file, all that's rendering on the browser is "header, header, header". I've rewatched it multiples times, compared my code to your github but no luck. Any ideas where I can check?

    Here's my repo: https://github.com/enosV/travelapp

    opened by enosV 0
  • React Props not populated

    React Props not populated

    App.js component that makes Travel Advisor API call that populates the data object:

    import React from 'react'
    import GoogleMapReact from 'google-map-react'
    import {Paper, Typography, useMediaQuery} from '@material-ui/core'
    import  LocationOnOutlinedIcon  from '@material-ui/icons/LocationOnOutlined'
    import Rating from "@material-ui/lab"
    
    import useStyles from './styles'
    
    const Map = ({setCoordinates, setBounds, coordinates}) => {
    
      const classes = useStyles()
      const isMobile = useMediaQuery('(min-width: 600px)')
      
      //console.log(coordinates)
      //const coordinates= {lat: 0, lng: 0}
      
      return (
        <div className={classes.mapContainer}>
            <GoogleMapReact
                bootstrapURLKeys={{ key: 'AIzaSyDRtM04BLKwgBtvMIXRD1xRPe1bdHSUDmo'}}
                defaultCenter ={coordinates}
                center = {coordinates}
                defaultZoom = {14}
                margin = {[50, 50, 50, 50]}
                options = {''}
                onChange = {(e) => {
                  console.log(e)
                  setCoordinates({lat: e.center.lat, lng: e.center.lng});
                  
                }}
              
                onChildClick = {''}
            >
    
            </GoogleMapReact>
        </div>
      )
    }
    
    export default Mapconst App = () => {
      const [places, setPlaces] = useState([]);
      const [coordinates, setCoordinates] = useState({});
      const [bounds, setBounds] = useState(null);
    
      useEffect(() => {
        getPlacesData().then((data) => {
        console.log(data) // data is there
          setPlaces(data);
        });
      }, []);
    
      return (
        <>
          <CssBaseline />
          <Header />
          <Grid container spacing={3} style={{ width: "100%" }}>
            <Grid item xs={12} md={4}>
              <List />
            </Grid>
    
            <Grid item xs={12} md={8}>
              <Map
                setCoordinates={setCoordinates}
                setBounds={setBounds}
                coordinates={coordinates}
              />
            </Grid>
          </Grid>
        </>
      );
    };
    
    export default App;
    

    For some reason coordinates prop is not populated in onChange as seen in the video. I double check the code and cannot find what is stopping it from getting the data:

    import React from 'react'
    import GoogleMapReact from 'google-map-react'
    import {Paper, Typography, useMediaQuery} from '@material-ui/core'
    import  LocationOnOutlinedIcon  from '@material-ui/icons/LocationOnOutlined'
    import Rating from "@material-ui/lab"
    
    import useStyles from './styles'
    
    const Map = ({setCoordinates, setBounds, coordinates}) => {
    
      const classes = useStyles()
      const isMobile = useMediaQuery('(min-width: 600px)')
      
      //console.log(coordinates)
      //const coordinates= {lat: 0, lng: 0}
      
      return (
        <div className={classes.mapContainer}>
            <GoogleMapReact
                bootstrapURLKeys={{ key: 'AIzaSyDRtM04BLKwgBtvMIXRD1xRPe1bdHSUDmo'}}
                defaultCenter ={coordinates}
                center = {coordinates}
                defaultZoom = {14}
                margin = {[50, 50, 50, 50]}
                options = {''}
                onChange = {(e) => {
                  console.log(e) // this is empty
                  setCoordinates({lat: e.center.lat, lng: e.center.lng});
                  
                }}
              
                onChildClick = {''}
            >
    
            </GoogleMapReact>
        </div>
      )
    }
    
    export default Map
    
    
    

    The API call returns a bunch of restaurants, so the call works. But I cannot get {coordinates} prop populated....

    opened by aurora10 0
  • Compile issue

    Compile issue

    Hello,

    when I try to run the program I get this error:

    Compiled with problems:

    ERROR in ./src/index.js 8:38-41 export 'default' (imported as 'App') was not found in './App' (module has no exports)

    It seems like an easy error to solve. I tried to export as a function and import and export as non-default etc and no luck. Any ideas about what going on? FYI i copy pasted the GitHub files so the code is the same.

    Thank you, J.R.

    opened by Jeremyrjs1 3
  • Update List.js

    Update List.js

    Array.fill() should have at list one argument, and right it hasn't, in this case it's not make sens to write Array(places.length).fill().map(), why not make it simpler places.map()

    opened by TaronVardanyan 0
Owner
Adrian Hajdin - JavaScript Mastery
JavaScript Enthusiast & Educator
Adrian Hajdin - JavaScript Mastery
A react component helps bring Figma's Cursor Chat to your web applications in less than 3 minutes, making real-time collaboration anywhere

@yomo/react-cursor-chat ?? Introduction A react component helps bring Figma's Cursor Chat to your web applications in less than 3 minutes, making real

YoMo 84 Nov 17, 2022
Source code for my tutorial on how to build customizable table component with React Table and Tailwind CSS.

React Table + Tailwind CSS = ❤️ Source code for my tutorial on how to build customizable table component with React Table and Tailwind CSS. Both parts

Samuel Liedtke 147 Jan 7, 2023
React tutorial

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: ya

Safa ABALLAGH 6 Sep 25, 2021
React Hooks tutorial for beginners.

React Hooks for Beginners git clone <url> Clone into the repo code react-hooks Open the folder in VS Code npm install Install the dependencies npm sta

Mohammad Muazam 2 Oct 10, 2022
This is a code repository for the corresponding video tutorial. In this video, we're going to build a Modern UI/UX Restaurant Landing Page Website

Restaurant Landing Page Live Site Stay up to date with new projects New major projects coming soon, subscribe to the mailing list to stay up to date h

Adrian Hajdin - JavaScript Mastery 843 Jan 4, 2023
Example "Mushroom App" used as a p2panda tutorial

mushroom-app-tutorial This is an example app accompanying the p2panda tutorial "Let's build a mushroom app!" with TypeScript, Webpack and React. Usage

null 3 Nov 4, 2022
Created with StackBlitz ⚡️

React Pagination This project supports two kinds of APIs usePagination A custom hook that returns you the pagination data which can then be used to cr

Shubham Khatri 125 Jan 3, 2023
Work from is a web app created by Josh Cawthorne for the Supabase Hackathon.

Work From What is Work From? Work from is a web app created by Josh Cawthorne for the Supabase Hackathon. The concept of the app is for companies to b

Josh Cawthorne 86 Jan 3, 2023
This app simulates a simple bookstore, and it was created using ReactJS and Redux.

Bookstore About The Bookstore is a website similar to the "Awesome Books" website built in the previous Microverse module (see live version). My goal

Enio N. de Souza 6 Oct 3, 2021
A chat application created using React,js and Chat Engine

⭐️ Chat-App ⭐️ A Chat Application created using React.js and Chat Engine Live Site Getting Started with Create React App This project was bootstrapped

Supuni Eleesha Randeniya 1 Dec 15, 2022
This is a movie app project using imdb database created by nextjs and tailwind css.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Sahand Ghavidel 1 Dec 24, 2021
This is a movie app created by next.js and tailwind css using imdb database.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Sahand Ghavidel 1 Dec 26, 2021
A hook based project created during 20-Dec week ReactJS workshop

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Nabendu 1 Dec 25, 2021
Airbnb-React - In this project, An Airbnb experience page clone is created to learn and implement React props concepts.

Create React Airbnb App In this project An airbnb experience page clone is created to learn and implement React props concepts. Objectives Learn about

Yogesh Gurjar 4 Jun 28, 2022
Hacker-news-with-react - 👾 Consuming the hacker news api, i created a more modern design for than the current site.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

João Thomaz 1 Jan 3, 2022
This simple tic-tac-toe game is created by following the react documentation. and there's some modifications on it.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Kesara Karannagoda 1 Dec 29, 2022
During work. Second team project created during CodersCamp 2021/2022 by a 6-person team.

BoardMap Status: Work in progress. Work on the project started on 10-01-2021. Our Crew Mentor: Piotr Rynio Agnieszka Przybyłowska Patryk Święcicki Rad

Piotr Rynio 3 Mar 21, 2022
This website was designed to allow viewers complete access to all movie and tv series trailers. It was created using React + MUI

Trailer - Time ?? Demo https://trailer-time.netlify.app/ ?? about This project is a simplified front end clone of some movie webside (like Netflix/Hul

null 9 Aug 24, 2022
This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app

VeganRecipe ?? ?? ?? ?? Hello! This project is a Vegan recipe application. I created with React Native. Check out VeganRecipe now for recipe app. ?? ?

Murat 4 Mar 27, 2022