# razvanf7/ai-travel-agent architecture

> Architecture diagram of the GitHub repository razvanf7/ai-travel-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/razvanf7/ai-travel-agent
- Repository: https://github.com/razvanf7/ai-travel-agent

## Overview

AI Travel Hub is a collaborative trip-planning web application. A user authenticates, creates or joins a group, plans trips, and then manages itineraries, expenses, checklists, and group chat. The AI endpoints apply rate limits and provide itinerary generation and streamed concierge assistance; chat messages are moderated before persistence. Finance includes currency conversion and debt simplification, while notifications support configurable web push. The graph follows documented capabilities and sampled caller relationships; some UI and event wiring is not shown in the available source excerpts.

Main entry points: [`backend/ai_agents/views.py`](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/views.py) (AI Request Orchestrator), [`backend/finance/views.py`](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/views.py) (Expense & Debt API), [`backend/notifications/services.py`](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/services.py) (Web Push Service), [`backend/chat/views.py`](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/chat/views.py) (Group Chat API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; Groups"]
  node_accounts["Accounts &amp; JWT<br/>[views.py]"]
  node_profiles[("User Profiles<br/>[models.py]")]
  node_group_api["Group Management<br/>[views.py]"]
  node_groups[("Groups &amp; Memberships<br/>[models.py]")]
end

subgraph group_planning["Trip Planning"]
  node_trip_api["Trip &amp; Itinerary API<br/>[views.py]"]
  node_trips[("Trips &amp; Activities<br/>[models.py]")]
  node_dashboard["Dashboard &amp; Trip Pages<br/>[views.py]"]
end

subgraph group_ai["AI Services"]
  node_ai_api["AI Request Orchestrator<br/>[views.py]"]
  node_rate_limit["AI Rate Limiter<br/>[rate_limiter.py]"]
  node_pathfinder["Itinerary Pathfinder<br/>[pathfinder.py]"]
  node_concierge["Travel Concierge<br/>[concierge.py]"]
end

subgraph group_collaboration["Group Collaboration"]
  node_chat_api["Group Chat API<br/>[views.py]"]
  node_moderator["AI Moderator<br/>[moderator.py]"]
  node_messages[("Chat Messages<br/>[models.py]")]
  node_checklists["Shared Checklists<br/>[views.py]"]
  node_checklist_items[("Checklist Items<br/>[models.py]")]
end

subgraph group_finance["Expense Management"]
  node_expense_api["Expense &amp; Debt API<br/>[views.py]"]
  node_finance_data[("Transactions &amp; Debts<br/>[models.py]")]
  node_debt_simplifier["Debt Simplifier<br/>[debt_simplifier.py]"]
  node_currency["Currency Conversion<br/>[currency.py]"]
end

subgraph group_platform["Notifications"]
  node_notification_api["Notification Preferences<br/>[views.py]"]
  node_notification_service["Web Push Service<br/>[services.py]"]
  node_notification_data[("Notification Settings<br/>[models.py]")]
end

node_traveler(("Traveler"))
node_llm{{"LLM Service"}}
node_frankfurter{{"Frankfurter API"}}
node_web_push{{"Web Push Service"}}

node_traveler -->|"authenticates"| node_accounts
node_accounts -->|"creates profile"| node_profiles
node_traveler -->|"creates or joins"| node_group_api
node_group_api -->|"manages membership"| node_groups
node_traveler -->|"plans trip"| node_trip_api
node_trip_api -->|"reads and writes"| node_trips
node_dashboard -->|"loads groups"| node_groups
node_dashboard -->|"loads trips"| node_trips
node_ai_api -->|"checks quota"| node_rate_limit
node_ai_api -->|"generates itinerary"| node_pathfinder
node_ai_api -->|"streams assistance"| node_concierge
node_pathfinder -->|"requests generation"| node_llm
node_concierge -->|"requests responses"| node_llm
node_ai_api -->|"saves activities"| node_trips
node_ai_api -->|"posts system message"| node_messages
node_traveler -->|"sends messages"| node_chat_api
node_chat_api -->|"moderates message"| node_moderator
node_chat_api -->|"reads and saves"| node_messages
node_traveler -->|"manages tasks"| node_checklists
node_checklists -->|"reads and writes"| node_checklist_items
node_traveler -->|"logs expenses"| node_expense_api
node_expense_api -->|"reads and writes"| node_finance_data
node_expense_api -->|"simplifies debts"| node_debt_simplifier
node_expense_api -->|"converts currency"| node_currency
node_currency -->|"fetches rates"| node_frankfurter
node_traveler -->|"sets preferences"| node_notification_api
node_notification_api -->|"reads and writes"| node_notification_data
node_notification_service -->|"checks preferences"| node_notification_data
node_notification_service -->|"reads push tokens"| node_profiles
node_notification_service -->|"sends notification"| node_web_push

click node_accounts "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/accounts/views.py"
click node_profiles "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/accounts/models.py"
click node_group_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/groups/views.py"
click node_groups "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/groups/models.py"
click node_trip_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/trips/views.py"
click node_trips "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/trips/models.py"
click node_dashboard "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/config/views.py"
click node_ai_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/views.py"
click node_rate_limit "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/rate_limiter.py"
click node_pathfinder "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/pathfinder.py"
click node_concierge "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/concierge.py"
click node_chat_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/chat/views.py"
click node_moderator "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/moderator.py"
click node_messages "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/chat/models.py"
click node_checklists "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/checklists/views.py"
click node_checklist_items "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/checklists/models.py"
click node_expense_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/views.py"
click node_finance_data "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/models.py"
click node_debt_simplifier "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/debt_simplifier.py"
click node_currency "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/currency.py"
click node_notification_api "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/views.py"
click node_notification_service "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/services.py"
click node_notification_data "https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_accounts,node_profiles,node_group_api,node_groups toneBlue
class node_trip_api,node_trips,node_dashboard toneAmber
class node_ai_api,node_rate_limit,node_pathfinder,node_concierge,node_frankfurter toneMint
class node_chat_api,node_moderator,node_messages,node_checklists,node_checklist_items toneRose
class node_expense_api,node_finance_data,node_debt_simplifier,node_currency,node_traveler,node_llm,node_web_push toneIndigo
class node_notification_api,node_notification_service,node_notification_data toneTeal
```

## Components

### Identity & Groups

- [Accounts & JWT](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/accounts/views.py): `backend/accounts/views.py`
- [User Profiles](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/accounts/models.py): `backend/accounts/models.py`
- [Group Management](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/groups/views.py): `backend/groups/views.py`
- [Groups & Memberships](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/groups/models.py): `backend/groups/models.py`

### Trip Planning

- [Trip & Itinerary API](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/trips/views.py): `backend/trips/views.py`
- [Trips & Activities](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/trips/models.py): `backend/trips/models.py`
- [Dashboard & Trip Pages](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/config/views.py): `backend/config/views.py`

### AI Services

- [AI Request Orchestrator](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/views.py): `backend/ai_agents/views.py`
- [AI Rate Limiter](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/rate_limiter.py): `backend/ai_agents/rate_limiter.py`
- [Itinerary Pathfinder](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/pathfinder.py): `backend/ai_agents/pathfinder.py`
- [Travel Concierge](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/concierge.py): `backend/ai_agents/concierge.py`

### Group Collaboration

- [Group Chat API](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/chat/views.py): `backend/chat/views.py`
- [AI Moderator](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/ai_agents/moderator.py): `backend/ai_agents/moderator.py`
- [Chat Messages](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/chat/models.py): `backend/chat/models.py`
- [Shared Checklists](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/checklists/views.py): `backend/checklists/views.py`
- [Checklist Items](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/checklists/models.py): `backend/checklists/models.py`

### Expense Management

- [Expense & Debt API](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/views.py): `backend/finance/views.py`
- [Transactions & Debts](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/models.py): `backend/finance/models.py`
- [Debt Simplifier](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/debt_simplifier.py): `backend/finance/debt_simplifier.py`
- [Currency Conversion](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/finance/currency.py): `backend/finance/currency.py`

### Notifications

- [Notification Preferences](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/views.py): `backend/notifications/views.py`
- [Web Push Service](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/services.py): `backend/notifications/services.py`
- [Notification Settings](https://github.com/razvanf7/ai-travel-agent/blob/main/backend/notifications/models.py): `backend/notifications/models.py`

### Other components

- **Traveler**
- **LLM Service**
- **Frankfurter API**
- **Web Push Service**

## Connections

- Traveler → Accounts & JWT: authenticates
- Accounts & JWT → User Profiles: creates profile (evidence: `backend/accounts/models.py`)
- Traveler → Group Management: creates or joins
- Group Management → Groups & Memberships: manages membership (evidence: `backend/groups/views.py`)
- Traveler → Trip & Itinerary API: plans trip
- Trip & Itinerary API → Trips & Activities: reads and writes (evidence: `backend/trips/views.py`)
- Dashboard & Trip Pages → Groups & Memberships: loads groups (evidence: `backend/config/views.py`)
- Dashboard & Trip Pages → Trips & Activities: loads trips (evidence: `backend/config/views.py`)
- AI Request Orchestrator → AI Rate Limiter: checks quota (evidence: `backend/ai_agents/views.py`)
- AI Request Orchestrator → Itinerary Pathfinder: generates itinerary (evidence: `backend/ai_agents/views.py`)
- AI Request Orchestrator → Travel Concierge: streams assistance (evidence: `backend/ai_agents/views.py`)
- Itinerary Pathfinder → LLM Service: requests generation
- Travel Concierge → LLM Service: requests responses
- AI Request Orchestrator → Trips & Activities: saves activities (evidence: `backend/ai_agents/views.py`)
- AI Request Orchestrator → Chat Messages: posts system message (evidence: `backend/ai_agents/views.py`)
- Traveler → Group Chat API: sends messages
- Group Chat API → AI Moderator: moderates message (evidence: `backend/chat/views.py`)
- Group Chat API → Chat Messages: reads and saves (evidence: `backend/chat/views.py`)
- Traveler → Shared Checklists: manages tasks
- Shared Checklists → Checklist Items: reads and writes (evidence: `backend/checklists/views.py`)
- Traveler → Expense & Debt API: logs expenses
- Expense & Debt API → Transactions & Debts: reads and writes (evidence: `backend/finance/views.py`)
- Expense & Debt API → Debt Simplifier: simplifies debts (evidence: `backend/finance/views.py`)
- Expense & Debt API → Currency Conversion: converts currency (evidence: `backend/finance/views.py`)
- Currency Conversion → Frankfurter API: fetches rates
- Traveler → Notification Preferences: sets preferences
- Notification Preferences → Notification Settings: reads and writes (evidence: `backend/notifications/views.py`)
- Web Push Service → Notification Settings: checks preferences (evidence: `backend/notifications/services.py`)
- Web Push Service → User Profiles: reads push tokens (evidence: `backend/notifications/services.py`)
- Web Push Service → Web Push Service: sends notification (evidence: `backend/notifications/services.py`)
