LocaInsight is a travel exploration app that merges OpenAI GPT-3.5 with the Google Maps JavaScript API to provide personalized travel recommendations and itineraries.
- AI-Driven Recommendations: Uses GPT-4.0 to generate tailored suggestions based on user input and preferences.
- Interactive Map: Displays recommended locations with markers on a Google Map.
- Dynamic Centering: Automatically centers the map on the first recommended location.
- Data Validation: Robust server-side validation for recommendations and user inputs.
- Error Handling: Comprehensive error handling with informative user feedback.
- Backend: Node.js, Express, OpenAI API (GPT-3.5 Turbo)
- Frontend: React, @react-google-maps/api, Axios
- API Features: Response caching, request validation
-
Server Setup:
- Navigate to the
serverfolder and run:npm install
- Create a
.envfile inserverwith:OPENAI_API_KEY=YOUR_OPENAI_API_KEY PORT=5000
- Start the server:
npm start
- Navigate to the
-
Client Setup:
- Navigate to the
clientfolder and run:npm install
- In
client/src/App.js, replace"YOUR_GOOGLE_MAPS_API_KEY"with your actual Google Maps API key. - Start the client:
npm start
- Navigate to the
- Open http://localhost:5000 in your browser.
- Enter a Location (e.g., "Paris") and your Preferences (e.g., "art museums, cafes").
- Click Get Recommendations to view AI-generated travel suggestions on the map and as a list.
- Each recommendation includes a name, description, address, and precise coordinates.
This project is for demonstration purposes. Ensure you comply with the respective terms for the OpenAI API and Google Maps Platform when using it.
