# shreyyyi/travelai architecture

> Architecture diagram of the GitHub repository shreyyyi/travelai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shreyyyi/travelai
- Repository: https://github.com/shreyyyi/travelai

## Overview

TravelAround AI is a group-trip planning and coordination application. Travelers create AI-assisted itineraries, explore and manage trips, request bookings, and collaborate through trip chat; organisers review bookings and manage trips. The graph reflects the documented AI planning, collaboration, budget, and validation capabilities, while source evidence is limited to the supplied excerpts and SOURCE INDEX. Unsampled feature connections are omitted or marked unverified.

Main entry points: [`client/src/main.jsx`](https://github.com/shreyyyi/travelai/blob/main/client/src/main.jsx) (App routes), [`server/index.js`](https://github.com/shreyyyi/travelai/blob/main/server/index.js) (HTTP and socket server), [`client/src/service/api.jsx`](https://github.com/shreyyyi/travelai/blob/main/client/src/service/api.jsx) (HTTP client), [`client/src/create-trip/index.jsx`](https://github.com/shreyyyi/travelai/blob/main/client/src/create-trip/index.jsx) (Trip builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Travel app"]
  node_router["App routes<br/>[main.jsx]"]
  node_auth["Session identity<br/>[AuthContext.jsx]"]
  node_chat_client["Trip chat<br/>[index.jsx]"]
  node_organiser_dashboard["Booking administration"]
  node_api["HTTP client<br/>[api.jsx]"]
end

subgraph group_planning["Trip planning"]
  node_trip_builder["Trip builder<br/>[index.jsx]"]
  node_ai_planner["AI itinerary service<br/>[AIModel.jsx]"]
  node_destination_search["Destination search"]
  node_trip_browse["Trip browsing<br/>[index.jsx]"]
  node_trip_details["Trip details<br/>[ViewDetails.jsx]"]
  node_itinerary["Itinerary display"]
  node_my_trips["My trips<br/>[index.jsx]"]
end

subgraph group_server["Application server"]
  node_server_entry["HTTP and socket server<br/>[index.js]"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_trip_routes["Trip routes<br/>[trips.js]"]
  node_booking_routes["Booking routes<br/>[bookings.js]"]
  node_organiser_routes["Organiser routes<br/>[organiser.js]"]
  node_message_routes["Message routes<br/>[messages.js]"]
  node_notification_routes["Notification routes<br/>[notifications.js]"]
  node_auth_middleware["Session authorization<br/>[authMiddleware.js]"]
end

subgraph group_data["Persistent data"]
  node_trip_store[("Trip records<br/>[Trip.js]")]
  node_booking_store[("Booking records<br/>[Booking.js]")]
  node_user_store[("User records<br/>[User.js]")]
  node_message_store[("Chat messages<br/>[Message.js]")]
  node_notification_store[("Notifications<br/>[Notification.js]")]
end

node_traveler(("Traveler"))
node_organiser(("Organiser"))

node_traveler -->|"uses"| node_router
node_organiser -->|"uses"| node_router
node_router -->|"routes to"| node_trip_builder
node_router -->|"routes to"| node_trip_browse
node_router -->|"routes to"| node_trip_details
node_router -->|"routes to"| node_my_trips
node_router -->|"routes to"| node_chat_client
node_router -->|"routes to"| node_organiser_dashboard
node_trip_builder -->|"uses"| node_destination_search
node_trip_builder -->|"requests itinerary"| node_ai_planner
node_trip_builder -->|"sends trip data"| node_api
node_trip_details -->|"renders"| node_itinerary
node_auth -->|"checks session"| node_api
node_chat_client -->|"uses"| node_api
node_my_trips -->|"uses"| node_api
node_organiser_dashboard -->|"uses"| node_api
node_api -.->|"calls REST API"| node_server_entry
node_server_entry -->|"mounts"| node_auth_routes
node_server_entry -->|"mounts"| node_trip_routes
node_server_entry -->|"mounts"| node_booking_routes
node_server_entry -->|"mounts"| node_organiser_routes
node_server_entry -->|"mounts"| node_message_routes
node_server_entry -->|"mounts"| node_notification_routes
node_auth_routes -->|"reads/writes"| node_user_store
node_trip_routes -->|"reads/writes"| node_trip_store
node_booking_routes -->|"reads/writes"| node_booking_store
node_organiser_routes -->|"reads/writes"| node_booking_store
node_organiser_routes -->|"reads/writes"| node_trip_store
node_message_routes -->|"reads/writes"| node_message_store
node_notification_routes -->|"reads/writes"| node_notification_store
node_trip_routes -->|"checks access"| node_auth_middleware
node_booking_routes -->|"checks access"| node_auth_middleware
node_organiser_routes -->|"checks access"| node_auth_middleware

click node_router "https://github.com/shreyyyi/travelai/blob/main/client/src/main.jsx"
click node_auth "https://github.com/shreyyyi/travelai/blob/main/client/src/context/AuthContext.jsx"
click node_trip_builder "https://github.com/shreyyyi/travelai/blob/main/client/src/create-trip/index.jsx"
click node_ai_planner "https://github.com/shreyyyi/travelai/blob/main/client/src/service/AIModel.jsx"
click node_destination_search "https://github.com/shreyyyi/travelai/blob/main/client/src/components/NominatimAutocomplete.jsx"
click node_trip_browse "https://github.com/shreyyyi/travelai/blob/main/client/src/view-trip/index.jsx"
click node_trip_details "https://github.com/shreyyyi/travelai/blob/main/client/src/view-trip/ViewDetails.jsx"
click node_itinerary "https://github.com/shreyyyi/travelai/blob/main/client/src/components/ItinerarySection.jsx"
click node_my_trips "https://github.com/shreyyyi/travelai/blob/main/client/src/my-trips/index.jsx"
click node_chat_client "https://github.com/shreyyyi/travelai/blob/main/client/src/chat/index.jsx"
click node_organiser_dashboard "https://github.com/shreyyyi/travelai/blob/main/client/src/pages/OrganiserDashboard.jsx"
click node_api "https://github.com/shreyyyi/travelai/blob/main/client/src/service/api.jsx"
click node_server_entry "https://github.com/shreyyyi/travelai/blob/main/server/index.js"
click node_auth_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/auth.js"
click node_trip_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/trips.js"
click node_booking_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/bookings.js"
click node_organiser_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/organiser.js"
click node_message_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/messages.js"
click node_notification_routes "https://github.com/shreyyyi/travelai/blob/main/server/routes/notifications.js"
click node_auth_middleware "https://github.com/shreyyyi/travelai/blob/main/server/middleware/authMiddleware.js"
click node_trip_store "https://github.com/shreyyyi/travelai/blob/main/server/models/Trip.js"
click node_booking_store "https://github.com/shreyyyi/travelai/blob/main/server/models/Booking.js"
click node_user_store "https://github.com/shreyyyi/travelai/blob/main/server/models/User.js"
click node_message_store "https://github.com/shreyyyi/travelai/blob/main/server/models/Message.js"
click node_notification_store "https://github.com/shreyyyi/travelai/blob/main/server/models/Notification.js"

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_router,node_auth,node_chat_client,node_organiser_dashboard,node_api toneBlue
class node_trip_builder,node_ai_planner,node_destination_search,node_trip_browse,node_trip_details,node_itinerary,node_my_trips toneAmber
class node_server_entry,node_auth_routes,node_trip_routes,node_booking_routes,node_organiser_routes,node_message_routes,node_notification_routes,node_auth_middleware toneMint
class node_trip_store,node_booking_store,node_user_store,node_message_store,node_notification_store toneRose
class node_traveler,node_organiser toneIndigo
```

## Components

### Travel app

- [App routes](https://github.com/shreyyyi/travelai/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [Session identity](https://github.com/shreyyyi/travelai/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Trip chat](https://github.com/shreyyyi/travelai/blob/main/client/src/chat/index.jsx): `client/src/chat/index.jsx`
- [Booking administration](https://github.com/shreyyyi/travelai/blob/main/client/src/pages/OrganiserDashboard.jsx): `client/src/pages/OrganiserDashboard.jsx`
- [HTTP client](https://github.com/shreyyyi/travelai/blob/main/client/src/service/api.jsx): `client/src/service/api.jsx`

### Trip planning

- [Trip builder](https://github.com/shreyyyi/travelai/blob/main/client/src/create-trip/index.jsx): `client/src/create-trip/index.jsx`
- [AI itinerary service](https://github.com/shreyyyi/travelai/blob/main/client/src/service/AIModel.jsx): `client/src/service/AIModel.jsx`
- [Destination search](https://github.com/shreyyyi/travelai/blob/main/client/src/components/NominatimAutocomplete.jsx): `client/src/components/NominatimAutocomplete.jsx`
- [Trip browsing](https://github.com/shreyyyi/travelai/blob/main/client/src/view-trip/index.jsx): `client/src/view-trip/index.jsx`
- [Trip details](https://github.com/shreyyyi/travelai/blob/main/client/src/view-trip/ViewDetails.jsx): `client/src/view-trip/ViewDetails.jsx`
- [Itinerary display](https://github.com/shreyyyi/travelai/blob/main/client/src/components/ItinerarySection.jsx): `client/src/components/ItinerarySection.jsx`
- [My trips](https://github.com/shreyyyi/travelai/blob/main/client/src/my-trips/index.jsx): `client/src/my-trips/index.jsx`

### Application server

- [HTTP and socket server](https://github.com/shreyyyi/travelai/blob/main/server/index.js): `server/index.js`
- [Authentication routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Trip routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/trips.js): `server/routes/trips.js`
- [Booking routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/bookings.js): `server/routes/bookings.js`
- [Organiser routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/organiser.js): `server/routes/organiser.js`
- [Message routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/messages.js): `server/routes/messages.js`
- [Notification routes](https://github.com/shreyyyi/travelai/blob/main/server/routes/notifications.js): `server/routes/notifications.js`
- [Session authorization](https://github.com/shreyyyi/travelai/blob/main/server/middleware/authMiddleware.js): `server/middleware/authMiddleware.js`

### Persistent data

- [Trip records](https://github.com/shreyyyi/travelai/blob/main/server/models/Trip.js): `server/models/Trip.js`
- [Booking records](https://github.com/shreyyyi/travelai/blob/main/server/models/Booking.js): `server/models/Booking.js`
- [User records](https://github.com/shreyyyi/travelai/blob/main/server/models/User.js): `server/models/User.js`
- [Chat messages](https://github.com/shreyyyi/travelai/blob/main/server/models/Message.js): `server/models/Message.js`
- [Notifications](https://github.com/shreyyyi/travelai/blob/main/server/models/Notification.js): `server/models/Notification.js`

### Other components

- **Traveler**
- **Organiser**

## Connections

- Traveler → App routes: uses (evidence: `client/src/main.jsx`)
- Organiser → App routes: uses (evidence: `client/src/main.jsx`)
- App routes → Trip builder: routes to (evidence: `client/src/main.jsx`)
- App routes → Trip browsing: routes to (evidence: `client/src/main.jsx`)
- App routes → Trip details: routes to (evidence: `client/src/main.jsx`)
- App routes → My trips: routes to (evidence: `client/src/main.jsx`)
- App routes → Trip chat: routes to (evidence: `client/src/main.jsx`)
- App routes → Booking administration: routes to (evidence: `client/src/main.jsx`)
- Trip builder → Destination search: uses (evidence: `client/src/create-trip/index.jsx`)
- Trip builder → AI itinerary service: requests itinerary (evidence: `client/src/create-trip/index.jsx`)
- Trip builder → HTTP client: sends trip data (evidence: `client/src/create-trip/index.jsx`)
- Trip details → Itinerary display: renders (evidence: `client/src/view-trip/ViewDetails.jsx`)
- Session identity → HTTP client: checks session (evidence: `client/src/context/AuthContext.jsx`)
- Trip chat → HTTP client: uses (evidence: `client/src/chat/index.jsx`)
- My trips → HTTP client: uses (evidence: `client/src/my-trips/index.jsx`)
- Booking administration → HTTP client: uses (evidence: `client/src/pages/OrganiserDashboard.jsx`)
- HTTP client → HTTP and socket server: calls REST API
- HTTP and socket server → Authentication routes: mounts (evidence: `server/index.js`)
- HTTP and socket server → Trip routes: mounts (evidence: `server/index.js`)
- HTTP and socket server → Booking routes: mounts (evidence: `server/index.js`)
- HTTP and socket server → Organiser routes: mounts (evidence: `server/index.js`)
- HTTP and socket server → Message routes: mounts (evidence: `server/index.js`)
- HTTP and socket server → Notification routes: mounts (evidence: `server/index.js`)
- Authentication routes → User records: reads/writes (evidence: `server/routes/auth.js`)
- Trip routes → Trip records: reads/writes (evidence: `server/routes/trips.js`)
- Booking routes → Booking records: reads/writes (evidence: `server/routes/bookings.js`)
- Organiser routes → Booking records: reads/writes (evidence: `server/routes/organiser.js`)
- Organiser routes → Trip records: reads/writes (evidence: `server/routes/organiser.js`)
- Message routes → Chat messages: reads/writes (evidence: `server/routes/messages.js`)
- Notification routes → Notifications: reads/writes (evidence: `server/routes/notifications.js`)
- Trip routes → Session authorization: checks access (evidence: `server/routes/trips.js`)
- Booking routes → Session authorization: checks access (evidence: `server/routes/bookings.js`)
- Organiser routes → Session authorization: checks access (evidence: `server/routes/organiser.js`)
