A comprehensive, multilingual travel planning assistant that creates personalized travel itineraries using Google Gemini AI. Plan your perfect trip with AI-powered recommendations for destinations, hotels, restaurants, activities, flight searches, weather forecasts, and real-time currency conversion.
- Smart Itinerary Generation: Create detailed day-by-day travel plans with specific times and activities
- Personalized Recommendations: Get suggestions based on your budget, interests, and travel style
- Hotel & Restaurant Suggestions: Receive curated recommendations with direct booking links
- Vietnamese & English: Full support for both languages
- Automatic Translation: Switch languages seamlessly with preserved functionality
- Localized Currency: Automatic currency conversion (VNฤ/USD)
- Free Chat Mode: Ask any travel-related questions
- Real-time Responses: Get instant AI-powered answers
- Context-Aware: Understands follow-up questions and maintains conversation context
- Real-time Flight Data: Search for flights using FlightAPI.io
- Multi-route Support: Search flights between any global destinations
- Detailed Flight Info: View departure/arrival times, airlines, flight numbers, and status
- Direct Booking: Links to popular flight booking platforms
- 5-Day Weather Forecast: Get accurate weather predictions for your destination
- Visual Weather Cards: Beautiful UI with weather icons and temperature displays
- Travel Planning: Make informed decisions based on weather conditions
- Multiple Destinations: Check weather for any city worldwide
- Real-time Exchange Rates: Live currency conversion using ExchangeRate-API
- 160+ Currencies: Support for all major world currencies
- Accurate Rates: Updated rates from reliable sources
- Quick Conversion: Instant calculation with user-friendly interface
- Multi-platform Sharing: Share your itinerary on Facebook, Twitter, LinkedIn, and WhatsApp
- Direct Links: One-click sharing to social media platforms
- Email Sharing: Share via email with pre-formatted subject and body
- PDF Export: Print-ready travel itineraries with professional formatting
- HTML Export: Beautifully formatted standalone web pages
- Markdown Export: Developer-friendly format for documentation
- Text Export: Simple, readable plain text format
- Direct Booking Links: Quick access to Booking.com and Agoda
- Google Maps Integration: Find locations instantly with embedded maps
- Restaurant Search: Links to Google Maps and Google Search
- Node.js with Express - Fast, minimalist web framework
- TypeScript - Type-safe development
- Google Gemini 2.5 Flash - Latest AI model for travel recommendations
- FlightAPI.io - Flight schedules and tracking
- OpenWeatherMap API - Weather forecasts
- ExchangeRate-API - Real-time currency exchange rates
- Vanilla JavaScript - No framework dependencies, pure performance
- Responsive CSS - Mobile-first, fully responsive design
- Modern HTML5 - Semantic markup with accessibility features
- Node.js 18+ and npm
- Google Gemini API key (Get it here)
- OpenWeatherMap API key (Get it here)
- FlightAPI.io API key (Get it here)
- ExchangeRate-API key (Get it here)
- Clone the repository:
git clone https://github.com/tridpt/ai-travel-agent-gemini.git
cd ai-travel-agent-gemini/ai-travel-agent- Install dependencies:
npm install- Configure environment variables:
cp .env.example .env- Edit
.envfile with your API keys:
GEMINI_API_KEY=your_gemini_api_key_here
WEATHER_API_KEY=your_openweathermap_api_key_here
FLIGHT_API_KEY=your_flightapi_key_here
CURRENCY_API_KEY=your_exchangerate_api_key_here
PORT=3000
NODE_ENV=development- Build TypeScript:
npm run build- Run in development mode:
npm run dev- Open your browser:
http://localhost:3000
-
Select "๐ Lรชn Kแบฟ Hoแบกch" tab
-
Fill in your travel details:
- Destination (optional - AI can suggest)
- Start and end dates
- Budget
- Number of travelers
- Travel style (Budget/Comfort/Luxury/Adventure/etc.)
- Interests (Beach, Mountain, Food, Culture, etc.)
- Transportation preferences
- Additional requirements
-
Click "โจ Tแบกo Lแปch Trรฌnh Du Lแปch"
-
Review your personalized itinerary
-
Share or export in your preferred format
- Select "๐ฌ Chat Tแปฑ Do" tab
- Ask questions like:
- "Recommend 3-star hotels in Hanoi under 1,000,000 VNฤ"
- "What should I eat in Da Nang?"
- "Best time to visit Sapa?"
- "I want a 5-day beach vacation in Vietnam"
- Select "
โ๏ธ Tรฌm Chuyแบฟn Bay" tab - Enter flight details:
- Departure city/airport code (e.g., HAN, SGN)
- Destination city/airport code (e.g., DAD, CXR)
- Departure date (optional)
- Click "๐ Tรฌm Chuyแบฟn Bay"
- View available flights with:
- Airline names and flight numbers
- Departure and arrival times
- Flight duration
- Aircraft type
- Direct booking links
- Select "๐ค๏ธ Thแปi Tiแบฟt" tab
- Enter destination city name
- Click "๐ Xem Thแปi Tiแบฟt"
- View 5-day weather forecast with:
- Temperature (min/max)
- Weather conditions
- Humidity percentage
- Wind speed
- Weather icons
- Select "๐ฑ Chuyแปn ฤแปi Tiแปn Tแป" tab
- Enter amount and select currencies:
- From currency (e.g., USD, EUR, JPY)
- To currency (e.g., VND, THB, SGD)
- Amount to convert
- Click "๐ฑ Chuyแปn ฤแปi"
- View real-time conversion with:
- Current exchange rate
- Converted amount
- Last update time
Click the language buttons in the top-right corner:
- ๐ป๐ณ VI - Vietnamese
- ๐ฌ๐ง EN - English
ai-travel-agent/
โโโ src/
โ โโโ app.ts # Express server & API routes
โ โโโ services/
โ โโโ geminiService.ts # Gemini AI integration
โ โโโ flightService.ts # FlightAPI.io integration
โ โโโ weatherService.ts # OpenWeatherMap API integration
โ โโโ currencyService.ts # ExchangeRate-API integration
โโโ public/
โ โโโ index.html # Main UI - Travel planning
โ โโโ flight.html # Flight search page
โ โโโ currency.html # Currency converter page
โ โโโ css/
โ โ โโโ style.css # Responsive styling
โ โโโ js/
โ โโโ main.js # Tab switching & markdown rendering
โ โโโ formHandler.js # Form validation & API calls
โ โโโ flightHandler.js # Flight search logic
โ โโโ weatherHandler.js # Weather forecast logic
โ โโโ currencyHandler.js # Currency conversion logic
โ โโโ shareHandler.js # Social sharing functionality
โ โโโ translations.js # i18n support
โ โโโ exportHandler.js # Export functionality
โโโ .env # Environment variables (gitignored)
โโโ .env.example # Environment template
โโโ tsconfig.json # TypeScript configuration
โโโ package.json # Dependencies & scripts
โโโ README.md # Documentation
npm run dev # Start development server with auto-reload (uses tsx)
npm run build # Compile TypeScript to JavaScript
npm start # Run production server (compiled JS)
npm run clean # Remove build artifactsThe AI creates comprehensive plans including:
- Daily schedules with specific times and durations
- Budget breakdowns (transport, accommodation, food, activities)
- Hotel recommendations with addresses, price ranges, and booking links
- Restaurant suggestions with specialties and cuisine types
- Activity suggestions with entrance fees and duration
- Money-saving tips and local insights
- Weather information and packing advice
- Transportation options with estimated costs
Features powered by FlightAPI.io:
- Real-time flight schedules from airlines worldwide
- Comprehensive flight data:
- Flight numbers and airline information
- Departure/arrival times and airports
- Flight duration and distance
- Aircraft type and registration
- Flight status (scheduled, active, landed, cancelled)
- Route-based search: Find flights between any two airports
- Date-specific searches: Filter by departure date
- Direct booking links to major travel platforms
Powered by OpenWeatherMap API:
- 5-day forecasts with 3-hour intervals
- Detailed weather metrics:
- Temperature (current, min, max)
- Feels-like temperature
- Humidity and pressure
- Wind speed and direction
- Cloud coverage
- Weather conditions: clear, cloudy, rain, snow, thunderstorm
- Visual weather icons for easy understanding
- Sunrise/sunset times
Real-time rates from ExchangeRate-API:
- 160+ currencies supported worldwide
- Live exchange rates updated regularly
- High accuracy from reliable financial sources
- Base currency flexibility: Convert from any currency
- Conversion calculator with swap functionality
- Rate information: Last update timestamp
- Popular currencies: USD, EUR, GBP, JPY, CNY, VND, THB, SGD, etc.
Share your itinerary across platforms:
- Facebook: Post with custom message and preview
- Twitter: Tweet with hashtags and travel details
- LinkedIn: Professional sharing with formatted content
- WhatsApp: Direct messaging to contacts
- Email: Pre-formatted email templates with itinerary
- Print-ready format with professional styling
- Includes all booking links and maps
- Optimized for A4 paper size
- Perfect for offline reference
- Standalone web page with embedded CSS
- Beautiful gradient design
- Fully responsive for all devices
- Works offline after download
- GitHub-friendly format
- Easy to edit and version control
- Compatible with documentation tools
- Great for sharing in repositories
- Plain text format
- Universal compatibility
- Easy to share via email/SMS
- Lightweight and accessible
Generate travel itinerary or answer questions
Request:
{
"message": "I want to visit Paris for 5 days with a budget of $2000"
}Response:
{
"response": "Here's your personalized Paris itinerary..."
}Search for flights using FlightAPI.io
Query Parameters:
departure: Departure airport code (IATA, e.g., HAN, SGN)arrival: Arrival airport code (IATA, e.g., DAD, CXR)date: Departure date (YYYY-MM-DD, optional)
Response:
{
"flights": [
{
"flightNumber": "VN123",
"airline": "Vietnam Airlines",
"departure": {
"airport": "Noi Bai International Airport",
"code": "HAN",
"time": "2025-10-15T08:00:00Z"
},
"arrival": {
"airport": "Tan Son Nhat International Airport",
"code": "SGN",
"time": "2025-10-15T10:15:00Z"
},
"duration": "2h 15m",
"aircraft": "Airbus A321",
"status": "scheduled"
}
]
}Get weather forecast using OpenWeatherMap API
Query Parameters:
city: City name (e.g., Hanoi, Da Nang, Ho Chi Minh City)
Response:
{
"city": "Hanoi",
"country": "VN",
"forecast": [
{
"date": "2025-10-06",
"temp": 28,
"tempMin": 24,
"tempMax": 31,
"feelsLike": 30,
"description": "Partly cloudy",
"icon": "02d",
"humidity": 70,
"pressure": 1013,
"windSpeed": 15,
"windDirection": 180,
"clouds": 40
}
]
}Convert currency using ExchangeRate-API
Query Parameters:
from: Source currency code (ISO 4217, e.g., USD, EUR, VND)to: Target currency code (ISO 4217, e.g., VND, THB, JPY)amount: Amount to convert (number)
Response:
{
"from": "USD",
"to": "VND",
"amount": 100,
"rate": 24500.50,
"result": 2450050,
"lastUpdate": "2025-10-06T10:30:00Z"
}# Check if port 3000 is in use
netstat -ano | findstr :3000 # Windows
lsof -i :3000 # macOS/Linux
# Kill the process if needed
taskkill /PID <PID> /F # Windows
kill -9 <PID> # macOS/Linux
# Install dependencies
npm install
# Check Node version (18+ required)
node --version# Verify all API keys are set
type .env # Windows
cat .env # macOS/Linux
# Test API keys:
# - Gemini: https://aistudio.google.com/app/apikey
# - OpenWeatherMap: https://openweathermap.org/api
# - FlightAPI.io: https://www.flightapi.io/
# - ExchangeRate-API: https://app.exchangerate-api.com/# Clean and rebuild
npm run clean
npm run build
# Check TypeScript version
npx tsc --version
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install- FlightAPI.io Free:
- 100 requests/month
- Upgrade for more: https://www.flightapi.io/pricing
- OpenWeatherMap Free:
- 1,000 requests/day
- 60 requests/minute
- ExchangeRate-API Free:
- 1,500 requests/month
- Upgrade for more: https://www.exchangerate-api.com/plans
- Gemini AI:
- Check your quota at AI Studio
- Free tier: 60 requests/minute
- Make sure backend is running on port 3000
- Check frontend is loading from same origin
- Verify
corsmiddleware is enabled inapp.ts - Clear browser cache and cookies
- Verify airport codes are valid IATA codes (3 letters)
- Check date format is YYYY-MM-DD
- Ensure FlightAPI.io API key is active
- Some routes may not have data available
- Use valid ISO 4217 currency codes
- Check internet connection
- Verify ExchangeRate-API key is active
- Some exotic currencies may not be supported
- โ
Never commit
.envfile to Git - โ Keep all API keys private and secure
- โ Use environment variables for all secrets
- โ Enable rate limiting for production use
- โ Validate all user inputs on backend
- โ Sanitize data before displaying
- โ Use HTTPS in production
- โ Implement authentication for user accounts
- โ Set up CORS properly
- โ Keep dependencies updated
Edit public/css/style.css:
/* Primary gradient */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
/* Change to your colors */
background: linear-gradient(135deg, #YOUR_COLOR_1 0%, #YOUR_COLOR_2 100%);Edit public/js/translations.js:
const translations = {
vi: { /* Vietnamese */ },
en: { /* English */ },
fr: { /* Add French */ },
es: { /* Add Spanish */ },
ja: { /* Add Japanese */ }
};Edit public/js/formHandler.js in the buildPrompt() method:
buildPrompt() {
return `You are a professional travel agent. Create a detailed itinerary for...`;
}- Create new service in
src/services/(e.g.,hotelService.ts) - Add API endpoint in
src/app.ts - Create handler in
public/js/(e.g.,hotelHandler.js) - Update UI in HTML files
- Add translations in
translations.js
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and conventions
- Add comments for complex logic
- Update documentation (README, JSDoc)
- Test thoroughly before submitting
- Write meaningful commit messages
- Include screenshots for UI changes
- Add unit tests if applicable
This project is licensed under the MIT License - see the LICENSE file for details.
Tran Duc Tri
- GitHub: @tridpt
- Email: tranductrist@gmail.com
- LinkedIn: Tran Duc Tri
- Portfolio: tridpt.dev
- Google Gemini AI for powering the intelligent recommendations
- FlightAPI.io for comprehensive flight data
- ExchangeRate-API for accurate currency conversion
- OpenWeatherMap for reliable weather forecasts
- Booking.com & Agoda for hotel search integration
- Express.js for the robust web framework
- TypeScript for type-safe development
- All contributors and users of this project
- Flight search integration with FlightAPI.io
- Weather API integration with OpenWeatherMap
- Currency conversion with ExchangeRate-API
- Social sharing features (Facebook, Twitter, LinkedIn, WhatsApp)
- Multiple export formats (PDF, HTML, Markdown, Text)
- Multilingual support (Vietnamese, English)
- Responsive design for all devices
- User authentication system (JWT)
- Save and manage multiple trips
- Trip collaboration features
- Email notifications for price changes
- Hotel price comparison across multiple booking sites
- Mobile app (React Native)
- Interactive map view of itinerary (Google Maps API)
- Calendar export (iCal format)
- Hotel price alerts and notifications
- Travel blog integration
- Photo upload and gallery
- Expense tracking and budget management
- Travel insurance recommendations
- Visa requirements checker
- Local transportation guide (buses, trains, taxis)
- Restaurant reservations integration
- Activity booking system
- Travel companion matching
- Offline mode support
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Search existing GitHub Issues
- Create a new issue with:
- Clear title describing the problem
- Detailed description of what happened
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Screenshots or error messages (if applicable)
- Environment details:
- OS (Windows/macOS/Linux)
- Node.js version
- Browser and version
- Package versions
- ๐ฌ Discussions for questions
- ๐ Issues for bugs
- โจ Feature Requests
- Initial Load: < 2 seconds
- API Response: < 1 second average
- Build Size: ~500KB (minified)
- Lighthouse Score: 95+ on all metrics
- Mobile Performance: Optimized for 3G networks
| Browser | Version | Status |
|---|---|---|
| Chrome | 90+ | โ Fully Supported |
| Firefox | 88+ | โ Fully Supported |
| Safari | 14+ | โ Fully Supported |
| Edge | 90+ | โ Fully Supported |
| Opera | 76+ | โ Fully Supported |
| IE 11 | - |
- โ iOS Safari 14+
- โ Chrome Mobile 90+
- โ Samsung Internet 13+
- โ Firefox Mobile 88+
โญ If you found this project helpful, please give it a star!
๐ Found a bug? Report it here
๐ก Have a feature idea? Suggest it here
๐ Stay updated: Watch this repo
Made with โค๏ธ and โ by Tran Duc Tri