How jisan-dev/voyago-travel-booking-webapp works
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: index.ts Data access layer · payment-form.tsx Payment form · page-content.tsx Hotel results · route.ts Hotel search API
Components 30
Discovery and booking
- Home and search entry
app/(home)/page.tsx - Search controls
components/search/search.tsx - Search state
providers/SearchProvider.tsx - Hotel results
app/(home)/hotels/_components/page-content.tsx - Filters and sorting
components/filter/index.tsx - Hotel listings
components/hotel/hotel-list.tsx - Hotel details
app/(home)/hotels/[id]/page.tsx - Booking checkout
components/checkout-page.tsx - Payment form
components/payment/payment-form.tsx - Payment confirmation
app/(home)/payment-success/page.tsx - Booking dashboard
app/(home)/bookings/page.tsx - Booking history views
components/bookings/upcoming-bookings.tsx
Identity and accounts
- Login and registration
app/(auth)/login/page.tsx - Authentication form
components/auth-form.tsx - Social login
components/auth/social-logins.tsx - Auth client
lib/auth-client.ts - Auth service
lib/auth.ts
Server services
- Hotel search API
app/api/hotels/route.ts - Payment endpoint
app/api/payment/route.ts - Payment intent API
app/api/create-payment-intent/route.ts - Auth API route
app/api/auth/[...all]/route.ts - Data access layer
DAL/index.ts
Data and integrations
- Hotel records
lib/models/hotel.ts - Booking records
lib/models/booking.ts - Rating records
lib/models/rating.ts - Review records
lib/models/review.ts - MongoDB connection
lib/mongodb.ts
Other components
- Traveler
- MongoDB
- Stripe
Connections 37
- Traveler → Home and search entry: starts browsing
- Traveler → Login and registration: signs in
- Home and search entry → Search controls: offers search
app/(home)/page.tsx - Search controls → Search state: updates state
components/search/search.tsx - Search controls → Hotel results: navigates to
components/search/search.tsx - Hotel results → Hotel search API: requests listings
- Hotel results → Filters and sorting: presents filters
app/(home)/hotels/_components/page-content.tsx - Hotel results → Hotel listings: renders results
app/(home)/hotels/_components/page-content.tsx - Hotel search API → Data access layer: checks bookings
app/api/hotels/route.ts - Hotel search API → Hotel records: queries hotels
app/api/hotels/route.ts - Hotel search API → MongoDB connection: connects
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
app/api/payment/route.ts - Payment endpoint → Booking records: writes booking
app/api/payment/route.ts - Payment endpoint → MongoDB connection: connects
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
app/(home)/bookings/page.tsx - Booking dashboard → Booking history views: renders history
app/(home)/bookings/page.tsx - Login and registration → Authentication form: renders form
app/(auth)/login/page.tsx - Authentication form → Auth client: uses session
components/auth-form.tsx - Authentication form → Social login: offers providers
components/auth-form.tsx - Login and registration → Auth client: authenticates
app/(auth)/login/page.tsx - Auth API route → Auth service: serves auth
- Auth service → MongoDB: persists auth data
lib/auth.ts - Data access layer → Auth service: checks session
DAL/index.ts - Data access layer → Booking records: queries bookings
DAL/index.ts - Data access layer → Hotel records: queries hotels
DAL/index.ts - Data access layer → Rating records: queries ratings
DAL/index.ts - Data access layer → Review records: queries reviews
DAL/index.ts - Data access layer → MongoDB connection: connects
DAL/index.ts - MongoDB connection → MongoDB: opens connection
lib/mongodb.ts