# keerthipatil600/coastal-side-wanderer architecture

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

- Interactive diagram: https://gitdiagram.com/keerthipatil600/coastal-side-wanderer
- Repository: https://github.com/keerthipatil600/coastal-side-wanderer

## Overview

CoastWise AI is a Coastal Karnataka trip-planning application. A traveler submits trip preferences through the planning flow; the server-side engine retrieves curated knowledge, ranks and routes options, fits costs to budget, and can use an LLM for itinerary narrative. Users can explore itinerary details, save trips offline, manage favorites, and submit feedback. The README also describes admin knowledge-base ingestion and booking/map integrations; links for unsampled implementation details are omitted or marked optional.

Main entry points: [`src/components/coastwise/ItineraryView.tsx`](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/ItineraryView.tsx) (Itinerary view), [`src/lib/coastwise/engine.server.ts`](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/engine.server.ts) (Trip engine), [`src/lib/coastwise/plan.functions.ts`](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/plan.functions.ts) (Plan functions), [`src/routes/dashboard.tsx`](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/dashboard.tsx) (Trip dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Trip planning"]
  node_home["CoastWise home<br/>[index.tsx]"]
  node_tripform["Trip preferences<br/>[TripForm.tsx]"]
  node_planroute["Plan route<br/>[plan.tsx]"]
  node_planfunctions["Plan functions<br/>[plan.functions.ts]"]
end

subgraph group_knowledge["Planning engine"]
  node_engine["Trip engine<br/>[engine.server.ts]"]
  node_knowledgebase["Knowledge retrieval<br/>[kb.server.ts]"]
  node_aicopy["LLM narrative<br/>[ai.server.ts]"]
end

subgraph group_experience["Trip experience"]
  node_itinerary["Itinerary view<br/>[ItineraryView.tsx]"]
  node_budget["Budget breakdown<br/>[BudgetPanel.tsx]"]
  node_assistant["Trip assistant<br/>[Assistant.tsx]"]
  node_maps["Route maps<br/>[maps.functions.ts]"]
  node_mapview["Trip map<br/>[TripMap.tsx]"]
  node_booking["Booking links<br/>[booking.ts]"]
  node_dashboard["Trip dashboard<br/>[dashboard.tsx]"]
end

subgraph group_platform["Persistence and integrations"]
  node_storage["Local trip storage<br/>[storage.ts]"]
  node_serviceworker["Offline cache<br/>[sw.js]"]
  node_admin["Admin tools<br/>[admin.tsx]"]
end

node_traveler(("Traveler"))
node_llm{{"LLM service"}}
node_supabase[("Supabase")]

node_traveler -->|"opens"| node_home
node_home -->|"starts planning"| node_planroute
node_planroute -->|"collects input"| node_tripform
node_tripform -->|"submits trip"| node_planfunctions
node_planfunctions -->|"builds plan"| node_engine
node_engine -->|"retrieves records"| node_knowledgebase
node_engine -->|"loads feedback signal"| node_knowledgebase
node_engine -->|"requests narrative"| node_aicopy
node_aicopy -.->|"generates copy"| node_llm
node_planfunctions -->|"returns plan"| node_itinerary
node_itinerary -->|"shows costs"| node_budget
node_itinerary -->|"shows route"| node_mapview
node_mapview -->|"requests map data"| node_maps
node_itinerary -->|"offers booking links"| node_booking
node_assistant -->|"requests trip changes"| node_planfunctions
node_traveler -->|"manages trips"| node_dashboard
node_dashboard -->|"reads and saves"| node_storage
node_itinerary -->|"saves trip and feedback"| node_storage
node_serviceworker -->|"serves cached shell"| node_dashboard
node_admin -.->|"manages knowledge base"| node_knowledgebase
node_admin -.->|"admin data access"| node_supabase

click node_home "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/index.tsx"
click node_tripform "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/TripForm.tsx"
click node_planroute "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/plan.tsx"
click node_planfunctions "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/plan.functions.ts"
click node_engine "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/engine.server.ts"
click node_knowledgebase "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/kb.server.ts"
click node_aicopy "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/ai.server.ts"
click node_itinerary "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/ItineraryView.tsx"
click node_budget "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/BudgetPanel.tsx"
click node_assistant "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/Assistant.tsx"
click node_maps "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/maps.functions.ts"
click node_mapview "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/TripMap.tsx"
click node_booking "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/booking.ts"
click node_dashboard "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/dashboard.tsx"
click node_storage "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/storage.ts"
click node_serviceworker "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/public/sw.js"
click node_admin "https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/admin.tsx"

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_tripform,node_planroute,node_planfunctions toneBlue
class node_engine,node_knowledgebase,node_aicopy,node_supabase toneAmber
class node_itinerary,node_budget,node_assistant,node_maps,node_mapview,node_booking,node_dashboard toneMint
class node_storage,node_serviceworker,node_admin toneRose
class node_traveler,node_llm toneIndigo
```

## Components

### Trip planning

- [CoastWise home](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Trip preferences](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/TripForm.tsx): `src/components/coastwise/TripForm.tsx`
- [Plan route](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/plan.tsx): `src/routes/plan.tsx`
- [Plan functions](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/plan.functions.ts): `src/lib/coastwise/plan.functions.ts`

### Planning engine

- [Trip engine](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/engine.server.ts): `src/lib/coastwise/engine.server.ts`
- [Knowledge retrieval](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/kb.server.ts): `src/lib/coastwise/kb.server.ts`
- [LLM narrative](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/ai.server.ts): `src/lib/coastwise/ai.server.ts`

### Trip experience

- [Itinerary view](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/ItineraryView.tsx): `src/components/coastwise/ItineraryView.tsx`
- [Budget breakdown](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/BudgetPanel.tsx): `src/components/coastwise/BudgetPanel.tsx`
- [Trip assistant](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/Assistant.tsx): `src/components/coastwise/Assistant.tsx`
- [Route maps](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/maps.functions.ts): `src/lib/coastwise/maps.functions.ts`
- [Trip map](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/components/coastwise/TripMap.tsx): `src/components/coastwise/TripMap.tsx`
- [Booking links](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/booking.ts): `src/lib/coastwise/booking.ts`
- [Trip dashboard](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`

### Persistence and integrations

- [Local trip storage](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/lib/coastwise/storage.ts): `src/lib/coastwise/storage.ts`
- [Offline cache](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/public/sw.js): `public/sw.js`
- [Admin tools](https://github.com/keerthipatil600/coastal-side-wanderer/blob/main/src/routes/admin.tsx): `src/routes/admin.tsx`

### Other components

- **Traveler**
- **LLM service**
- **Supabase**

## Connections

- Traveler → CoastWise home: opens
- CoastWise home → Plan route: starts planning
- Plan route → Trip preferences: collects input
- Trip preferences → Plan functions: submits trip
- Plan functions → Trip engine: builds plan
- Trip engine → Knowledge retrieval: retrieves records
- Trip engine → Knowledge retrieval: loads feedback signal
- Trip engine → LLM narrative: requests narrative
- LLM narrative → LLM service: generates copy
- Plan functions → Itinerary view: returns plan
- Itinerary view → Budget breakdown: shows costs
- Itinerary view → Trip map: shows route
- Trip map → Route maps: requests map data
- Itinerary view → Booking links: offers booking links
- Trip assistant → Plan functions: requests trip changes
- Traveler → Trip dashboard: manages trips
- Trip dashboard → Local trip storage: reads and saves
- Itinerary view → Local trip storage: saves trip and feedback
- Offline cache → Trip dashboard: serves cached shell
- Admin tools → Knowledge retrieval: manages knowledge base
- Admin tools → Supabase: admin data access
