# leotkiet/blind-box-travelling architecture

> Architecture diagram of the GitHub repository leotkiet/blind-box-travelling, 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/leotkiet/blind-box-travelling
- Repository: https://github.com/leotkiet/blind-box-travelling

## Overview

Blind Box Travelling lets travelers choose a location and radius, then reveal a nearby surprise destination; text queries use a separate smart-search path. The app also provides map and nearby-place discovery, AI-generated trip hints with weather, chat, and group travel. Edges follow shown calls or README statements; unsampled route behavior and data-pipeline wiring are not inferred.

Main entry points: [`src/components/AppContent.tsx`](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/AppContent.tsx) (App State), [`src/lib/smartSearch.ts`](https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/smartSearch.ts) (Intent Search), [`src/app/api/location/route.ts`](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/location/route.ts) (Nearby Places API), [`src/lib/groq.ts`](https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/groq.ts) (AI Content Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Traveler Experience"]
  node_app["App State<br/>[AppContent.tsx]"]
  node_blindpanel["Blind Box Panel<br/>[BlindBoxPanel.tsx]"]
  node_map["Interactive Map<br/>[MapView.tsx]"]
  node_chat["Travel Chat<br/>[ChatBox.tsx]"]
  node_grouptravel["Group Travel<br/>[GroupTravel.tsx]"]
  node_header["App Header<br/>[Header.tsx]"]
  node_userbutton["Account Controls<br/>[UserButton.tsx]"]
end

subgraph group_discovery["Destination Discovery"]
  node_blindapi["Blind Box Selection<br/>[route.ts]"]
  node_smartapi["Smart Search API<br/>[route.ts]"]
  node_smartsearch["Intent Search<br/>[smartSearch.ts]"]
  node_locationapi["Nearby Places API<br/>[route.ts]"]
end

subgraph group_assist["AI Trip Assistance"]
  node_chatapi["Chat API<br/>[route.ts]"]
  node_experienceapi["AI Experience API<br/>[route.ts]"]
  node_groq["AI Content Generator<br/>[groq.ts]"]
  node_weather["Weather Lookup<br/>[weather.ts]"]
end

subgraph group_identity["Identity and Data"]
  node_supaclient["Browser Supabase Client<br/>[client.ts]"]
  node_supaserver["Server Supabase Client<br/>[server.ts]"]
  node_login["Login<br/>[page.tsx]"]
  node_callback["Auth Callback<br/>[route.ts]"]
  node_proxy["Session Proxy<br/>[proxy.ts]"]
  node_proxyentry["Request Proxy<br/>[proxy.ts]"]
end

node_traveler(("Traveler"))
node_groqservice{{"Groq AI"}}
node_weatherapi{{"OpenWeather"}}
node_mapbox{{"Mapbox Geocoding"}}
node_locations[("Locations Store")]

node_traveler -->|"uses"| node_app
node_app -->|"renders"| node_blindpanel
node_app -->|"renders"| node_map
node_app -->|"renders"| node_chat
node_app -->|"requests"| node_blindapi
node_app -->|"requests"| node_smartapi
node_app -->|"generates hints"| node_groq
node_blindpanel -->|"renders"| node_grouptravel
node_header -->|"renders"| node_userbutton
node_chat -->|"requests nearby"| node_locationapi
node_chat -->|"sends messages"| node_chatapi
node_blindapi -->|"queries"| node_supaserver
node_blindapi -->|"reads places"| node_locations
node_smartapi -->|"runs search"| node_smartsearch
node_smartsearch -->|"queries"| node_supaserver
node_smartsearch -->|"parses intent"| node_groqservice
node_smartsearch -.->|"filters places"| node_locations
node_locationapi -->|"reverse geocodes"| node_mapbox
node_locationapi -->|"queries"| node_supaserver
node_locationapi -->|"reads places"| node_locations
node_app -.->|"optional experience"| node_experienceapi
node_experienceapi -->|"gets conditions"| node_weather
node_experienceapi -->|"generates content"| node_groq
node_groq -->|"gets conditions"| node_weather
node_groq -->|"generates content"| node_groqservice
node_weather -->|"fetches forecast"| node_weatherapi
node_login -->|"authenticates"| node_supaclient
node_userbutton -->|"uses session"| node_supaclient
node_callback -->|"exchanges session"| node_supaserver
node_proxyentry -->|"delegates"| node_proxy

click node_app "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/AppContent.tsx"
click node_blindpanel "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/BlindBoxPanel.tsx"
click node_map "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/MapView.tsx"
click node_chat "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/ChatBox.tsx"
click node_grouptravel "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/GroupTravel.tsx"
click node_header "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/Header.tsx"
click node_userbutton "https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/UserButton.tsx"
click node_blindapi "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/blind-box/route.ts"
click node_smartapi "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/smart-search/route.ts"
click node_smartsearch "https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/smartSearch.ts"
click node_locationapi "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/location/route.ts"
click node_chatapi "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/chat/route.ts"
click node_experienceapi "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/ai-experience/route.ts"
click node_groq "https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/groq.ts"
click node_weather "https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/weather.ts"
click node_supaclient "https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/client.ts"
click node_supaserver "https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/server.ts"
click node_login "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/login/page.tsx"
click node_callback "https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/auth/callback/route.ts"
click node_proxy "https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/proxy.ts"
click node_proxyentry "https://github.com/leotkiet/blind-box-travelling/blob/main/src/proxy.ts"

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_blindpanel,node_map,node_chat,node_grouptravel,node_header,node_userbutton toneBlue
class node_blindapi,node_smartapi,node_smartsearch,node_locationapi,node_locations toneAmber
class node_chatapi,node_experienceapi,node_groq,node_weather toneMint
class node_supaclient,node_supaserver,node_login,node_callback,node_proxy,node_proxyentry toneRose
class node_traveler,node_groqservice,node_weatherapi,node_mapbox toneIndigo
```

## Components

### Traveler Experience

- [App State](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/AppContent.tsx): `src/components/AppContent.tsx`
- [Blind Box Panel](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/BlindBoxPanel.tsx): `src/components/BlindBoxPanel.tsx`
- [Interactive Map](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/MapView.tsx): `src/components/MapView.tsx`
- [Travel Chat](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/ChatBox.tsx): `src/components/ChatBox.tsx`
- [Group Travel](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/GroupTravel.tsx): `src/components/GroupTravel.tsx`
- [App Header](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Account Controls](https://github.com/leotkiet/blind-box-travelling/blob/main/src/components/UserButton.tsx): `src/components/UserButton.tsx`

### Destination Discovery

- [Blind Box Selection](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/blind-box/route.ts): `src/app/api/blind-box/route.ts`
- [Smart Search API](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/smart-search/route.ts): `src/app/api/smart-search/route.ts`
- [Intent Search](https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/smartSearch.ts): `src/lib/smartSearch.ts`
- [Nearby Places API](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/location/route.ts): `src/app/api/location/route.ts`

### AI Trip Assistance

- [Chat API](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`
- [AI Experience API](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/api/ai-experience/route.ts): `src/app/api/ai-experience/route.ts`
- [AI Content Generator](https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/groq.ts): `src/lib/groq.ts`
- [Weather Lookup](https://github.com/leotkiet/blind-box-travelling/blob/main/src/lib/weather.ts): `src/lib/weather.ts`

### Identity and Data

- [Browser Supabase Client](https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/client.ts): `src/utils/supabase/client.ts`
- [Server Supabase Client](https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/server.ts): `src/utils/supabase/server.ts`
- [Login](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth Callback](https://github.com/leotkiet/blind-box-travelling/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Session Proxy](https://github.com/leotkiet/blind-box-travelling/blob/main/src/utils/supabase/proxy.ts): `src/utils/supabase/proxy.ts`
- [Request Proxy](https://github.com/leotkiet/blind-box-travelling/blob/main/src/proxy.ts): `src/proxy.ts`

### Other components

- **Traveler**
- **Groq AI**
- **OpenWeather**
- **Mapbox Geocoding**
- **Locations Store**

## Connections

- Traveler → App State: uses (evidence: `README.md`)
- App State → Blind Box Panel: renders (evidence: `src/components/AppContent.tsx`)
- App State → Interactive Map: renders (evidence: `src/components/AppContent.tsx`)
- App State → Travel Chat: renders (evidence: `src/components/AppContent.tsx`)
- App State → Blind Box Selection: requests (evidence: `src/components/AppContent.tsx`)
- App State → Smart Search API: requests (evidence: `src/components/AppContent.tsx`)
- App State → AI Content Generator: generates hints (evidence: `src/components/AppContent.tsx`)
- Blind Box Panel → Group Travel: renders (evidence: `src/components/BlindBoxPanel.tsx`)
- App Header → Account Controls: renders (evidence: `src/components/Header.tsx`)
- Travel Chat → Nearby Places API: requests nearby (evidence: `src/components/ChatBox.tsx`)
- Travel Chat → Chat API: sends messages (evidence: `src/components/ChatBox.tsx`)
- Blind Box Selection → Server Supabase Client: queries (evidence: `src/app/api/blind-box/route.ts`)
- Blind Box Selection → Locations Store: reads places (evidence: `src/app/api/blind-box/route.ts`)
- Smart Search API → Intent Search: runs search (evidence: `src/app/api/smart-search/route.ts`)
- Intent Search → Server Supabase Client: queries (evidence: `src/lib/smartSearch.ts`)
- Intent Search → Groq AI: parses intent (evidence: `src/lib/smartSearch.ts`)
- Intent Search → Locations Store: filters places
- Nearby Places API → Mapbox Geocoding: reverse geocodes (evidence: `src/app/api/location/route.ts`)
- Nearby Places API → Server Supabase Client: queries (evidence: `src/app/api/location/route.ts`)
- Nearby Places API → Locations Store: reads places (evidence: `src/app/api/location/route.ts`)
- App State → AI Experience API: optional experience
- AI Experience API → Weather Lookup: gets conditions (evidence: `src/app/api/ai-experience/route.ts`)
- AI Experience API → AI Content Generator: generates content (evidence: `src/app/api/ai-experience/route.ts`)
- AI Content Generator → Weather Lookup: gets conditions (evidence: `src/lib/groq.ts`)
- AI Content Generator → Groq AI: generates content (evidence: `src/lib/groq.ts`)
- Weather Lookup → OpenWeather: fetches forecast (evidence: `src/lib/weather.ts`)
- Login → Browser Supabase Client: authenticates (evidence: `src/app/login/page.tsx`)
- Account Controls → Browser Supabase Client: uses session (evidence: `src/components/UserButton.tsx`)
- Auth Callback → Server Supabase Client: exchanges session (evidence: `src/app/auth/callback/route.ts`)
- Request Proxy → Session Proxy: delegates (evidence: `src/proxy.ts`)
