# pastaisfine/jet2holiday architecture

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

- Interactive diagram: https://gitdiagram.com/pastaisfine/jet2holiday
- Repository: https://github.com/pastaisfine/jet2holiday

## Overview

jet2holiday is a collaborative, AI-assisted group travel planner. Travellers set preferences, swipe and vote on activities, review generated itinerary options, refine and confirm a shared plan, and can search travel options or coordinate trip tasks. The graph follows the routed screens into documented service and state layers, then shows the storage and routing dependencies visible in the supplied excerpts or SOURCE INDEX. README capabilities such as map and route planning and PDF export are retained where documented, but unsampled implementation links are not asserted.

Main entry points: [`src/App.jsx`](https://github.com/pastaisfine/jet2holiday/blob/main/src/App.jsx) (App routing), [`src/pages/PlanScreen.jsx`](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/PlanScreen.jsx) (Plan editor), [`src/services/groupPlan.js`](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/groupPlan.js) (Group planning), [`src/pages/HubScreen.jsx`](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/HubScreen.jsx) (Trip hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Traveller experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_setup["Trip setup"]
  node_hub["Trip hub<br/>[HubScreen.jsx]"]
  node_tasks["Task coordination<br/>[TasksScreen.jsx]"]
  node_travel_search["Travel search"]
end

subgraph group_decisions["Group decisions"]
  node_swipe["Activity swipes<br/>[SwipeScreen.jsx]"]
  node_preference["Preference analysis<br/>[preference.js]"]
  node_preference_agent["Preference agent<br/>[index.ts]"]
  node_invite_links["Invite links<br/>[inviteLink.js]"]
  node_cards["Activity catalog<br/>[cards.js]"]
end

subgraph group_planning["Itinerary planning"]
  node_group_plan["Group planning<br/>[groupPlan.js]"]
  node_plan["Plan editor<br/>[PlanScreen.jsx]"]
  node_collaboration["Plan collaboration"]
  node_scheduler["Itinerary scheduler<br/>[scheduler.js]"]
  node_map_routing["Map and routing<br/>[mapbox.js]"]
  node_places["Place search"]
  node_date_utils["Trip dates<br/>[date.js]"]
end

subgraph group_platform["Services and state"]
  node_trip_service["Trip service<br/>[tripService.js]"]
  node_app_state["Trip state<br/>[useAppState.js]"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_supabase[("Supabase<br/>[supabase.js]")]
  node_task_agent["Task agent<br/>[taskAgent.js]"]
  node_search_service["Search service<br/>[travelSearch.js]"]
  node_travel_data["Travel options<br/>[travel.js]"]
end

node_traveller(("Traveller"))
node_external_travel(("Travel providers"))

node_traveller -->|"uses"| node_app
node_app -->|"routes to"| node_hub
node_app -->|"routes to"| node_setup
node_app -->|"routes to"| node_swipe
node_app -->|"routes to"| node_plan
node_app -->|"routes to"| node_tasks
node_app -->|"routes to"| node_travel_search
node_app -->|"provides auth"| node_auth
node_app -->|"creates state"| node_app_state
node_hub -->|"loads trip data"| node_trip_service
node_hub -->|"requests analysis"| node_preference
node_hub -->|"requests planning"| node_group_plan
node_swipe -->|"requests analysis"| node_preference
node_swipe -->|"uses activities"| node_cards
node_swipe -->|"loads trip data"| node_trip_service
node_preference -->|"reads and writes"| node_supabase
node_group_plan -->|"reads and writes"| node_supabase
node_group_plan -->|"uses scheduling"| node_scheduler
node_group_plan -->|"uses routing"| node_map_routing
node_plan -->|"reroutes and saves"| node_group_plan
node_plan -->|"updates suggestions"| node_collaboration
node_plan -->|"searches places"| node_places
node_plan -->|"parses dates"| node_date_utils
node_plan -->|"loads trip data"| node_trip_service
node_trip_service -->|"reads and writes"| node_supabase
node_app_state -->|"loads catalog"| node_cards
node_app_state -->|"loads tasks"| node_tasks
node_tasks -->|"parses requests"| node_task_agent
node_tasks -.->|"updates tasks"| node_app_state
node_travel_search -->|"searches options"| node_search_service
node_search_service -->|"uses fallback data"| node_travel_data
node_search_service -.->|"queries providers"| node_external_travel
node_traveller -.->|"shares invites"| node_invite_links
node_preference -.->|"invokes agent"| node_preference_agent

click node_app "https://github.com/pastaisfine/jet2holiday/blob/main/src/App.jsx"
click node_setup "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/SetupStep1Screen.jsx"
click node_hub "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/HubScreen.jsx"
click node_swipe "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/SwipeScreen.jsx"
click node_preference "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/preference.js"
click node_preference_agent "https://github.com/pastaisfine/jet2holiday/blob/main/supabase/functions/preference/index.ts"
click node_group_plan "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/groupPlan.js"
click node_plan "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/PlanScreen.jsx"
click node_collaboration "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/planCollaboration.js"
click node_scheduler "https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/scheduler.js"
click node_trip_service "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/tripService.js"
click node_app_state "https://github.com/pastaisfine/jet2holiday/blob/main/src/state/useAppState.js"
click node_auth "https://github.com/pastaisfine/jet2holiday/blob/main/src/context/AuthContext.jsx"
click node_supabase "https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/supabase.js"
click node_tasks "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/TasksScreen.jsx"
click node_task_agent "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/taskAgent.js"
click node_travel_search "https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/TravelSearchScreen.jsx"
click node_search_service "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/travelSearch.js"
click node_travel_data "https://github.com/pastaisfine/jet2holiday/blob/main/src/data/travel.js"
click node_map_routing "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/mapbox.js"
click node_places "https://github.com/pastaisfine/jet2holiday/blob/main/src/services/placesAutocomplete.js"
click node_invite_links "https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/inviteLink.js"
click node_cards "https://github.com/pastaisfine/jet2holiday/blob/main/src/data/cards.js"
click node_date_utils "https://github.com/pastaisfine/jet2holiday/blob/main/src/utils/date.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_app,node_setup,node_hub,node_tasks,node_travel_search toneBlue
class node_swipe,node_preference,node_preference_agent,node_invite_links,node_cards toneAmber
class node_group_plan,node_plan,node_collaboration,node_scheduler,node_map_routing,node_places,node_date_utils toneMint
class node_trip_service,node_app_state,node_auth,node_supabase,node_task_agent,node_search_service,node_travel_data toneRose
class node_traveller,node_external_travel toneIndigo
```

## Components

### Traveller experience

- [App routing](https://github.com/pastaisfine/jet2holiday/blob/main/src/App.jsx): `src/App.jsx`
- [Trip setup](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/SetupStep1Screen.jsx): `src/pages/SetupStep1Screen.jsx`
- [Trip hub](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/HubScreen.jsx): `src/pages/HubScreen.jsx`
- [Task coordination](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/TasksScreen.jsx): `src/pages/TasksScreen.jsx`
- [Travel search](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/TravelSearchScreen.jsx): `src/pages/TravelSearchScreen.jsx`

### Group decisions

- [Activity swipes](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/SwipeScreen.jsx): `src/pages/SwipeScreen.jsx`
- [Preference analysis](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/preference.js): `src/services/preference.js`
- [Preference agent](https://github.com/pastaisfine/jet2holiday/blob/main/supabase/functions/preference/index.ts): `supabase/functions/preference/index.ts`
- [Invite links](https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/inviteLink.js): `src/lib/inviteLink.js`
- [Activity catalog](https://github.com/pastaisfine/jet2holiday/blob/main/src/data/cards.js): `src/data/cards.js`

### Itinerary planning

- [Group planning](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/groupPlan.js): `src/services/groupPlan.js`
- [Plan editor](https://github.com/pastaisfine/jet2holiday/blob/main/src/pages/PlanScreen.jsx): `src/pages/PlanScreen.jsx`
- [Plan collaboration](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/planCollaboration.js): `src/services/planCollaboration.js`
- [Itinerary scheduler](https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/scheduler.js): `src/lib/scheduler.js`
- [Map and routing](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/mapbox.js): `src/services/mapbox.js`
- [Place search](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/placesAutocomplete.js): `src/services/placesAutocomplete.js`
- [Trip dates](https://github.com/pastaisfine/jet2holiday/blob/main/src/utils/date.js): `src/utils/date.js`

### Services and state

- [Trip service](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/tripService.js): `src/services/tripService.js`
- [Trip state](https://github.com/pastaisfine/jet2holiday/blob/main/src/state/useAppState.js): `src/state/useAppState.js`
- [Authentication](https://github.com/pastaisfine/jet2holiday/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Supabase](https://github.com/pastaisfine/jet2holiday/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- [Task agent](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/taskAgent.js): `src/services/taskAgent.js`
- [Search service](https://github.com/pastaisfine/jet2holiday/blob/main/src/services/travelSearch.js): `src/services/travelSearch.js`
- [Travel options](https://github.com/pastaisfine/jet2holiday/blob/main/src/data/travel.js): `src/data/travel.js`

### Other components

- **Traveller**
- **Travel providers**

## Connections

- Traveller → App routing: uses
- App routing → Trip hub: routes to (evidence: `src/App.jsx`)
- App routing → Trip setup: routes to (evidence: `src/App.jsx`)
- App routing → Activity swipes: routes to (evidence: `src/App.jsx`)
- App routing → Plan editor: routes to (evidence: `src/App.jsx`)
- App routing → Task coordination: routes to (evidence: `src/App.jsx`)
- App routing → Travel search: routes to (evidence: `src/App.jsx`)
- App routing → Authentication: provides auth (evidence: `src/App.jsx`)
- App routing → Trip state: creates state (evidence: `src/App.jsx`)
- Trip hub → Trip service: loads trip data (evidence: `src/pages/HubScreen.jsx`)
- Trip hub → Preference analysis: requests analysis (evidence: `src/pages/HubScreen.jsx`)
- Trip hub → Group planning: requests planning (evidence: `src/pages/HubScreen.jsx`)
- Activity swipes → Preference analysis: requests analysis (evidence: `src/pages/SwipeScreen.jsx`)
- Activity swipes → Activity catalog: uses activities (evidence: `src/pages/SwipeScreen.jsx`)
- Activity swipes → Trip service: loads trip data (evidence: `src/pages/SwipeScreen.jsx`)
- Preference analysis → Supabase: reads and writes (evidence: `src/services/preference.js`)
- Group planning → Supabase: reads and writes (evidence: `src/services/groupPlan.js`)
- Group planning → Itinerary scheduler: uses scheduling (evidence: `src/services/groupPlan.js`)
- Group planning → Map and routing: uses routing (evidence: `src/services/groupPlan.js`)
- Plan editor → Group planning: reroutes and saves (evidence: `src/pages/PlanScreen.jsx`)
- Plan editor → Plan collaboration: updates suggestions (evidence: `src/pages/PlanScreen.jsx`)
- Plan editor → Place search: searches places (evidence: `src/pages/PlanScreen.jsx`)
- Plan editor → Trip dates: parses dates (evidence: `src/pages/PlanScreen.jsx`)
- Plan editor → Trip service: loads trip data (evidence: `src/pages/PlanScreen.jsx`)
- Trip service → Supabase: reads and writes (evidence: `src/services/tripService.js`)
- Trip state → Activity catalog: loads catalog (evidence: `src/state/useAppState.js`)
- Trip state → Task coordination: loads tasks (evidence: `src/state/useAppState.js`)
- Task coordination → Task agent: parses requests (evidence: `src/pages/TasksScreen.jsx`)
- Task coordination → Trip state: updates tasks
- Travel search → Search service: searches options (evidence: `src/pages/TravelSearchScreen.jsx`)
- Search service → Travel options: uses fallback data (evidence: `src/services/travelSearch.js`)
- Search service → Travel providers: queries providers
- Traveller → Invite links: shares invites
- Preference analysis → Preference agent: invokes agent
