# sahilbambarkar/tripwise-ai-trip-planner architecture

> Architecture diagram of the GitHub repository sahilbambarkar/tripwise-ai-trip-planner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahilbambarkar/tripwise-ai-trip-planner
- Repository: https://github.com/sahilbambarkar/tripwise-ai-trip-planner

## Overview

Tripwise is a React travel-planning app. A user chooses a destination, duration, budget, and travel party; after Google sign-in, the create-trip screen asks Gemini for a JSON itinerary and saves it in Firestore. Users can then view the saved trip’s hotel and activity details or browse their saved trips. The README also describes hotel recommendations, maps, and OAuth; maps and place-photo lookup are visible, but live hotel search is not established by the sampled source. Relationships for unsampled view components are limited to documented routing and visible imports.

Main entry points: [`src/view-trip/[tripId]/index.jsx`](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/%5BtripId%5D/index.jsx) (Trip detail route), [`src/main.jsx`](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/main.jsx) (App entry), [`src/create-trip/index.jsx`](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/create-trip/index.jsx) (Trip preferences and generation), [`src/my-trips/index.jsx`](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/my-trips/index.jsx) (Saved trips)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_trip["Trip planning"]
  node_app["App entry<br/>[main.jsx]"]
  node_home["Landing page<br/>[App.jsx]"]
  node_hero["Hero<br/>[Hero.jsx]"]
  node_create["Trip preferences and generation<br/>[index.jsx]"]
  node_options["Preference options and prompt<br/>[options.jsx]"]
end

subgraph group_account["Identity and navigation"]
  node_header["Header and sign-in<br/>[Header.jsx]"]
  node_triplist["Saved trips<br/>[index.jsx]"]
  node_tripcard["Trip card"]
end

subgraph group_details["Trip details"]
  node_tripview["Trip detail route<br/>[index.jsx]"]
  node_info["Destination overview<br/>[InfoSection.jsx]"]
  node_hotels["Hotel recommendations<br/>[Hotels.jsx]"]
  node_hotelcard["Hotel card<br/>[HotelCardItem.jsx]"]
  node_places["Activity itinerary<br/>[PlacesToVisit.jsx]"]
  node_placecard["Activity card<br/>[PlaceCardItem.jsx]"]
  node_footer["Trip footer<br/>[Footer.jsx]"]
end

subgraph group_platform["External services"]
  node_gemini["Itinerary generation<br/>[AIModal.jsx]"]
  node_firestore[("Trip records<br/>[firebaseConfig.jsx]")]
  node_placesapi["Google Places API"]
  node_maps["Google Maps"]
  node_oauth["Google OAuth and profile"]
end

node_traveler(("Traveler"))

node_traveler -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_home -->|"renders"| node_hero
node_app -->|"renders"| node_header
node_traveler -.->|"enters preferences"| node_create
node_create -->|"uses options"| node_options
node_create -->|"requests itinerary"| node_gemini
node_create -->|"saves trip"| node_firestore
node_create -->|"requests sign-in"| node_oauth
node_header -->|"requests sign-in"| node_oauth
node_app -->|"routes to"| node_tripview
node_app -->|"routes to"| node_triplist
node_triplist -->|"queries trips"| node_firestore
node_triplist -->|"renders trips"| node_tripcard
node_tripview -->|"loads trip"| node_firestore
node_tripview -->|"renders"| node_info
node_tripview -->|"renders"| node_hotels
node_tripview -->|"renders"| node_places
node_tripview -->|"renders"| node_footer
node_hotels -->|"renders"| node_hotelcard
node_places -->|"renders"| node_placecard
node_info -->|"looks up photos"| node_placesapi
node_info -->|"links destination"| node_maps
node_traveler -.->|"views trip map"| node_maps
node_traveler -->|"browses trips"| node_triplist

click node_app "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/main.jsx"
click node_home "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/App.jsx"
click node_hero "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/components/ui/custom/Hero.jsx"
click node_create "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/create-trip/index.jsx"
click node_options "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/constants/options.jsx"
click node_gemini "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/service/AIModal.jsx"
click node_firestore "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/service/firebaseConfig.jsx"
click node_header "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/components/ui/custom/Header.jsx"
click node_triplist "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/my-trips/index.jsx"
click node_tripcard "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/my-trips/components/UserTripCardItem.jsx"
click node_tripview "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/%5BtripId%5D/index.jsx"
click node_info "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/InfoSection.jsx"
click node_hotels "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/Hotels.jsx"
click node_hotelcard "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/HotelCardItem.jsx"
click node_places "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/PlacesToVisit.jsx"
click node_placecard "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/PlaceCardItem.jsx"
click node_footer "https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/Footer.jsx"

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_home,node_hero,node_create,node_options toneBlue
class node_header,node_triplist,node_tripcard toneAmber
class node_tripview,node_info,node_hotels,node_hotelcard,node_places,node_placecard,node_footer toneMint
class node_gemini,node_firestore,node_placesapi,node_maps,node_oauth toneRose
class node_traveler toneIndigo
```

## Components

### Trip planning

- [App entry](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/main.jsx): `src/main.jsx`
- [Landing page](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/App.jsx): `src/App.jsx`
- [Hero](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/components/ui/custom/Hero.jsx): `src/components/ui/custom/Hero.jsx`
- [Trip preferences and generation](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/create-trip/index.jsx): `src/create-trip/index.jsx`
- [Preference options and prompt](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/constants/options.jsx): `src/constants/options.jsx`

### Identity and navigation

- [Header and sign-in](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/components/ui/custom/Header.jsx): `src/components/ui/custom/Header.jsx`
- [Saved trips](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/my-trips/index.jsx): `src/my-trips/index.jsx`
- [Trip card](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/my-trips/components/UserTripCardItem.jsx): `src/my-trips/components/UserTripCardItem.jsx`

### Trip details

- [Trip detail route](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/%5BtripId%5D/index.jsx): `src/view-trip/[tripId]/index.jsx`
- [Destination overview](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/InfoSection.jsx): `src/view-trip/components/InfoSection.jsx`
- [Hotel recommendations](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/Hotels.jsx): `src/view-trip/components/Hotels.jsx`
- [Hotel card](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/HotelCardItem.jsx): `src/view-trip/components/HotelCardItem.jsx`
- [Activity itinerary](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/PlacesToVisit.jsx): `src/view-trip/components/PlacesToVisit.jsx`
- [Activity card](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/PlaceCardItem.jsx): `src/view-trip/components/PlaceCardItem.jsx`
- [Trip footer](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/view-trip/components/Footer.jsx): `src/view-trip/components/Footer.jsx`

### External services

- [Itinerary generation](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/service/AIModal.jsx): `src/service/AIModal.jsx`
- [Trip records](https://github.com/sahilbambarkar/tripwise-ai-trip-planner/blob/main/src/service/firebaseConfig.jsx): `src/service/firebaseConfig.jsx`
- **Google Places API**
- **Google Maps**
- **Google OAuth and profile**

### Other components

- **Traveler**

## Connections

- Traveler → App entry: opens app (evidence: `src/main.jsx`)
- App entry → Landing page: routes to (evidence: `src/main.jsx`)
- Landing page → Hero: renders (evidence: `src/App.jsx`)
- App entry → Header and sign-in: renders (evidence: `src/main.jsx`)
- Traveler → Trip preferences and generation: enters preferences
- Trip preferences and generation → Preference options and prompt: uses options (evidence: `src/create-trip/index.jsx`)
- Trip preferences and generation → Itinerary generation: requests itinerary (evidence: `src/create-trip/index.jsx`)
- Trip preferences and generation → Trip records: saves trip (evidence: `src/create-trip/index.jsx`)
- Trip preferences and generation → Google OAuth and profile: requests sign-in (evidence: `src/create-trip/index.jsx`)
- Header and sign-in → Google OAuth and profile: requests sign-in (evidence: `src/components/ui/custom/Header.jsx`)
- App entry → Trip detail route: routes to (evidence: `src/main.jsx`)
- App entry → Saved trips: routes to (evidence: `src/main.jsx`)
- Saved trips → Trip records: queries trips (evidence: `src/my-trips/index.jsx`)
- Saved trips → Trip card: renders trips (evidence: `src/my-trips/index.jsx`)
- Trip detail route → Trip records: loads trip (evidence: `src/view-trip/[tripId]/index.jsx`)
- Trip detail route → Destination overview: renders (evidence: `src/view-trip/[tripId]/index.jsx`)
- Trip detail route → Hotel recommendations: renders (evidence: `src/view-trip/[tripId]/index.jsx`)
- Trip detail route → Activity itinerary: renders (evidence: `src/view-trip/[tripId]/index.jsx`)
- Trip detail route → Trip footer: renders (evidence: `src/view-trip/[tripId]/index.jsx`)
- Hotel recommendations → Hotel card: renders (evidence: `src/view-trip/components/Hotels.jsx`)
- Activity itinerary → Activity card: renders (evidence: `src/view-trip/components/PlacesToVisit.jsx`)
- Destination overview → Google Places API: looks up photos (evidence: `src/view-trip/components/InfoSection.jsx`)
- Destination overview → Google Maps: links destination (evidence: `README.md`)
- Traveler → Google Maps: views trip map (evidence: `README.md`)
- Traveler → Saved trips: browses trips
