full-stack web application that generates optimized eco-friendly travel itineraries using AI and live API integrations
built during hackprinceton fall 25
demo: https://youtu.be/GqZLsIdueTE
- Frontend: Next.js 14 + TailwindCSS + Chart.js
- Backend: FastAPI (Python 3.11+)
- AI Layer: Dedalus API, Open AI API
- iMessage Integration: Photon
- External APIs:
- Flights API (flights)
- Amadeus (hotels)
- Google Places API (attractions + geocoding)
- Google Maps API (maps + transportation optimization)
- OpenWeather API (forecast)
- Climatiq API (CO₂ estimation)
- Node.js >= 18.0.0 (for Photon iMessage integration)
- Python 3.11+ (for backend)
- macOS (required for Photon iMessage features)
From the root directory:
# Install all npm dependencies (root, photon, backend, frontend)
npm install
# Or install individually:
npm run install:photon # Photon iMessage dependencies
npm run install:backend # Backend npm dependencies (if any)
npm run install:frontend # Frontend dependenciescd backend
source .venv/bin/activate # or create venv if needed
pip install -r requirements.txt
npm start # or: uvicorn app:app --reloadThe backend will run at http://localhost:8000
cd frontend
npm install
npm run devThe frontend will run at http://localhost:3000
The Photon integration requires macOS and Node.js:
cd photon
npm installRequired dependencies:
@photon-ai/imessage-kit- iMessage SDKbetter-sqlite3- SQLite driver for Node.js
Note: If using Bun instead of Node.js, better-sqlite3 is not needed as Bun has built-in SQLite support.
Create a .env file in backend/:
DEDALUS_API_KEY=your_dedalus_key
AMADEUS_API_KEY=your_amadeus_key
AMADEUS_API_SECRET=your_amadeus_secret
OPENWEATHER_KEY=your_openweather_key
GOOGLE_PLACES_KEY=your_google_places_key
CLIMATIQ_KEY=your_climatiq_keyNote: The backend gracefully falls back to sample data if API keys are missing, so you can prototype without them.
-
Smart Itinerary Generation
- Enter destination, number of days, budget, and preferences
- Choose optimization mode: "💸 Price-Optimal" or "🌱 Balanced (Eco + Price)"
- AI generates optimized itinerary using Dedalus
-
Live API Integration
- Real-time flight and hotel data from Amadeus
- Weather forecasts from OpenWeather
- Attractions from Google Places
- CO₂ emissions estimation from Climatiq
-
Results Dashboard
- Daily itinerary breakdown (morning, afternoon, evening)
- Cost and emissions totals
- Eco score (0-100 sustainability rating)
- Comparison charts
- Regenerate in different mode
GET /plan- Health checkPOST /generate_itinerary- Generate GreenTrip itinerary{ "destination": "Paris, France", "num_days": 5, "budget": 2000, "preferences": ["food", "art", "outdoors"], "mode": "balanced" }POST /plan- Legacy GreenTrip endpointPOST /bookings- Create booking
/backend
app.py # FastAPI application
schemas.py # Pydantic models
services/
itinerary_generator.py # Main itinerary generation logic
dedalus_client.py # Dedalus API integration
amadeus_flights.py # Amadeus flight search
amadeus_hotels.py # Amadeus hotel search
openweather_service.py # OpenWeather integration
google_places_service.py # Google Places integration
climatiq_service.py # Climatiq emissions estimation
prompt_builder.py # Dedalus prompt construction
... # Other services
/frontend
pages/
index.tsx # Main form page
results.tsx # Results display page
...
The backend uses absolute imports (e.g., from schemas import ...). Make sure you're running from the backend/ directory.
The frontend uses TypeScript. If you encounter issues, you can convert .tsx files to .js and remove type annotations.
- All API keys are read server-side through
dotenv- never exposed to the client - The system includes fallback data for development without API keys
- Dedalus API requires proper JSON response format - the prompt builder ensures this