How mkvaraa/ai-voyage works
AI-Voyage is a web travel planner: users provide trip details, receive AI-generated itineraries, and can view routes on a map, check forecasts, and replace stops. The React frontend communicates with a FastAPI backend; the backend validates requests, calls Gemini for itinerary content, and stores routes in SQLite. Mapbox and OpenWeather are documented frontend integrations. Source excerpts establish backend orchestration and persistence; frontend interaction details and several integrations are described only at a high level in the README, so those links are kept broad.
Main entry points: main.py FastAPI application · RoutePage.tsx Route presentation · routes.py Route endpoints · route_service.py Itinerary generation
Components 22
Trip planning frontend
- React application
frontend/src/App.tsx - Trip details form
frontend/src/components/TripForm.tsx - Route presentation
frontend/src/pages/RoutePage.tsx - Itinerary display
frontend/src/components/ItineraryCard.tsx - Stop display
frontend/src/components/StopCard.tsx - Route map
frontend/src/components/RouteMap.tsx - Weather forecasts
frontend/src/hooks/useWeather.ts - API client
frontend/src/lib/axios.ts
API and domain logic
- FastAPI application
backend/app/main.py - Route endpoints
backend/app/routers/routes.py - Health endpoint
backend/app/routers/health.py - Trip and route schemas
backend/app/models/schemas.py - Itinerary generation
backend/app/services/route_service.py - Validation errors
backend/app/errors.py - Gemini call metrics
backend/app/metrics.py
Route persistence
- Route data access
backend/app/database/crud.py - SQLite routes
backend/app/database/connection.py - Database initialization
backend/app/database/init_db.py
External services
- Google Gemini
- Mapbox
- OpenWeather
Other components
- Traveler
Connections 22
- Traveler → Trip details form: enters trip details
README.md - Trip details form → API client: submits trip
- API client → FastAPI application: sends API requests
README.md - FastAPI application → Route endpoints: routes requests
backend/app/main.py - FastAPI application → Health endpoint: routes health checks
backend/app/main.py - FastAPI application → Validation errors: handles validation
backend/app/main.py - FastAPI application → Database initialization: initializes database
backend/app/main.py - Route endpoints → Trip and route schemas: validates and returns
backend/app/routers/routes.py - Route endpoints → Itinerary generation: generates or replaces
backend/app/routers/routes.py - Route endpoints → Route data access: loads and saves
backend/app/routers/routes.py - Itinerary generation → Trip and route schemas: builds validated routes
backend/app/services/route_service.py - Itinerary generation → Google Gemini: requests itinerary content
backend/app/services/route_service.py - Itinerary generation → Gemini call metrics: records API calls
backend/app/services/route_service.py - Route data access → SQLite routes: reads and writes
backend/app/database/crud.py - Database initialization → SQLite routes: creates route table
backend/app/database/init_db.py - FastAPI application → React application: serves API to
README.md - React application → Route presentation: hosts route views
- Route presentation → Itinerary display: presents itinerary
- Route presentation → Stop display: presents stops
- Route presentation → Route map: shows route map
- Route map → Mapbox: renders map with
README.md - Weather forecasts → OpenWeather: gets forecasts from
README.md