A modern React application that helps users discover restaurants, hotels, and attractions around the world. Built with React, Material-UI, and powered by Google Maps API and RapidAPI Travel Advisor.
- Interactive Map Interface - Explore locations with Google Maps integration
- Real-time Location Detection - Automatically detects and centers on user's current location
- Smart Search - Advanced location search with autocomplete functionality
- Place Discovery - Find restaurants, hotels, and attractions in any area
- Filtering & Sorting - Filter places by rating (3.0+, 4.0+, 4.5+)
- Detailed Information - View ratings, reviews, photos, and contact details for each place
- Responsive Design - Optimized for desktop, tablet, and mobile devices
- Weather Integration - Real-time weather information for selected locations
- Material-UI Styled - Modern, clean interface with consistent Material Design
The application displays:
- An interactive Google Map showing your current location or searched location
- A list of nearby places based on selected category (restaurants, hotels, attractions)
- Detailed cards with ratings, reviews, pricing, and direct links to external services
- Real-time weather data for the current map location
- React 18.3.1 - Modern React with hooks
- Material-UI (MUI) 5.16.7 - Component library for UI design
- Google Maps JavaScript API - Interactive maps and place autocomplete
- Axios - HTTP client for API requests
- Google Maps JavaScript API - Maps, Places, and Geocoding
- RapidAPI Travel Advisor - Place data (restaurants, hotels, attractions)
- OpenWeatherMap API - Weather information
- Material-UI (MUI) - Component styling with sx prop
- Emotion - CSS-in-JS styling solution
- Responsive Design - Mobile-first approach
Before you begin, ensure you have the following installed:
- Node.js (v14.0.0 or higher)
- npm (v6.0.0 or higher) or yarn
- Google Maps API Key with the following APIs enabled:
- Maps JavaScript API
- Places API (New)
- Geocoding API
- RapidAPI Account with Travel Advisor API subscription
-
Clone the repository
git clone https://github.com/audrbar/travel-advisor.git cd travel-advisor -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:cp .env.example .env
-
Add your API keys to
.envREACT_APP_GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here REACT_APP_RAPIDAPI_KEY=your_rapidapi_key_here
Important: Never commit the
.envfile to version control. It's already included in.gitignore.
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the following APIs:
- Maps JavaScript API
- Places API (New)
- Geocoding API
- Go to "Credentials" and create an API key
- (Optional) Restrict your API key to specific domains for security
- Sign up at RapidAPI
- Subscribe to Travel Advisor API
- Copy your API key from the dashboard
npm startRuns the app in development mode at http://localhost:3000
The page will reload when you make changes. You may also see lint errors in the console.
npm run buildBuilds the app for production to the build folder. The build is minified and optimized for best performance.
npm testLaunches the test runner in interactive watch mode.
travel-advisor/
βββ public/
β βββ index.html
β βββ ...
βββ src/
β βββ api/
β β βββ travelAdvisorAPI.js # API calls for places and weather
β βββ components/
β β βββ Header/
β β β βββ Header.jsx # Navigation with search
β β β βββ styles.js
β β βββ List/
β β β βββ List.jsx # List of places with filters
β β β βββ styles.js
β β βββ Map/
β β β βββ Map.jsx # Interactive Google Map
β β β βββ styles.js
β β βββ PlaceDetails/
β β βββ PlaceDetails.jsx # Individual place card
β β βββ styles.js
β βββ App.js # Main application component
β βββ index.js # Application entry point
β βββ mapStyles.js # Custom map styling
βββ .env # Environment variables (not in repo)
βββ .env.example # Example environment file
βββ .gitignore
βββ package.json
βββ README.md
- Advanced autocomplete powered by Google Places API
- MUI-styled search input with proper theming
- Dropdown suggestions with Material Design styling
- Responsive design that works on all screen sizes
- Google Maps integration with custom styling
- Click on markers to view place details
- Auto-centering on user location
- Smooth animations and transitions
- Filter by type: Restaurants, Hotels, Attractions
- Filter by rating: All, 3.0+, 4.0+, 4.5+
- Real-time updates as you pan the map
- Ratings with visual indicators
- Review counts and pricing information
- Photos from Google Places
- Direct links to TripAdvisor and websites
- Phone numbers and addresses
- API keys are stored in environment variables
.envfile is excluded from version control- Consider implementing API key restrictions in Google Cloud Console
- Use HTTPS in production
- Implement rate limiting for API calls
- Verify your Google Maps API key is correct
- Ensure Maps JavaScript API is enabled in Google Cloud Console
- Check browser console for specific error messages
- Verify your RapidAPI key is valid
- Check if you have an active subscription to Travel Advisor API
- Ensure you haven't exceeded API rate limits
- Allow location permissions in your browser
- Check if your browser supports geolocation API
- Falls back to London if location detection fails
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Maps Platform for mapping services
- RapidAPI for Travel Advisor API
- Material-UI for the component library
- Create React App for project scaffolding
For questions or feedback, please reach out or open an issue on GitHub.
Happy Traveling! π