Travya is an intelligent travel planning and booking platform powered by AI agents. Plan trips, discover destinations, book flights, and manage your travel experiences with ease.
Travya combines the power of AI agents with modern web technologies to provide a comprehensive travel planning experience. The platform features multi-agent AI systems for intelligent trip planning, real-time booking capabilities, and a beautiful, intuitive interface.
- π€ AI-Powered Trip Planning - Multi-agent system for intelligent itinerary generation
- πΊοΈ Real-Time Mapping - Interactive maps with location parsing and visualization
- πΈ Photo Gallery - Automated photo collection from web scraping
- π¬ AI Chat Assistant - Conversational interface for travel queries
- π Travel Notes - Sticky-note style notes for trip reminders
- π Secure Authentication - JWT-based auth with user management
- π Dashboard - Overview of trips, conversations, and travel statistics
- π¨ Modern UI - Apple-inspired design with dark mode support
Travya follows a microservices architecture with clear separation of concerns:
flowchart TD
%% FRONTEND
subgraph F["Frontend (React)"]
F1["β’ TanStack Router for routing"]
F2["β’ TanStack Query for data fetching"]
F3["β’ Chakra UI for components"]
end
%% BACKEND
subgraph B["Backend (FastAPI)"]
subgraph B1["AI Agents"]
B1a["β’ Research"]
B1b["β’ Planner"]
B1c["β’ Booker"]
end
subgraph B2["API Routes"]
B2a["β’ Travel"]
B2b["β’ Chat"]
B2c["β’ Users"]
end
subgraph B3["Services"]
B3a["β’ RAG"]
B3b["β’ Documents"]
B3c["β’ Images"]
end
end
%% DATABASES
subgraph DB1["PostgreSQL"]
DB1a["β’ User Data"]
DB1b["β’ Trips"]
DB1c["β’ Conversations"]
end
subgraph DB2["Redis"]
DB2a["β’ Sessions"]
DB2b["β’ Cache"]
DB2c["β’ Memory"]
end
%% CONNECTIONS
F --> B
B --> DB1
B --> DB2
- Docker Desktop (recommended for quick setup)
- Node.js 18+ and Python 3.11+ (for local development)
- Git
# 1. Clone the repository
git clone <repository-url>
cd travya
# 2. Set up environment variables
cp backend/env.example .env
# Edit .env with your configuration (API keys, secrets, etc.)
# 3. Start all services
docker compose up -d --build
# 4. Verify services are running
docker compose ps
# 5. Access the application
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docs
# Database Admin: http://localhost:8080The application will be accessible at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Interactive API Docs: http://localhost:8000/docs
- Alternative API Docs: http://localhost:8000/redoc
travya/
βββ backend/ # FastAPI backend application
β βββ app/
β β βββ agents/ # AI agent system
β β β βββ base_agent.py # Base agent class
β β β βββ orchestrator.py # Agent coordinator
β β β βββ research.py # Research agent
β β β βββ planner.py # Planning agent
β β β βββ booker.py # Booking agent
β β β βββ rag_system.py # RAG implementation
β β β βββ tools.py # Agent tools
β β βββ api/ # API endpoints
β β β βββ routes/ # Route handlers
β β β β βββ ai_travel.py # AI travel planning
β β β β βββ conversations.py # Chat endpoints
β β β β βββ travel.py # Trip management
β β β β βββ map_parser.py # Map parsing
β β β β βββ photo_gallery.py # Photo management
β β β βββ main.py # API router setup
β β βββ core/ # Core configuration
β β β βββ config.py # Settings management
β β β βββ db.py # Database connection
β β β βββ llm.py # LLM integration
β β β βββ security.py # Auth utilities
β β βββ services/ # Business logic
β β β βββ vector_rag.py # Vector database
β β β βββ redis_cache.py # Caching layer
β β β βββ document_storage.py # File storage
β β β βββ image_scraping.py # Image collection
β β β βββ itinerary_parser.py # Itinerary parsing
β β β βββ photo_gallery.py # Gallery management
β β β βββ map_parser.py # Map processing
β β βββ alembic/ # Database migrations
β β βββ models.py # SQLModel definitions
β β βββ crud.py # CRUD operations
β βββ Dockerfile
β βββ pyproject.toml
β βββ requirements.txt
β
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # React components
β β β βββ Common/ # Shared components
β β β β βββ Navbar.tsx # Top navigation
β β β β βββ Sidebar.tsx # Side navigation
β β β β βββ SidebarItems.tsx # Menu items
β β β βββ Items/ # Travel Notes
β β β β βββ AddItem.tsx # Create note
β β β β βββ EditItem.tsx # Edit note
β β β β βββ DeleteItem.tsx # Delete note
β β β βββ MapParserComponent.tsx # Map visualization
β β β βββ PhotoGallery.tsx # Photo display
β β β βββ Typewriter.tsx # Typing effect
β β βββ routes/ # Application routes
β β β βββ _layout.tsx # Main layout
β β β βββ _layout/index.tsx # Dashboard
β β β βββ _layout/chat.tsx # AI Chat
β β β βββ _layout/plan-trip.tsx # Trip planning
β β β βββ _layout/trips.tsx # Trip list
β β β βββ _layout/settings.tsx # User settings
β β β βββ _layout/items.tsx # Travel Notes
β β βββ contexts/ # React contexts
β β β βββ AuthContext.tsx # Auth state
β β β βββ TravelContext.tsx # Travel data
β β β βββ SidebarContext.tsx # UI state
β β βββ hooks/ # Custom hooks
β β βββ client/ # Generated API client
β β βββ main.tsx # App entry point
β βββ public/
β β βββ assets/
β β βββ images/ # Static assets (logos)
β βββ Dockerfile
β βββ package.json
β
βββ docs/ # Documentation
β βββ ai-agents/ # AI agents documentation
β βββ backend-api/ # Backend API docs
β βββ frontend/ # Frontend docs
β βββ database/ # Database schema
β βββ deployment/ # Deployment guides
β βββ external-apis/ # API integrations
β
βββ scripts/ # Build and deployment scripts
βββ docker-compose.yml # Docker Compose configuration
βββ .env # Environment variables (gitignored)
βββ README.md # This file
How it works:
- User creates a trip via
/plan-trippage - Request flows: Frontend β
POST /api/v1/travel/planβ AI Travel Router - Orchestrator agent receives the request and delegates to specialized agents:
- Research Agent: Queries knowledge base and external APIs (Google Places)
- Planner Agent: Generates structured itinerary using LLM
- Booker Agent: Handles booking operations (Flights, Hotels)
- Response returned: Complete trip plan with itineraries, bookings, and recommendations
Code Flow:
frontend/src/routes/_layout/plan-trip.tsx
β API call: /api/v1/travel/plan
β backend/app/api/routes/ai_travel.py
β Agent orchestration: backend/app/agents/orchestrator.py
β Research: backend/app/agents/research.py
β Planning: backend/app/agents/planner.py
β Booking: backend/app/agents/booker.py
How it works:
- User sends message via chat interface
- Message stored in conversation context
- AI processes query and provides travel recommendations
- Context maintained across conversation history
- Real-time updates with streaming responses
Code Flow:
frontend/src/routes/_layout/chat.tsx
β API call: /api/v1/conversations/send
β backend/app/api/routes/conversations.py
β LLM processing: backend/app/core/llm.py
β Context retrieval: backend/app/services/vector_rag.py
β Response streaming back to frontend
How it works:
- User creates a note on
/itemspage - Note stored in PostgreSQL database
- Visual display with colorful sticky-note design
- Edit/Delete actions with confirmation modals
- Notes can contain travel reminders, checklists, ideas
Code Flow:
frontend/src/routes/_layout/items.tsx
β API call: /api/v1/items/
β backend/app/api/routes/items.py
β CRUD operations: backend/app/crud.py
β Database: backend/app/models.py (Item model)
How it works:
- User uploads image with travel map/locations
- Image processed via OCR and computer vision
- Locations extracted and geocoded
- Interactive map displayed with markers
- Clickable markers show location details
Code Flow:
frontend/src/components/MapParserComponent.tsx
β Upload image
β backend/app/api/routes/map_parser.py
β OCR processing: backend/app/services/map_parser.py
β Geocoding: External API (Google Maps)
β Data returned for visualization
How it works:
- Travellers share photos from their trips
- Auto-collected via web scraping service
- Organized by trip and location
- Displayed in gallery with captions
- Search and filter capabilities
Code Flow:
frontend/src/components/PhotoGallery.tsx
β API call: /api/v1/photo-gallery/
β backend/app/api/routes/photo_gallery.py
β Image collection: backend/app/services/image_scraping.py
β Display in UI
# Navigate to backend
cd backend
# Install dependencies using uv (recommended)
uv sync
source .venv/bin/activate
# Or using pip
pip install -r requirements.txt
# Set up environment
cp env.example .env
# Edit .env with your API keys
# Run database migrations
alembic upgrade head
# Start development server
fastapi run app/main.py --reload# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Frontend will be available at http://localhost:5173# Create a new migration
docker compose exec backend alembic revision --autogenerate -m "Your description"
# Apply migrations
docker compose exec backend alembic upgrade head
# View migration history
docker compose exec backend alembic history# Backend tests
docker compose exec backend pytest
docker compose exec backend pytest tests/agents/
docker compose exec backend pytest tests/api/
# Frontend tests
cd frontend
npm test
# E2E tests
npx playwright test
npx playwright test --ui # Interactive modeBackend (.env)
# Application
PROJECT_NAME="Travya"
ENVIRONMENT=local
SECRET_KEY="your-secret-key-here"
# Database
POSTGRES_SERVER=db
POSTGRES_PORT=5432
POSTGRES_USER=travya
POSTGRES_PASSWORD=travya_password
POSTGRES_DB=travya
# Redis
REDIS_URL=redis://redis:6379/0
# AI & External APIs
OPENAI_API_KEY="sk-your-openai-key"
GOOGLE_AI_API_KEY="your-google-key"
GOOGLE_MAPS_API_KEY="your-maps-key"
AMADEUS_API_KEY="your-amadeus-key"
AMADEUS_API_SECRET="your-amadeus-secret"
# Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-password
EMAILS_FROM_EMAIL=noreply@travya.com
# Security
ACCESS_TOKEN_EXPIRE_MINUTES=11520
CORS_ORIGINS=["http://localhost:5173"]Frontend (frontend/.env)
VITE_API_URL=http://localhost:8000- OpenAI: Get API key from https://platform.openai.com
- Google AI: Get API key from https://makersuite.google.com
- Google Maps: Get API key from https://console.cloud.google.com
- Amadeus: Get API credentials from https://developers.amadeus.com
Once the backend is running, access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Authentication
POST /api/v1/login/access-token- LoginPOST /api/v1/login/register- RegisterGET /api/v1/users/me- Get current user
Travel Planning
POST /api/v1/travel/plan- Create trip planGET /api/v1/travel/trips- List user tripsGET /api/v1/travel/trips/{trip_id}- Get trip details
AI Chat
POST /api/v1/conversations/send- Send messageGET /api/v1/conversations- Get conversations
Travel Notes
GET /api/v1/items- List notesPOST /api/v1/items- Create notePUT /api/v1/items/{id}- Update noteDELETE /api/v1/items/{id}- Delete note
# Run all tests
docker compose exec backend pytest
# Run with coverage
docker compose exec backend pytest --cov=app --cov-report=html
# Run specific test file
docker compose exec backend pytest tests/agents/test_orchestrator.py
# Run with verbose output
docker compose exec backend pytest -v# Unit tests
cd frontend
npm test
# E2E tests
npx playwright test
# E2E tests in UI mode
npx playwright test --ui
# Run specific test
npx playwright test login.spec.ts# 1. Set production environment
export ENVIRONMENT=production
# 2. Build images
docker compose -f docker-compose.prod.yml build
# 3. Start services
docker compose -f docker-compose.prod.yml up -d
# 4. Check status
docker compose -f docker-compose.prod.yml ps# Start with Traefik
docker compose -f docker-compose.traefik.yml up -d# Health check endpoints
curl http://localhost:8000/api/v1/health
# View logs
docker compose logs -f backend
docker compose logs -f frontend
# View specific service logs
docker compose logs -f redis
docker compose logs -f db- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pytest && npm test - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
Backend (Python)
black .
isort .
flake8 .Frontend (TypeScript/React)
npm run lint
npm run formatThis project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the docs directory
- Issues: Create an issue on GitHub
- API Docs: http://localhost:8000/docs (when running)
- FastAPI for the excellent backend framework
- TanStack for Router and Query
- Chakra UI for the component library
- The open-source community