# krishna-mittall/makemytrip architecture

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

- Interactive diagram: https://gitdiagram.com/krishna-mittall/makemytrip
- Repository: https://github.com/krishna-mittall/makemytrip

## Overview

MakeMyTour is a travel-booking application with a Next.js frontend and Spring Boot/MongoDB backend. Users search flights and hotels, inspect prices and availability, select seats or rooms, and book; additional workflows cover cancellations/refunds, reviews, flight tracking, and personalized recommendations. The README documents the frontend/backend feature pairings and SSE updates. Source excerpts are partial, so internal connections not shown in excerpts or explicitly documented are omitted rather than inferred.

Main entry points: [`src/main/java/com/makemytrip/makemytrip/services/BookingService.java`](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/BookingService.java) (Booking service), [`src/main/java/com/makemytrip/makemytrip/services/PricingService.java`](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/PricingService.java) (Dynamic pricing), [`makemytour/src/pages/book-flight/[id]/index.tsx`](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/book-flight/%5Bid%5D/index.tsx) (Flight booking), [`src/main/java/com/makemytrip/makemytrip/controllers/BookingController.java`](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/controllers/BookingController.java) (Booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Travel frontend"]
  node_webapp["Travel pages<br/>[index.tsx]"]
  node_flightbook["Flight booking<br/>[index.tsx]"]
  node_hotelbook["Hotel booking<br/>[index.tsx]"]
  node_seatui["Seat selection<br/>[SeatMap.tsx]"]
  node_roomui["Room selection<br/>[RoomPicker.tsx]"]
  node_priceui["Price insights<br/>[PriceInsight.tsx]"]
  node_cancelui["Cancellation interface<br/>[CancelDialog.tsx]"]
  node_reviewui["Review interface<br/>[ReviewSection.tsx]"]
  node_statusui["Flight status page<br/>[index.tsx]"]
  node_recommendui["Recommendation cards"]
end

subgraph group_booking["Booking services"]
  node_bookapi["Booking API"]
  node_bookservice["Booking service"]
  node_seatservice["Seat service<br/>[SeatService.java]"]
  node_roomservice["Room service<br/>[RoomService.java]"]
  node_catalog[("Flight and hotel data<br/>[Flight.java]")]
end

subgraph group_features["Travel features"]
  node_pricing["Dynamic pricing"]
  node_cancel["Cancellation and refunds"]
  node_reviews["Reviews and ratings<br/>[ReviewService.java]"]
  node_flightstatus["Flight tracking"]
  node_recommend["Recommendations"]
end

subgraph group_platform["Shared platform"]
  node_eventhub["Live event hub<br/>[EventHub.java]"]
  node_eventhook["Live update hook<br/>[useEvents.ts]"]
end

node_traveler(("Traveler"))
node_mongo[("MongoDB")]

node_traveler -->|"searches"| node_webapp
node_traveler -->|"books flight"| node_flightbook
node_traveler -.->|"books hotel"| node_hotelbook
node_flightbook -.->|"submits booking"| node_bookapi
node_bookapi -.->|"handles booking"| node_bookservice
node_bookservice -.->|"allocates seats"| node_seatservice
node_seatui -->|"selects seats"| node_seatservice
node_roomui -->|"selects rooms"| node_roomservice
node_priceui -->|"shows pricing"| node_pricing
node_cancelui -->|"requests cancellation"| node_cancel
node_reviewui -->|"submits reviews"| node_reviews
node_statusui -->|"tracks flights"| node_flightstatus
node_recommendui -->|"shows suggestions"| node_recommend
node_eventhub -->|"pushes updates"| node_eventhook
node_bookservice -.->|"persists bookings"| node_mongo
node_pricing -->|"enriches prices"| node_catalog
node_recommend -->|"enriches candidates"| node_pricing
node_reviews -.->|"stores reviews"| node_mongo

click node_webapp "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/index.tsx"
click node_flightbook "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/book-flight/%5Bid%5D/index.tsx"
click node_hotelbook "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/book-hotel/%5Bid%5D/index.tsx"
click node_seatui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/SeatMap.tsx"
click node_roomui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/RoomPicker.tsx"
click node_priceui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/PriceInsight.tsx"
click node_bookapi "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/controllers/BookingController.java"
click node_bookservice "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/BookingService.java"
click node_seatservice "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/SeatService.java"
click node_roomservice "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/RoomService.java"
click node_catalog "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/models/Flight.java"
click node_pricing "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/PricingService.java"
click node_cancel "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/CancellationService.java"
click node_cancelui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/cancellation/CancelDialog.tsx"
click node_reviews "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/ReviewService.java"
click node_reviewui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/reviews/ReviewSection.tsx"
click node_flightstatus "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/FlightStatusService.java"
click node_statusui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/flight-status/index.tsx"
click node_recommend "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/RecommendationService.java"
click node_recommendui "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/recommendations/Recommendations.tsx"
click node_eventhub "https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/EventHub.java"
click node_eventhook "https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/hooks/useEvents.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_webapp,node_flightbook,node_hotelbook,node_seatui,node_roomui,node_priceui,node_cancelui,node_reviewui,node_statusui,node_recommendui toneBlue
class node_bookapi,node_bookservice,node_seatservice,node_roomservice,node_catalog,node_mongo toneAmber
class node_pricing,node_cancel,node_reviews,node_flightstatus,node_recommend toneMint
class node_eventhub,node_eventhook toneRose
class node_traveler toneIndigo
```

## Components

### Travel frontend

- [Travel pages](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/index.tsx): `makemytour/src/pages/index.tsx`
- [Flight booking](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/book-flight/%5Bid%5D/index.tsx): `makemytour/src/pages/book-flight/[id]/index.tsx`
- [Hotel booking](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/book-hotel/%5Bid%5D/index.tsx): `makemytour/src/pages/book-hotel/[id]/index.tsx`
- [Seat selection](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/SeatMap.tsx): `makemytour/src/components/booking/SeatMap.tsx`
- [Room selection](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/RoomPicker.tsx): `makemytour/src/components/booking/RoomPicker.tsx`
- [Price insights](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/booking/PriceInsight.tsx): `makemytour/src/components/booking/PriceInsight.tsx`
- [Cancellation interface](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/cancellation/CancelDialog.tsx): `makemytour/src/components/cancellation/CancelDialog.tsx`
- [Review interface](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/reviews/ReviewSection.tsx): `makemytour/src/components/reviews/ReviewSection.tsx`
- [Flight status page](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/pages/flight-status/index.tsx): `makemytour/src/pages/flight-status/index.tsx`
- [Recommendation cards](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/components/recommendations/Recommendations.tsx): `makemytour/src/components/recommendations/Recommendations.tsx`

### Booking services

- [Booking API](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/controllers/BookingController.java): `src/main/java/com/makemytrip/makemytrip/controllers/BookingController.java`
- [Booking service](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/BookingService.java): `src/main/java/com/makemytrip/makemytrip/services/BookingService.java`
- [Seat service](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/SeatService.java): `src/main/java/com/makemytrip/makemytrip/services/SeatService.java`
- [Room service](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/RoomService.java): `src/main/java/com/makemytrip/makemytrip/services/RoomService.java`
- [Flight and hotel data](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/models/Flight.java): `src/main/java/com/makemytrip/makemytrip/models/Flight.java`

### Travel features

- [Dynamic pricing](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/PricingService.java): `src/main/java/com/makemytrip/makemytrip/services/PricingService.java`
- [Cancellation and refunds](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/CancellationService.java): `src/main/java/com/makemytrip/makemytrip/services/CancellationService.java`
- [Reviews and ratings](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/ReviewService.java): `src/main/java/com/makemytrip/makemytrip/services/ReviewService.java`
- [Flight tracking](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/FlightStatusService.java): `src/main/java/com/makemytrip/makemytrip/services/FlightStatusService.java`
- [Recommendations](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/RecommendationService.java): `src/main/java/com/makemytrip/makemytrip/services/RecommendationService.java`

### Shared platform

- [Live event hub](https://github.com/krishna-mittall/makemytrip/blob/main/src/main/java/com/makemytrip/makemytrip/services/EventHub.java): `src/main/java/com/makemytrip/makemytrip/services/EventHub.java`
- [Live update hook](https://github.com/krishna-mittall/makemytrip/blob/main/makemytour/src/hooks/useEvents.ts): `makemytour/src/hooks/useEvents.ts`

### Other components

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

## Connections

- Traveler → Travel pages: searches
- Traveler → Flight booking: books flight
- Traveler → Hotel booking: books hotel
- Flight booking → Booking API: submits booking
- Booking API → Booking service: handles booking
- Booking service → Seat service: allocates seats
- Seat selection → Seat service: selects seats
- Room selection → Room service: selects rooms
- Price insights → Dynamic pricing: shows pricing
- Cancellation interface → Cancellation and refunds: requests cancellation
- Review interface → Reviews and ratings: submits reviews
- Flight status page → Flight tracking: tracks flights
- Recommendation cards → Recommendations: shows suggestions
- Live event hub → Live update hook: pushes updates
- Booking service → MongoDB: persists bookings
- Dynamic pricing → Flight and hotel data: enriches prices (evidence: `src/main/java/com/makemytrip/makemytrip/services/PricingService.java`)
- Recommendations → Dynamic pricing: enriches candidates (evidence: `src/main/java/com/makemytrip/makemytrip/services/RecommendationService.java`)
- Reviews and ratings → MongoDB: stores reviews
