# kakarla7/tripcraft architecture

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

- Interactive diagram: https://gitdiagram.com/kakarla7/tripcraft
- Repository: https://github.com/kakarla7/tripcraft

## Overview

TripCraft is a Streamlit AI trip-discovery app. The main workflow is traveller input, parallel destination/weather/budget recommendations, ranking, then results that can be saved, shared, or compared. Signed-in users can also revisit saved trips and searches. The excerpts show the search orchestration, ranking, persistence helpers, and sharing implementation; My Trips and several page interactions are unsampled, so those links are marked unverified. The README describes future itinerary and personal-space features, not implemented runtime components.

Main entry points: [`pages/1_Search.py`](https://github.com/kakarla7/tripcraft/blob/main/pages/1_Search.py) (Trip search), [`pages/2_Results.py`](https://github.com/kakarla7/tripcraft/blob/main/pages/2_Results.py) (Destination results), [`utils/supabase_client.py`](https://github.com/kakarla7/tripcraft/blob/main/utils/supabase_client.py) (Supabase access), [`utils/share.py`](https://github.com/kakarla7/tripcraft/blob/main/utils/share.py) (Share links)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Trip discovery"]
  node_home["Home and navigation<br/>[app.py]"]
  node_search["Trip search<br/>[1_Search.py]"]
  node_citylist["City options<br/>[cities.py]"]
  node_destination["Destination agent"]
  node_weather["Weather agent<br/>[weather_agent.py]"]
  node_budget["Budget agent<br/>[budget_agent.py]"]
  node_comparator["Ranking agent"]
end

subgraph group_results["Results and comparison"]
  node_results["Destination results<br/>[2_Results.py]"]
  node_compare["Destination comparison<br/>[3_Compare.py]"]
end

subgraph group_account["Account and trips"]
  node_mytrips["My Trips<br/>[4_My_Trips.py]"]
  node_loginpage["Login page<br/>[5_Login.py]"]
  node_auth["Authentication<br/>[auth.py]"]
end

subgraph group_shared["Shared services"]
  node_supabaseclient["Supabase access<br/>[supabase_client.py]"]
  node_sharing["Share links<br/>[share.py]"]
  node_mobile["Mobile layout<br/>[mobile.py]"]
  node_jsonparser["Claude JSON parser<br/>[json_parser.py]"]
end

node_traveller(("Traveller"))
node_anthropic{{"Anthropic Claude"}}
node_database[("Supabase database")]
node_browser{{"Browser share APIs"}}

node_traveller -->|"opens"| node_home
node_home -->|"navigates"| node_search
node_search -->|"offers cities"| node_citylist
node_search -->|"injects layout"| node_mobile
node_search -->|"requests matches"| node_destination
node_search -->|"requests weather"| node_weather
node_search -->|"requests costs"| node_budget
node_search -->|"requests ranking"| node_comparator
node_destination -->|"queries model"| node_anthropic
node_budget -->|"queries model"| node_anthropic
node_comparator -->|"queries model"| node_anthropic
node_weather -.->|"queries model"| node_anthropic
node_destination -->|"parses response"| node_jsonparser
node_weather -->|"parses response"| node_jsonparser
node_budget -->|"parses response"| node_jsonparser
node_comparator -->|"parses response"| node_jsonparser
node_search -->|"opens results"| node_results
node_results -->|"saves and loads"| node_supabaseclient
node_results -->|"creates share link"| node_sharing
node_results -->|"injects layout"| node_mobile
node_results -.->|"opens comparison"| node_compare
node_compare -->|"loads comparison"| node_supabaseclient
node_compare -.->|"shares comparison"| node_sharing
node_mytrips -.->|"accesses saved trips"| node_supabaseclient
node_mytrips -.->|"shares saved trips"| node_sharing
node_loginpage -.->|"renders sign-in"| node_auth
node_home -->|"renders account nav"| node_auth
node_auth -->|"gets client"| node_supabaseclient
node_supabaseclient -->|"reads and writes"| node_database
node_sharing -->|"invokes share APIs"| node_browser

click node_home "https://github.com/kakarla7/tripcraft/blob/main/app.py"
click node_search "https://github.com/kakarla7/tripcraft/blob/main/pages/1_Search.py"
click node_citylist "https://github.com/kakarla7/tripcraft/blob/main/utils/cities.py"
click node_destination "https://github.com/kakarla7/tripcraft/blob/main/agents/destination_agent.py"
click node_weather "https://github.com/kakarla7/tripcraft/blob/main/agents/weather_agent.py"
click node_budget "https://github.com/kakarla7/tripcraft/blob/main/agents/budget_agent.py"
click node_comparator "https://github.com/kakarla7/tripcraft/blob/main/agents/comparator_agent.py"
click node_results "https://github.com/kakarla7/tripcraft/blob/main/pages/2_Results.py"
click node_compare "https://github.com/kakarla7/tripcraft/blob/main/pages/3_Compare.py"
click node_mytrips "https://github.com/kakarla7/tripcraft/blob/main/pages/4_My_Trips.py"
click node_loginpage "https://github.com/kakarla7/tripcraft/blob/main/pages/5_Login.py"
click node_auth "https://github.com/kakarla7/tripcraft/blob/main/utils/auth.py"
click node_supabaseclient "https://github.com/kakarla7/tripcraft/blob/main/utils/supabase_client.py"
click node_sharing "https://github.com/kakarla7/tripcraft/blob/main/utils/share.py"
click node_mobile "https://github.com/kakarla7/tripcraft/blob/main/utils/mobile.py"
click node_jsonparser "https://github.com/kakarla7/tripcraft/blob/main/utils/json_parser.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_home,node_search,node_citylist,node_destination,node_weather,node_budget,node_comparator,node_browser toneBlue
class node_results,node_compare,node_database toneAmber
class node_mytrips,node_loginpage,node_auth toneMint
class node_supabaseclient,node_sharing,node_mobile,node_jsonparser toneRose
class node_traveller,node_anthropic toneIndigo
```

## Components

### Trip discovery

- [Home and navigation](https://github.com/kakarla7/tripcraft/blob/main/app.py): `app.py`
- [Trip search](https://github.com/kakarla7/tripcraft/blob/main/pages/1_Search.py): `pages/1_Search.py`
- [City options](https://github.com/kakarla7/tripcraft/blob/main/utils/cities.py): `utils/cities.py`
- [Destination agent](https://github.com/kakarla7/tripcraft/blob/main/agents/destination_agent.py): `agents/destination_agent.py`
- [Weather agent](https://github.com/kakarla7/tripcraft/blob/main/agents/weather_agent.py): `agents/weather_agent.py`
- [Budget agent](https://github.com/kakarla7/tripcraft/blob/main/agents/budget_agent.py): `agents/budget_agent.py`
- [Ranking agent](https://github.com/kakarla7/tripcraft/blob/main/agents/comparator_agent.py): `agents/comparator_agent.py`

### Results and comparison

- [Destination results](https://github.com/kakarla7/tripcraft/blob/main/pages/2_Results.py): `pages/2_Results.py`
- [Destination comparison](https://github.com/kakarla7/tripcraft/blob/main/pages/3_Compare.py): `pages/3_Compare.py`

### Account and trips

- [My Trips](https://github.com/kakarla7/tripcraft/blob/main/pages/4_My_Trips.py): `pages/4_My_Trips.py`
- [Login page](https://github.com/kakarla7/tripcraft/blob/main/pages/5_Login.py): `pages/5_Login.py`
- [Authentication](https://github.com/kakarla7/tripcraft/blob/main/utils/auth.py): `utils/auth.py`

### Shared services

- [Supabase access](https://github.com/kakarla7/tripcraft/blob/main/utils/supabase_client.py): `utils/supabase_client.py`
- [Share links](https://github.com/kakarla7/tripcraft/blob/main/utils/share.py): `utils/share.py`
- [Mobile layout](https://github.com/kakarla7/tripcraft/blob/main/utils/mobile.py): `utils/mobile.py`
- [Claude JSON parser](https://github.com/kakarla7/tripcraft/blob/main/utils/json_parser.py): `utils/json_parser.py`

### Other components

- **Traveller**
- **Anthropic Claude**
- **Supabase database**
- **Browser share APIs**

## Connections

- Traveller → Home and navigation: opens (evidence: `README.md`)
- Home and navigation → Trip search: navigates (evidence: `app.py`)
- Trip search → City options: offers cities (evidence: `pages/1_Search.py`)
- Trip search → Mobile layout: injects layout (evidence: `pages/1_Search.py`)
- Trip search → Destination agent: requests matches (evidence: `pages/1_Search.py`)
- Trip search → Weather agent: requests weather (evidence: `pages/1_Search.py`)
- Trip search → Budget agent: requests costs (evidence: `pages/1_Search.py`)
- Trip search → Ranking agent: requests ranking (evidence: `pages/1_Search.py`)
- Destination agent → Anthropic Claude: queries model (evidence: `agents/destination_agent.py`)
- Budget agent → Anthropic Claude: queries model (evidence: `agents/budget_agent.py`)
- Ranking agent → Anthropic Claude: queries model (evidence: `agents/comparator_agent.py`)
- Weather agent → Anthropic Claude: queries model (evidence: `README.md`)
- Destination agent → Claude JSON parser: parses response (evidence: `agents/destination_agent.py`)
- Weather agent → Claude JSON parser: parses response (evidence: `agents/weather_agent.py`)
- Budget agent → Claude JSON parser: parses response (evidence: `agents/budget_agent.py`)
- Ranking agent → Claude JSON parser: parses response (evidence: `agents/comparator_agent.py`)
- Trip search → Destination results: opens results (evidence: `pages/1_Search.py`)
- Destination results → Supabase access: saves and loads (evidence: `pages/2_Results.py`)
- Destination results → Share links: creates share link (evidence: `pages/2_Results.py`)
- Destination results → Mobile layout: injects layout (evidence: `pages/2_Results.py`)
- Destination results → Destination comparison: opens comparison (evidence: `README.md`)
- Destination comparison → Supabase access: loads comparison (evidence: `pages/3_Compare.py`)
- Destination comparison → Share links: shares comparison (evidence: `README.md`)
- My Trips → Supabase access: accesses saved trips (evidence: `pages/4_My_Trips.py`)
- My Trips → Share links: shares saved trips (evidence: `pages/4_My_Trips.py`)
- Login page → Authentication: renders sign-in (evidence: `pages/5_Login.py`)
- Home and navigation → Authentication: renders account nav (evidence: `app.py`)
- Authentication → Supabase access: gets client (evidence: `utils/auth.py`)
- Supabase access → Supabase database: reads and writes (evidence: `utils/supabase_client.py`)
- Share links → Browser share APIs: invokes share APIs (evidence: `utils/share.py`)
