A modern, AI-powered travel itinerary generator that creates personalized trip plans using Google's Gemini AI. Built with React, TypeScript, and featuring a unique Neobrutalism design aesthetic.
- Smart Itinerary Generation: Leverages Google Gemini 2.5 Flash model for intelligent trip planning
- Personalized Recommendations: Considers your interests, budget, and trip duration
- Structured JSON Schema: Ensures consistent and reliable AI responses
- Local Cuisine Integration: Includes breakfast, lunch, and dinner suggestions for each day
- Neobrutalism Design: Bold, distinctive visual style with thick borders and vibrant colors
- Responsive Layout: Optimized for desktop and mobile devices
- Interactive Components: Custom-built form elements and buttons
- Loading States: Smooth user experience with loading indicators and error handling
- PDF Generation: Export complete itineraries as formatted PDF documents
- Professional Layout: Clean, printable format with proper page breaks
- Custom Filename: Automatically generates filename based on trip title
- TypeScript: Full type safety and excellent developer experience
- Component Architecture: Modular, reusable React components
- Environment Configuration: Secure API key management
- Modern Build Tools: Vite for fast development and optimized builds
- Node.js (v16 or higher)
- Google Gemini API Key (Get one here)
-
Clone the repository
git clone <repository-url> cd ai-travel-itinerary
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.local
file in the root directory:GEMINI_API_KEY=your_gemini_api_key_here
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173
to view the application
ai-travel-itinerary/
βββ components/ # React components
β βββ ErrorDisplay.tsx # Error message component
β βββ Footer.tsx # Application footer
β βββ Header.tsx # Application header
β βββ ItineraryDisplay.tsx # Main itinerary display with PDF export
β βββ ItineraryForm.tsx # Trip planning form
β βββ LoadingSpinner.tsx # Loading animation
β βββ NeobrutalismButton.tsx # Custom button component
β βββ NeobrutalismCard.tsx # Custom card component
β βββ NeobrutalismInput.tsx # Custom input component
β βββ NeobrutalismSelect.tsx # Custom select component
βββ services/
β βββ geminiService.ts # Google Gemini API integration
βββ App.tsx # Main application component
βββ types.ts # TypeScript type definitions
βββ index.tsx # Application entry point
βββ index.html # HTML template
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Project dependencies
βββ README.md # This file
The main input form where users specify their travel preferences:
- Destination: Target location for the trip
- Duration: Number of days (1-30)
- Interests: Personal preferences and activities
- Budget: Budget level (Budget/Mid-Range/Luxury)
Displays the generated itinerary with:
- Trip Overview: Title, destination, and duration
- Daily Plans: Structured day-by-day activities
- Activity Timeline: Time-based activity scheduling
- Dining Suggestions: Meal recommendations for each day
- PDF Export: One-click PDF generation
Custom UI components following the Neobrutalism design philosophy:
- Bold Borders: Thick, black borders on all elements
- Vibrant Colors: High-contrast color scheme
- Sharp Shadows: Distinctive drop shadows
- Geometric Shapes: Clean, rectangular designs
The application uses Google's Gemini 2.5 Flash model with:
// Structured schema for consistent responses
const itinerarySchema = {
type: Type.OBJECT,
properties: {
destination: { type: Type.STRING },
duration: { type: Type.INTEGER },
tripTitle: { type: Type.STRING },
dailyPlans: {
type: Type.ARRAY,
items: {
type: Type.OBJECT,
properties: {
day: { type: Type.INTEGER },
title: { type: Type.STRING },
activities: { /* Activity schema */ },
foodSuggestions: { /* Food schema */ }
}
}
}
}
};
- JSON Validation: Ensures AI responses match expected schema
- Error Handling: Graceful fallbacks for API failures
- Content Cleaning: Removes markdown formatting from responses
interface Activity {
time: string; // e.g., "Morning", "2:00 PM"
description: string; // Activity description
location?: string; // Optional location
}
interface FoodSuggestions {
breakfast?: string;
lunch?: string;
dinner?: string;
}
interface DayPlan {
day: number;
title: string; // Thematic day title
activities: Activity[];
foodSuggestions: FoodSuggestions;
}
interface Itinerary {
destination: string;
duration: number;
tripTitle: string; // AI-generated creative title
dailyPlans: DayPlan[];
}
- React 19.1.1: Latest React with concurrent features
- TypeScript 5.8.2: Type-safe JavaScript development
- Vite 6.3.6: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Custom Components: Neobrutalism-styled UI elements
- Responsive Design: Mobile-first approach
- @google/genai 1.16.0: Official Google Gemini SDK
- Structured Generation: JSON schema-based responses
- Environment Variables: Secure API key management
- jsPDF: Client-side PDF generation
- Custom Formatting: Professional itinerary layout
- Page Management: Automatic page breaks and sizing
- @vitejs/plugin-react: React support for Vite
- @types/node: Node.js type definitions
- ESM Modules: Modern JavaScript module system
The application embraces the Neobrutalism design trend:
- Bold Typography: Heavy, impactful fonts
- High Contrast: Strong color combinations
- Geometric Shapes: Clean, rectangular layouts
- Functional Beauty: Form follows function
- Primary: Yellow (#FEF3C7) - Warm, inviting background
- Accent: Blue (#93C5FD) - Trust and reliability
- Highlight: Lime (#BEF264) - Energy and excitement
- Secondary: Fuchsia (#F0ABFC) - Creativity and fun
- Text: Black (#000000) - Maximum readability
# Required
GEMINI_API_KEY=your_api_key_here
# Optional (for development)
VITE_APP_TITLE=AI Travel Itinerary
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
return {
define: {
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
}
}
};
});
- Enter Destination: Specify where you want to travel
- Set Duration: Choose trip length (1-30 days)
- Add Interests: Describe your preferences and activities
- Select Budget: Choose your budget level
- Generate: Click "Create My Itinerary"
- Export: Download as PDF when ready
- Destination: "Tokyo, Japan"
- Duration: "7 days"
- Interests: "Anime, Sushi, Traditional temples, Shopping"
- Budget: "Mid-Range"
The AI creates a comprehensive itinerary including:
- Creative trip title
- Daily themes and activities
- Specific timing recommendations
- Local restaurant suggestions
- Cultural experiences
- Transportation tips
npm run build
npm run preview
The application can be deployed to:
- Vercel: Automatic deployments with environment variables
- Netlify: Static site hosting with build optimization
- GitHub Pages: Free hosting for public repositories
- AI Studio: Direct integration with Google's platform
API Key Not Working
- Ensure
GEMINI_API_KEY
is set in.env.local
- Verify API key has proper permissions
- Check for typos in environment variable name
PDF Export Failing
- Ensure jsPDF is properly loaded
- Check browser console for JavaScript errors
- Verify itinerary data is complete
Styling Issues
- Ensure Tailwind CSS is properly configured
- Check for conflicting CSS rules
- Verify component imports are correct
- Use browser dev tools to inspect API calls
- Check console for detailed error messages
- Ensure Node.js version compatibility
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Use TypeScript for all new code
- Follow React best practices
- Maintain component modularity
- Add proper error handling
This project is open source and available under the MIT License.
- AI Studio App: https://ai.studio/apps/drive/1PfuswzCsCsOfaVGdSpLmXRYcEZS7PmeA
- Google Gemini API: https://ai.google.dev/
- React Documentation: https://reactjs.org/
- TypeScript Guide: https://www.typescriptlang.org/
- Tailwind CSS: https://tailwindcss.com/