# jisan-dev/voyago-travel-booking-webapp architecture

> Architecture diagram of the GitHub repository jisan-dev/voyago-travel-booking-webapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jisan-dev/voyago-travel-booking-webapp
- Repository: https://github.com/jisan-dev/voyago-travel-booking-webapp

## Overview

Voyago is a hotel discovery and reservation app. The main user journey is to sign in, search by destination and dates, browse and filter hotel results, inspect a property, pay to book, then review upcoming or past reservations. Its runtime is organized around Next.js pages and API routes, a search-state provider, server-side data access, MongoDB models, and authentication/payment integrations. The README documents the overall booking and payment journey; source excerpts show hotel-search and availability logic. Some detail, checkout, and payment implementation was not sampled, so those links are documented at workflow level rather than inferred as direct calls.

Main entry points: [`DAL/index.ts`](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/DAL/index.ts) (Data access layer), [`components/payment/payment-form.tsx`](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/payment/payment-form.tsx) (Payment form), [`app/(home)/hotels/_components/page-content.tsx`](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/hotels/_components/page-content.tsx) (Hotel results), [`app/api/hotels/route.ts`](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/hotels/route.ts) (Hotel search API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Discovery and booking"]
  node_landing["Home and search entry<br/>[page.tsx]"]
  node_search["Search controls<br/>[search.tsx]"]
  node_searchstate["Search state<br/>[SearchProvider.tsx]"]
  node_hotelresults["Hotel results<br/>[page-content.tsx]"]
  node_filters["Filters and sorting<br/>[index.tsx]"]
  node_hotelcards["Hotel listings<br/>[hotel-list.tsx]"]
  node_hoteldetail["Hotel details<br/>[page.tsx]"]
  node_checkout["Booking checkout<br/>[checkout-page.tsx]"]
  node_paymentform["Payment form<br/>[payment-form.tsx]"]
  node_success["Payment confirmation<br/>[page.tsx]"]
  node_dashboard["Booking dashboard<br/>[page.tsx]"]
  node_bookingviews["Booking history views"]
end

subgraph group_identity["Identity and accounts"]
  node_authpages["Login and registration<br/>[page.tsx]"]
  node_authform["Authentication form<br/>[auth-form.tsx]"]
  node_sociallogin["Social login<br/>[social-logins.tsx]"]
  node_authclient["Auth client<br/>[auth-client.ts]"]
  node_authserver["Auth service<br/>[auth.ts]"]
end

subgraph group_services["Server services"]
  node_hotelapi["Hotel search API<br/>[route.ts]"]
  node_paymentapi["Payment endpoint<br/>[route.ts]"]
  node_paymentintent["Payment intent API<br/>[route.ts]"]
  node_authroute["Auth API route<br/>[route.ts]"]
  node_dal["Data access layer<br/>[index.ts]"]
end

subgraph group_persistence["Data and integrations"]
  node_hotelmodel["Hotel records<br/>[hotel.ts]"]
  node_bookingmodel["Booking records<br/>[booking.ts]"]
  node_ratingmodel["Rating records<br/>[rating.ts]"]
  node_reviewmodel["Review records<br/>[review.ts]"]
  node_mongodb["MongoDB connection<br/>[mongodb.ts]"]
end

node_traveler(("Traveler"))
node_mongodbservice[("MongoDB")]
node_stripe["Stripe"]

node_traveler -->|"starts browsing"| node_landing
node_traveler -->|"signs in"| node_authpages
node_landing -->|"offers search"| node_search
node_search -->|"updates state"| node_searchstate
node_search -->|"navigates to"| node_hotelresults
node_hotelresults -.->|"requests listings"| node_hotelapi
node_hotelresults -->|"presents filters"| node_filters
node_hotelresults -->|"renders results"| node_hotelcards
node_hotelapi -->|"checks bookings"| node_dal
node_hotelapi -->|"queries hotels"| node_hotelmodel
node_hotelapi -->|"connects"| node_mongodb
node_hotelcards -.->|"opens property"| node_hoteldetail
node_hoteldetail -->|"continues booking"| node_checkout
node_checkout -->|"collects payment"| node_paymentform
node_paymentform -.->|"requests payment"| node_paymentintent
node_paymentform -.->|"processes payment"| node_stripe
node_paymentapi -->|"stores booking"| node_dal
node_paymentapi -->|"writes booking"| node_bookingmodel
node_paymentapi -->|"connects"| node_mongodb
node_paymentform -.->|"submits booking"| node_paymentapi
node_paymentform -->|"completes flow"| node_success
node_traveler -->|"views reservations"| node_dashboard
node_dashboard -->|"loads bookings"| node_dal
node_dashboard -->|"renders history"| node_bookingviews
node_authpages -->|"renders form"| node_authform
node_authform -->|"uses session"| node_authclient
node_authform -->|"offers providers"| node_sociallogin
node_authpages -->|"authenticates"| node_authclient
node_authroute -.->|"serves auth"| node_authserver
node_authserver -->|"persists auth data"| node_mongodbservice
node_dal -->|"checks session"| node_authserver
node_dal -->|"queries bookings"| node_bookingmodel
node_dal -->|"queries hotels"| node_hotelmodel
node_dal -->|"queries ratings"| node_ratingmodel
node_dal -->|"queries reviews"| node_reviewmodel
node_dal -->|"connects"| node_mongodb
node_mongodb -->|"opens connection"| node_mongodbservice

click node_landing "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/page.tsx"
click node_search "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/search/search.tsx"
click node_searchstate "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/providers/SearchProvider.tsx"
click node_hotelresults "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/hotels/_components/page-content.tsx"
click node_hotelapi "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/hotels/route.ts"
click node_filters "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/filter/index.tsx"
click node_hotelcards "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/hotel/hotel-list.tsx"
click node_hoteldetail "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/hotels/%5Bid%5D/page.tsx"
click node_checkout "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/checkout-page.tsx"
click node_paymentform "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/payment/payment-form.tsx"
click node_paymentapi "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/payment/route.ts"
click node_paymentintent "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/create-payment-intent/route.ts"
click node_success "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/payment-success/page.tsx"
click node_dashboard "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/bookings/page.tsx"
click node_bookingviews "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/bookings/upcoming-bookings.tsx"
click node_authpages "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(auth)/login/page.tsx"
click node_authform "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/auth-form.tsx"
click node_sociallogin "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/auth/social-logins.tsx"
click node_authclient "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/auth-client.ts"
click node_authserver "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/auth.ts"
click node_authroute "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/auth/%5B...all%5D/route.ts"
click node_dal "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/DAL/index.ts"
click node_hotelmodel "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/hotel.ts"
click node_bookingmodel "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/booking.ts"
click node_ratingmodel "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/rating.ts"
click node_reviewmodel "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/review.ts"
click node_mongodb "https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/mongodb.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_landing,node_search,node_searchstate,node_hotelresults,node_filters,node_hotelcards,node_hoteldetail,node_checkout,node_paymentform,node_success,node_dashboard,node_bookingviews toneBlue
class node_authpages,node_authform,node_sociallogin,node_authclient,node_authserver,node_mongodbservice toneAmber
class node_hotelapi,node_paymentapi,node_paymentintent,node_authroute,node_dal toneMint
class node_hotelmodel,node_bookingmodel,node_ratingmodel,node_reviewmodel,node_mongodb toneRose
class node_traveler,node_stripe toneIndigo
```

## Components

### Discovery and booking

- [Home and search entry](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/page.tsx): `app/(home)/page.tsx`
- [Search controls](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/search/search.tsx): `components/search/search.tsx`
- [Search state](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/providers/SearchProvider.tsx): `providers/SearchProvider.tsx`
- [Hotel results](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/hotels/_components/page-content.tsx): `app/(home)/hotels/_components/page-content.tsx`
- [Filters and sorting](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/filter/index.tsx): `components/filter/index.tsx`
- [Hotel listings](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/hotel/hotel-list.tsx): `components/hotel/hotel-list.tsx`
- [Hotel details](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/hotels/%5Bid%5D/page.tsx): `app/(home)/hotels/[id]/page.tsx`
- [Booking checkout](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/checkout-page.tsx): `components/checkout-page.tsx`
- [Payment form](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/payment/payment-form.tsx): `components/payment/payment-form.tsx`
- [Payment confirmation](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/payment-success/page.tsx): `app/(home)/payment-success/page.tsx`
- [Booking dashboard](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(home)/bookings/page.tsx): `app/(home)/bookings/page.tsx`
- [Booking history views](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/bookings/upcoming-bookings.tsx): `components/bookings/upcoming-bookings.tsx`

### Identity and accounts

- [Login and registration](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Authentication form](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/auth-form.tsx): `components/auth-form.tsx`
- [Social login](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/components/auth/social-logins.tsx): `components/auth/social-logins.tsx`
- [Auth client](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/auth-client.ts): `lib/auth-client.ts`
- [Auth service](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/auth.ts): `lib/auth.ts`

### Server services

- [Hotel search API](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/hotels/route.ts): `app/api/hotels/route.ts`
- [Payment endpoint](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/payment/route.ts): `app/api/payment/route.ts`
- [Payment intent API](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/create-payment-intent/route.ts): `app/api/create-payment-intent/route.ts`
- [Auth API route](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/app/api/auth/%5B...all%5D/route.ts): `app/api/auth/[...all]/route.ts`
- [Data access layer](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/DAL/index.ts): `DAL/index.ts`

### Data and integrations

- [Hotel records](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/hotel.ts): `lib/models/hotel.ts`
- [Booking records](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/booking.ts): `lib/models/booking.ts`
- [Rating records](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/rating.ts): `lib/models/rating.ts`
- [Review records](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/models/review.ts): `lib/models/review.ts`
- [MongoDB connection](https://github.com/jisan-dev/voyago-travel-booking-webapp/blob/main/lib/mongodb.ts): `lib/mongodb.ts`

### Other components

- **Traveler**
- **MongoDB**
- **Stripe**

## Connections

- Traveler → Home and search entry: starts browsing
- Traveler → Login and registration: signs in
- Home and search entry → Search controls: offers search (evidence: `app/(home)/page.tsx`)
- Search controls → Search state: updates state (evidence: `components/search/search.tsx`)
- Search controls → Hotel results: navigates to (evidence: `components/search/search.tsx`)
- Hotel results → Hotel search API: requests listings
- Hotel results → Filters and sorting: presents filters (evidence: `app/(home)/hotels/_components/page-content.tsx`)
- Hotel results → Hotel listings: renders results (evidence: `app/(home)/hotels/_components/page-content.tsx`)
- Hotel search API → Data access layer: checks bookings (evidence: `app/api/hotels/route.ts`)
- Hotel search API → Hotel records: queries hotels (evidence: `app/api/hotels/route.ts`)
- Hotel search API → MongoDB connection: connects (evidence: `app/api/hotels/route.ts`)
- Hotel listings → Hotel details: opens property
- Hotel details → Booking checkout: continues booking
- Booking checkout → Payment form: collects payment
- Payment form → Payment intent API: requests payment
- Payment form → Stripe: processes payment
- Payment endpoint → Data access layer: stores booking (evidence: `app/api/payment/route.ts`)
- Payment endpoint → Booking records: writes booking (evidence: `app/api/payment/route.ts`)
- Payment endpoint → MongoDB connection: connects (evidence: `app/api/payment/route.ts`)
- Payment form → Payment endpoint: submits booking
- Payment form → Payment confirmation: completes flow
- Traveler → Booking dashboard: views reservations
- Booking dashboard → Data access layer: loads bookings (evidence: `app/(home)/bookings/page.tsx`)
- Booking dashboard → Booking history views: renders history (evidence: `app/(home)/bookings/page.tsx`)
- Login and registration → Authentication form: renders form (evidence: `app/(auth)/login/page.tsx`)
- Authentication form → Auth client: uses session (evidence: `components/auth-form.tsx`)
- Authentication form → Social login: offers providers (evidence: `components/auth-form.tsx`)
- Login and registration → Auth client: authenticates (evidence: `app/(auth)/login/page.tsx`)
- Auth API route → Auth service: serves auth
- Auth service → MongoDB: persists auth data (evidence: `lib/auth.ts`)
- Data access layer → Auth service: checks session (evidence: `DAL/index.ts`)
- Data access layer → Booking records: queries bookings (evidence: `DAL/index.ts`)
- Data access layer → Hotel records: queries hotels (evidence: `DAL/index.ts`)
- Data access layer → Rating records: queries ratings (evidence: `DAL/index.ts`)
- Data access layer → Review records: queries reviews (evidence: `DAL/index.ts`)
- Data access layer → MongoDB connection: connects (evidence: `DAL/index.ts`)
- MongoDB connection → MongoDB: opens connection (evidence: `lib/mongodb.ts`)
