An intelligent multi-person trip planner for London, leveraging AI to create personalized itineraries with map integration and user-defined preferences. This project was created for the "AI for Ease" hackathon.
Wonder Route is a web application designed to simplify and enhance the experience of planning a day trip in London. It uses Google's Gemini AI to generate bespoke itineraries based on user inputs such as points of interest, friend locations, budget, travel preferences, and even individual traveler personas. The application integrates with Google Maps for visual planning and location searching, providing a seamless planning experience.
- AI-Powered Itinerary Generation: Leverages Google Gemini (via
wonder-route/src/services/geminiService.js) to create dynamic and personalized day plans. - Interactive Map Interface: Uses Google Maps (
MapComponent.js) for selecting locations (friend's places, areas to visit) and searching for points of interest. - Multi-Persona Planning: Allows users to define different traveler personas (e.g., budget, energy levels, interests) using
PersonaInput.jsfor more tailored suggestions. - Comprehensive Preference Customization (via
Sidebar.js):- Trip duration (start and end times).
- Budget (low, medium, high).
- Travel modes (walking, public transport, driving, cycling).
- Interests (architecture, food, museums, parks, Black History Month, etc.).
- Dietary needs.
- Location Management: Easily add and remove friend locations and areas to visit directly on the map or via search.
- Visual Timeline View: Displays the generated itinerary in an easy-to-follow timeline format (
TimelineView.js), including activity details, duration, cost, fun facts, and photo opportunities. - Dynamic Content Generation:
- AI-generated Instagram caption ideas for locations.
- AI-generated fun facts/trivia for locations.
- Responsive Design: User interface built with Material UI for a clean and modern look, as seen in
App.js.
- Frontend: React, JavaScript, Material UI, React Google Maps API (
@react-google-maps/api), Axios - AI: Google Gemini API (
@google/generative-ai) - Backend (Optional): Node.js, Express.js (server setup in
wonder-route/server/server.jsfor secure API key management and server-side AI calls) - Styling: CSS (
App.css,index.css), Material UI (Emotion)
- Node.js (v14 or later recommended)
- npm or yarn
You will need API keys for:
- Google Maps Platform:
- Enable "Maps JavaScript API" and "Places API".
- Get your key from Google Cloud Console.
- Google Gemini API:
- Get your key from Google AI Studio.
-
Clone the repository:
git clone <your-repository-url> cd <your-repository-url>/wonder-route
-
Install dependencies:
npm install # or yarn install -
Configure Environment Variables: Create a
.env.localfile in thewonder-routedirectory (seewonder-route/.env.local):// filepath: wonder-route/.env.local REACT_APP_GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_API_KEY REACT_APP_GEMINI_API_KEY=YOUR_GEMINI_API_KEY
Replace
YOUR_GOOGLE_MAPS_API_KEYandYOUR_GEMINI_API_KEYwith your actual keys. Note: The client-side Gemini API key (REACT_APP_GEMINI_API_KEY) is used by default for development convenience. For production, it's highly recommended to proxy requests through your own backend server to protect your Gemini API key. -
Start the development server:
npm start # or yarn startThe application will be available at
http://localhost:3000.
The backend server (see wonder-route/server/server.js) is provided as an alternative for handling Gemini API calls securely. The frontend client (wonder-route/src/api.js) currently uses the client-side SDK. To use this backend:
-
Navigate to the server directory:
cd server -
Install server dependencies:
npm install # or yarn install -
Configure Server Environment Variables: Create a
.envfile in thewonder-route/serverdirectory (seewonder-route/server/.env):// filepath: wonder-route/server/.env GEMINI_API_KEY=YOUR_GEMINI_API_KEY PORT=5000
Replace
YOUR_GEMINI_API_KEYwith your actual key. -
Start the backend server:
npm start # or for development with nodemon npm run devThe server will run on
http://localhost:5000(or the port specified inwonder-route/server/.env). To use this backend for AI calls, you would need to modify the frontend's API service (wonder-route/src/api.js) to make HTTP requests to this server's endpoints (e.g.,/api/generate-itinerary) instead of using the client-sideGoogleGenerativeAISDK directly.
Frontend (wonder-route directory - from package.json)
npm startoryarn start: Runs the app in development mode.npm testoryarn test: Launches the test runner (seeApp.test.js).npm run buildoryarn build: Builds the app for production.npm run ejectoryarn eject: Ejects from Create React App configuration (use with caution).
Backend (wonder-route/server directory - from server/package.json)
npm start: Starts the server usingnode server.js.npm run dev: Starts the server withnodemonfor automatic restarts during development.
wonder-route/
├── public/ # Static assets, favicons, and index.html
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
├── server/ # Backend Express server
│ ├── server.js # Main server logic, API endpoints
│ ├── package.json # Server dependencies
│ └── .env # Server environment variables (Gemini API Key)
├── src/ # Frontend React application source
│ ├── api.js # Client-side API call functions
│ ├── App.css # Global application styles
│ ├── App.js # Main application component
│ ├── index.css # Base CSS styles
│ ├── index.js # Entry point for React app
│ ├── components/ # Reusable React components
│ │ ├── MapComponent.js
│ │ ├── PersonaInput.js
│ │ ├── Sidebar.js
│ │ └── TimelineView.js
│ └── services/ # Client-side services
│ └── geminiService.js # Gemini API interaction logic
├── .env.local # Frontend environment variables (API keys)
├── .gitignore # Files and folders to ignore in git
├── package.json # Frontend dependencies and scripts
└── README.md # This file
- User Input: Users interact with the
Sidebarto input their preferences:- Add friend locations and areas to visit using the interactive
MapComponent. - Specify start/end times, budget, travel mode, interests, and dietary needs.
- Define traveler personas with individual preferences using
PersonaInput.
- Add friend locations and areas to visit using the interactive
- AI Processing:
- The collected data is formatted into a detailed prompt.
- This prompt is sent to the Google Gemini API via the client-side
geminiService.js(or potentially through the backend server if modified).
- Itinerary Display:
- The AI's response (ideally a JSON object) is parsed.
- The itinerary is displayed in a user-friendly
TimelineView, showing activities, locations, times, costs, fun facts, and photo opportunities. - Users can also generate Instagram captions and trivia for specific locations on the timeline.
- Improve UI/UX with more animations and smooth transitions.
- Implement calendar export functionality (e.g., Google Calendar, iCal).
- Add language translation features for broader accessibility.
- Enhance error handling and provide more robust fallbacks, especially for API interactions (current error handling in
App.jscan be expanded). - Expand test coverage with more unit and integration tests.
- Fully integrate the backend server for all AI calls to secure API keys in a production environment.
This project was bootstrapped with Create React App. You can find the standard Create React App documentation below.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify