# himanshu8github/travelbuddy architecture

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

- Interactive diagram: https://gitdiagram.com/himanshu8github/travelbuddy
- Repository: https://github.com/himanshu8github/travelbuddy

## Overview

TravelBuddy is a full-stack trip-planning app. Users browse Indian destinations or sign in, then use a trip form to request an AI itinerary and view its schedule and supporting travel tools; separate dashboard features cover trip history, expenses, chat suggestions, and premium subscriptions. The graph includes documented capabilities even where implementation was not sampled. Edges are limited to visible imports, calls, route registration, or README statements; unsampled page and integration details are not inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/App.jsx) (Page routing), [`server/server.js`](https://github.com/himanshu8github/travelbuddy/blob/main/server/server.js) (API server), [`client/src/pages/Dashboard.jsx`](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Dashboard.jsx) (Trip dashboard), [`client/src/hooks/auth.hook.js`](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/hooks/auth.hook.js) (Authentication sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Travel web app"]
  node_app["Page routing<br/>[App.jsx]"]
  node_explore["Destination discovery<br/>[Explore.jsx]"]
  node_destination["Destination details<br/>[Destination.jsx]"]
  node_dashboard["Trip dashboard<br/>[Dashboard.jsx]"]
  node_places_data["Destination catalog<br/>[places.js]"]
end

subgraph group_planning["Trip planning"]
  node_form["Trip request form<br/>[ItenaryForm.jsx]"]
  node_itinerary["Generated itinerary"]
  node_itinerary_views["Itinerary tools"]
  node_planner["AI planner<br/>[AiPlanner.jsx]"]
  node_expense["Expense tracking<br/>[ExpenseTracker.jsx]"]
  node_history["Trip history<br/>[History.jsx]"]
end

subgraph group_backend["AI services"]
  node_server["API server<br/>[server.js]"]
  node_itinerary_route["Itinerary API route"]
  node_chat_route["Chat suggestions route"]
  node_chat["Chat suggestions"]
  node_gemini_route["Gemini API route<br/>[gemini.route.js]"]
end

subgraph group_account["Accounts and data"]
  node_auth["Authentication sync<br/>[auth.hook.js]"]
  node_auth_store["User session state<br/>[authstore.js]"]
  node_firebase["Firebase services<br/>[firebase.js]"]
  node_trip_data["Trip data access<br/>[firebaseDBUtils.js]"]
end

subgraph group_billing["Premium billing"]
  node_plans["Premium plans<br/>[PaidPlans.jsx]"]
  node_payment["Checkout session"]
  node_payment_route["Payment route<br/>[stripe.route.js]"]
  node_webhook["Payment webhook"]
end

node_traveler(("Traveler"))
node_stripe["Stripe"]
node_groq["Groq API"]
node_firestore[("Firestore")]
node_firebase_auth["Firebase Auth"]

node_traveler -->|"uses"| node_app
node_app -->|"routes to"| node_explore
node_app -->|"routes to"| node_destination
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_planner
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_expense
node_app -->|"routes to"| node_plans
node_explore -.->|"reads"| node_places_data
node_destination -.->|"reads"| node_places_data
node_dashboard -->|"navigates to"| node_form
node_form -->|"renders"| node_itinerary_views
node_form -.->|"requests itinerary"| node_server
node_server -->|"mounts"| node_itinerary_route
node_server -->|"mounts"| node_chat_route
node_server -.->|"mounts"| node_gemini_route
node_itinerary_route -->|"routes to"| node_itinerary
node_chat_route -.->|"routes to"| node_chat
node_itinerary -->|"generates with"| node_groq
node_dashboard -->|"reads and adds"| node_trip_data
node_dashboard -.->|"checks session"| node_auth
node_app -->|"syncs session"| node_auth
node_auth -->|"uses"| node_firebase
node_auth -->|"updates"| node_auth_store
node_firebase -.->|"provides"| node_firebase_auth
node_trip_data -.->|"reads and writes"| node_firestore
node_traveler -.->|"selects plan"| node_plans
node_plans -.->|"starts checkout"| node_payment_route
node_server -->|"mounts"| node_payment_route
node_payment_route -->|"routes to"| node_payment
node_payment -->|"creates session"| node_stripe
node_webhook -->|"verifies events"| node_stripe
node_webhook -->|"updates plan"| node_firestore

click node_app "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/App.jsx"
click node_explore "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Explore.jsx"
click node_destination "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Destination.jsx"
click node_dashboard "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Dashboard.jsx"
click node_form "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/components/ItenaryForm.jsx"
click node_itinerary "https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/cohere.controller.js"
click node_itinerary_views "https://github.com/himanshu8github/travelbuddy/tree/main/client/src/components/itinerary"
click node_planner "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/AiPlanner.jsx"
click node_expense "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/ExpenseTracker.jsx"
click node_history "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/History.jsx"
click node_server "https://github.com/himanshu8github/travelbuddy/blob/main/server/server.js"
click node_itinerary_route "https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/cohere.iteneray.route.js"
click node_chat_route "https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/chat.cohere.route.js"
click node_chat "https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/chat.cohere.controller.js"
click node_gemini_route "https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/gemini.route.js"
click node_auth "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/hooks/auth.hook.js"
click node_auth_store "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/store/authstore.js"
click node_firebase "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/firebase.js"
click node_trip_data "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/utils/firebaseDBUtils.js"
click node_places_data "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/data/places.js"
click node_plans "https://github.com/himanshu8github/travelbuddy/blob/main/client/src/components/PaidPlans.jsx"
click node_payment "https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/payment.controller.js"
click node_payment_route "https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/stripe.route.js"
click node_webhook "https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/stripe.webhook.route.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_explore,node_destination,node_dashboard,node_places_data toneBlue
class node_form,node_itinerary,node_itinerary_views,node_planner,node_expense,node_history,node_firestore toneAmber
class node_server,node_itinerary_route,node_chat_route,node_chat,node_gemini_route,node_groq toneMint
class node_auth,node_auth_store,node_firebase,node_trip_data toneRose
class node_plans,node_payment,node_payment_route,node_webhook,node_traveler,node_stripe,node_firebase_auth toneIndigo
```

## Components

### Travel web app

- [Page routing](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Destination discovery](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Explore.jsx): `client/src/pages/Explore.jsx`
- [Destination details](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Destination.jsx): `client/src/pages/Destination.jsx`
- [Trip dashboard](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Destination catalog](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/data/places.js): `client/src/data/places.js`

### Trip planning

- [Trip request form](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/components/ItenaryForm.jsx): `client/src/components/ItenaryForm.jsx`
- [Generated itinerary](https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/cohere.controller.js): `server/controller/cohere.controller.js`
- [Itinerary tools](https://github.com/himanshu8github/travelbuddy/tree/main/client/src/components/itinerary): `client/src/components/itinerary`
- [AI planner](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/AiPlanner.jsx): `client/src/pages/AiPlanner.jsx`
- [Expense tracking](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/ExpenseTracker.jsx): `client/src/pages/ExpenseTracker.jsx`
- [Trip history](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/pages/History.jsx): `client/src/pages/History.jsx`

### AI services

- [API server](https://github.com/himanshu8github/travelbuddy/blob/main/server/server.js): `server/server.js`
- [Itinerary API route](https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/cohere.iteneray.route.js): `server/routes/cohere.iteneray.route.js`
- [Chat suggestions route](https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/chat.cohere.route.js): `server/routes/chat.cohere.route.js`
- [Chat suggestions](https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/chat.cohere.controller.js): `server/controller/chat.cohere.controller.js`
- [Gemini API route](https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/gemini.route.js): `server/routes/gemini.route.js`

### Accounts and data

- [Authentication sync](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/hooks/auth.hook.js): `client/src/hooks/auth.hook.js`
- [User session state](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/store/authstore.js): `client/src/store/authstore.js`
- [Firebase services](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/firebase.js): `client/src/firebase.js`
- [Trip data access](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/utils/firebaseDBUtils.js): `client/src/utils/firebaseDBUtils.js`

### Premium billing

- [Premium plans](https://github.com/himanshu8github/travelbuddy/blob/main/client/src/components/PaidPlans.jsx): `client/src/components/PaidPlans.jsx`
- [Checkout session](https://github.com/himanshu8github/travelbuddy/blob/main/server/controller/payment.controller.js): `server/controller/payment.controller.js`
- [Payment route](https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/stripe.route.js): `server/routes/stripe.route.js`
- [Payment webhook](https://github.com/himanshu8github/travelbuddy/blob/main/server/routes/stripe.webhook.route.js): `server/routes/stripe.webhook.route.js`

### Other components

- **Traveler**
- **Stripe**
- **Groq API**
- **Firestore**
- **Firebase Auth**

## Connections

- Traveler → Page routing: uses (evidence: `client/src/App.jsx`)
- Page routing → Destination discovery: routes to (evidence: `client/src/App.jsx`)
- Page routing → Destination details: routes to (evidence: `client/src/App.jsx`)
- Page routing → Trip dashboard: routes to (evidence: `client/src/App.jsx`)
- Page routing → AI planner: routes to (evidence: `client/src/App.jsx`)
- Page routing → Trip history: routes to (evidence: `client/src/App.jsx`)
- Page routing → Expense tracking: routes to (evidence: `client/src/App.jsx`)
- Page routing → Premium plans: routes to (evidence: `client/src/App.jsx`)
- Destination discovery → Destination catalog: reads
- Destination details → Destination catalog: reads
- Trip dashboard → Trip request form: navigates to (evidence: `client/src/pages/Dashboard.jsx`)
- Trip request form → Itinerary tools: renders (evidence: `client/src/components/ItenaryForm.jsx`)
- Trip request form → API server: requests itinerary
- API server → Itinerary API route: mounts (evidence: `server/server.js`)
- API server → Chat suggestions route: mounts (evidence: `server/server.js`)
- API server → Gemini API route: mounts
- Itinerary API route → Generated itinerary: routes to (evidence: `server/routes/cohere.iteneray.route.js`)
- Chat suggestions route → Chat suggestions: routes to
- Generated itinerary → Groq API: generates with (evidence: `server/controller/cohere.controller.js`)
- Trip dashboard → Trip data access: reads and adds (evidence: `client/src/pages/Dashboard.jsx`)
- Trip dashboard → Authentication sync: checks session
- Page routing → Authentication sync: syncs session (evidence: `client/src/App.jsx`)
- Authentication sync → Firebase services: uses (evidence: `client/src/hooks/auth.hook.js`)
- Authentication sync → User session state: updates (evidence: `client/src/hooks/auth.hook.js`)
- Firebase services → Firebase Auth: provides
- Trip data access → Firestore: reads and writes
- Traveler → Premium plans: selects plan
- Premium plans → Payment route: starts checkout
- API server → Payment route: mounts (evidence: `server/server.js`)
- Payment route → Checkout session: routes to (evidence: `server/routes/stripe.route.js`)
- Checkout session → Stripe: creates session (evidence: `server/controller/payment.controller.js`)
- Payment webhook → Stripe: verifies events (evidence: `server/routes/stripe.webhook.route.js`)
- Payment webhook → Firestore: updates plan (evidence: `server/routes/stripe.webhook.route.js`)
