# bhatraasim/tripforge-fe architecture

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

- Interactive diagram: https://gitdiagram.com/bhatraasim/tripforge-fe
- Repository: https://github.com/bhatraasim/tripforge-fe

## Overview

TripForge-fe is a travel-planning web frontend. A traveler enters route, dates, party size, budget, and preferences in the planner; the home page submits the request through its API client to the plan endpoint, then presents returned flight, hotel, and itinerary options. The home page also supports refining a plan through the floating chat input. Google sign-in is a separate capability. The README provides no further product detail, and backend behavior is outside this repository; relationships below are limited to source-index references and the shown excerpts.

Main entry points: [`src/app/page.tsx`](https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/page.tsx) (Home Orchestrator), [`src/types/travel.ts`](https://github.com/bhatraasim/tripforge-fe/blob/main/src/types/travel.ts) (Travel Data Types), [`src/components/TripPlannerForm.tsx`](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/TripPlannerForm.tsx) (Trip Planner Form), [`src/lib/api.ts`](https://github.com/bhatraasim/tripforge-fe/blob/main/src/lib/api.ts) (Plan API Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Trip Planning"]
  node_home["Home Orchestrator<br/>[page.tsx]"]
  node_planner["Trip Planner Form"]
  node_chat["Refinement Input"]
  node_api["Plan API Client<br/>[api.ts]"]
  node_planroute["Plan Endpoint<br/>[route.ts]"]
end

subgraph group_results["Trip Results"]
  node_flights["Flight Options<br/>[FlightOptions.tsx]"]
  node_hotels["Hotel Options<br/>[HotelOptions.tsx]"]
  node_itinerary["Itinerary Timeline"]
end

subgraph group_identity["Authentication"]
  node_providers["Auth Providers<br/>[Providers.tsx]"]
  node_login["Login Page<br/>[page.tsx]"]
  node_authlogin["Auth Login UI<br/>[AuthLogin.tsx]"]
  node_auth["Auth Configuration<br/>[auth.ts]"]
  node_authroute["Auth Route<br/>[route.ts]"]
end

subgraph group_shared["Shared UI and Types"]
  node_hero["Hero Section<br/>[HeroSection.tsx]"]
  node_navigation["Navigation<br/>[Navigation.tsx]"]
  node_header["Top Header<br/>[TopHeader.tsx]"]
  node_traveltypes["Travel Data Types<br/>[travel.ts]"]
end

node_traveler(("Traveler"))

node_traveler -->|"enters trip"| node_planner
node_planner -->|"submits input"| node_home
node_traveler -->|"enters refinement"| node_chat
node_chat -->|"submits refinement"| node_home
node_home -->|"requests plan"| node_api
node_api -->|"POSTs request"| node_planroute
node_home -->|"renders options"| node_flights
node_home -->|"renders options"| node_hotels
node_home -->|"renders schedule"| node_itinerary
node_home -->|"renders form"| node_planner
node_home -->|"renders input"| node_chat
node_home -->|"renders navigation"| node_navigation
node_home -->|"renders header"| node_header
node_home -->|"renders hero"| node_hero
node_authroute -->|"uses handlers"| node_auth
node_flights -->|"uses flight types"| node_traveltypes
node_hotels -->|"uses hotel types"| node_traveltypes
node_itinerary -->|"uses itinerary types"| node_traveltypes
node_planner -->|"uses input types"| node_traveltypes
node_api -->|"uses plan types"| node_traveltypes
node_home -->|"normalizes response"| node_traveltypes
node_login -.->|"renders login"| node_authlogin
node_providers -.->|"configures session"| node_auth

click node_home "https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/page.tsx"
click node_planner "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/TripPlannerForm.tsx"
click node_chat "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/FloatingChatInput.tsx"
click node_api "https://github.com/bhatraasim/tripforge-fe/blob/main/src/lib/api.ts"
click node_planroute "https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/api/plan/route.ts"
click node_flights "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/FlightOptions.tsx"
click node_hotels "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/HotelOptions.tsx"
click node_itinerary "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/ItineraryTimeline.tsx"
click node_hero "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/HeroSection.tsx"
click node_navigation "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/Navigation.tsx"
click node_header "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/TopHeader.tsx"
click node_providers "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/Providers.tsx"
click node_login "https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/login/page.tsx"
click node_authlogin "https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/AuthLogin.tsx"
click node_auth "https://github.com/bhatraasim/tripforge-fe/blob/main/src/auth.ts"
click node_authroute "https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_traveltypes "https://github.com/bhatraasim/tripforge-fe/blob/main/src/types/travel.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_home,node_planner,node_chat,node_api,node_planroute toneBlue
class node_flights,node_hotels,node_itinerary toneAmber
class node_providers,node_login,node_authlogin,node_auth,node_authroute toneMint
class node_hero,node_navigation,node_header,node_traveltypes toneRose
class node_traveler toneIndigo
```

## Components

### Trip Planning

- [Home Orchestrator](https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Trip Planner Form](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/TripPlannerForm.tsx): `src/components/TripPlannerForm.tsx`
- [Refinement Input](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/FloatingChatInput.tsx): `src/components/FloatingChatInput.tsx`
- [Plan API Client](https://github.com/bhatraasim/tripforge-fe/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Plan Endpoint](https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/api/plan/route.ts): `src/app/api/plan/route.ts`

### Trip Results

- [Flight Options](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/FlightOptions.tsx): `src/components/FlightOptions.tsx`
- [Hotel Options](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/HotelOptions.tsx): `src/components/HotelOptions.tsx`
- [Itinerary Timeline](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/ItineraryTimeline.tsx): `src/components/ItineraryTimeline.tsx`

### Authentication

- [Auth Providers](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/Providers.tsx): `src/components/Providers.tsx`
- [Login Page](https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth Login UI](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/AuthLogin.tsx): `src/components/AuthLogin.tsx`
- [Auth Configuration](https://github.com/bhatraasim/tripforge-fe/blob/main/src/auth.ts): `src/auth.ts`
- [Auth Route](https://github.com/bhatraasim/tripforge-fe/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`

### Shared UI and Types

- [Hero Section](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/HeroSection.tsx): `src/components/HeroSection.tsx`
- [Navigation](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/Navigation.tsx): `src/components/Navigation.tsx`
- [Top Header](https://github.com/bhatraasim/tripforge-fe/blob/main/src/components/TopHeader.tsx): `src/components/TopHeader.tsx`
- [Travel Data Types](https://github.com/bhatraasim/tripforge-fe/blob/main/src/types/travel.ts): `src/types/travel.ts`

### Other components

- **Traveler**

## Connections

- Traveler → Trip Planner Form: enters trip (evidence: `src/components/TripPlannerForm.tsx`)
- Trip Planner Form → Home Orchestrator: submits input (evidence: `src/app/page.tsx`)
- Traveler → Refinement Input: enters refinement (evidence: `src/components/FloatingChatInput.tsx`)
- Refinement Input → Home Orchestrator: submits refinement (evidence: `src/app/page.tsx`)
- Home Orchestrator → Plan API Client: requests plan (evidence: `src/app/page.tsx`)
- Plan API Client → Plan Endpoint: POSTs request (evidence: `src/lib/api.ts`)
- Home Orchestrator → Flight Options: renders options (evidence: `src/app/page.tsx`)
- Home Orchestrator → Hotel Options: renders options (evidence: `src/app/page.tsx`)
- Home Orchestrator → Itinerary Timeline: renders schedule (evidence: `src/app/page.tsx`)
- Home Orchestrator → Trip Planner Form: renders form (evidence: `src/app/page.tsx`)
- Home Orchestrator → Refinement Input: renders input (evidence: `src/app/page.tsx`)
- Home Orchestrator → Navigation: renders navigation (evidence: `src/app/page.tsx`)
- Home Orchestrator → Top Header: renders header (evidence: `src/app/page.tsx`)
- Home Orchestrator → Hero Section: renders hero (evidence: `src/app/page.tsx`)
- Auth Route → Auth Configuration: uses handlers (evidence: `src/app/api/auth/[...nextauth]/route.ts`)
- Flight Options → Travel Data Types: uses flight types (evidence: `src/components/FlightOptions.tsx`)
- Hotel Options → Travel Data Types: uses hotel types (evidence: `src/components/HotelOptions.tsx`)
- Itinerary Timeline → Travel Data Types: uses itinerary types (evidence: `src/components/ItineraryTimeline.tsx`)
- Trip Planner Form → Travel Data Types: uses input types (evidence: `src/components/TripPlannerForm.tsx`)
- Plan API Client → Travel Data Types: uses plan types (evidence: `src/lib/api.ts`)
- Home Orchestrator → Travel Data Types: normalizes response (evidence: `src/app/page.tsx`)
- Login Page → Auth Login UI: renders login
- Auth Providers → Auth Configuration: configures session
