# selawi7/jetsetgo architecture

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

- Interactive diagram: https://gitdiagram.com/selawi7/jetsetgo
- Repository: https://github.com/selawi7/jetsetgo

## Overview

JetSetGo is a travel-planning web application: users browse destinations, view destination details, get recommendations, and search flights and hotels; account registration, login, and profile preferences support personalized use. The React client routes requests through its API service to an Express server, while travel and place searches also use external providers. The graph reflects shown imports, calls, and route mounts; several UI-to-API connections and unsampled backend details are omitted rather than inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/selawi7/jetsetgo/blob/main/client/src/App.jsx) (App router), [`server/src/server.js`](https://github.com/selawi7/jetsetgo/blob/main/server/src/server.js) (Express server), [`server/src/routes/recommendations.js`](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/recommendations.js) (Recommendation routes), [`client/src/components/DestinationDetails.jsx`](https://github.com/selawi7/jetsetgo/blob/main/client/src/components/DestinationDetails.jsx) (Destination details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Travel client"]
  node_app["App router<br/>[App.jsx]"]
  node_pages["Travel pages"]
  node_destination_details["Destination details"]
  node_travel_search["Travel search<br/>[TravelSearch.jsx]"]
  node_auth_state["Auth state<br/>[authSlice.js]"]
  node_destination_state["Destination state"]
  node_recommendation_state["Recommendation state"]
end

subgraph group_services["Client services"]
  node_api_service["API client<br/>[apiService.js]"]
  node_destination_service["Destination service"]
  node_travel_service["Flight and hotel service<br/>[travelService.js]"]
  node_places_service["Places service<br/>[placesService.js]"]
  node_weather_service["Weather service<br/>[weatherService.js]"]
end

subgraph group_server["API server"]
  node_express_server["Express server<br/>[server.js]"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_destination_routes["Destination routes<br/>[destinations.js]"]
  node_recommendation_routes["Recommendation routes<br/>[recommendations.js]"]
  node_accommodation_routes["Accommodation routes<br/>[accommodations.js]"]
  node_activity_routes["Activity routes<br/>[activities.js]"]
  node_auth_middleware["JWT middleware<br/>[auth.js]"]
  node_unsplash["Photo lookup<br/>[unsplash.js]"]
end

subgraph group_data["Domain data"]
  node_user_model[("User model<br/>[User.js]")]
  node_destination_model[("Destination model<br/>[Destination.js]")]
end

node_traveler(("Traveler"))
node_mongo[("MongoDB")]
node_booking{{"Booking.com API"}}
node_google_places{{"Google Places"}}
node_openweather{{"OpenWeather"}}
node_openai{{"OpenAI"}}

node_traveler -->|"uses"| node_app
node_app -->|"routes to"| node_pages
node_app -->|"routes to"| node_destination_details
node_app -->|"routes to"| node_travel_search
node_app -->|"dispatches"| node_auth_state
node_auth_state -->|"requests user data"| node_api_service
node_api_service -->|"sends API requests"| node_express_server
node_express_server -->|"mounts"| node_auth_routes
node_express_server -->|"mounts"| node_destination_routes
node_express_server -->|"mounts"| node_recommendation_routes
node_express_server -->|"mounts"| node_accommodation_routes
node_express_server -->|"mounts"| node_activity_routes
node_auth_routes -->|"reads and saves"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_destination_routes -->|"queries"| node_destination_model
node_recommendation_routes -->|"protects routes"| node_auth_middleware
node_recommendation_routes -->|"queries"| node_destination_model
node_recommendation_routes -->|"requests suggestions"| node_openai
node_recommendation_routes -->|"gets city photos"| node_unsplash
node_express_server -->|"connects"| node_mongo
node_travel_search -->|"searches flights and hotels"| node_travel_service
node_travel_service -->|"searches"| node_booking
node_destination_details -->|"loads place information"| node_places_service
node_destination_details -->|"loads weather"| node_weather_service
node_places_service -->|"searches places"| node_google_places
node_weather_service -.->|"requests forecasts"| node_openweather
node_api_service -.->|"shares API configuration"| node_destination_service
node_app -.->|"provides shared state"| node_destination_state
node_app -.->|"provides shared state"| node_recommendation_state

click node_app "https://github.com/selawi7/jetsetgo/blob/main/client/src/App.jsx"
click node_pages "https://github.com/selawi7/jetsetgo/tree/main/client/src/pages"
click node_destination_details "https://github.com/selawi7/jetsetgo/blob/main/client/src/components/DestinationDetails.jsx"
click node_travel_search "https://github.com/selawi7/jetsetgo/blob/main/client/src/components/TravelSearch.jsx"
click node_auth_state "https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/authSlice.js"
click node_destination_state "https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/destinationSlice.js"
click node_recommendation_state "https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/recommendationSlice.js"
click node_api_service "https://github.com/selawi7/jetsetgo/blob/main/client/src/services/apiService.js"
click node_destination_service "https://github.com/selawi7/jetsetgo/blob/main/client/src/services/destinationService.js"
click node_travel_service "https://github.com/selawi7/jetsetgo/blob/main/client/src/services/travelService.js"
click node_places_service "https://github.com/selawi7/jetsetgo/blob/main/client/src/services/placesService.js"
click node_weather_service "https://github.com/selawi7/jetsetgo/blob/main/client/src/services/weatherService.js"
click node_express_server "https://github.com/selawi7/jetsetgo/blob/main/server/src/server.js"
click node_auth_routes "https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/auth.js"
click node_destination_routes "https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/destinations.js"
click node_recommendation_routes "https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/recommendations.js"
click node_accommodation_routes "https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/accommodations.js"
click node_activity_routes "https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/activities.js"
click node_auth_middleware "https://github.com/selawi7/jetsetgo/blob/main/server/src/middleware/auth.js"
click node_user_model "https://github.com/selawi7/jetsetgo/blob/main/server/src/models/User.js"
click node_destination_model "https://github.com/selawi7/jetsetgo/blob/main/server/src/models/Destination.js"
click node_unsplash "https://github.com/selawi7/jetsetgo/blob/main/server/src/utils/unsplash.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_pages,node_destination_details,node_travel_search,node_auth_state,node_destination_state,node_recommendation_state toneBlue
class node_api_service,node_destination_service,node_travel_service,node_places_service,node_weather_service,node_mongo toneAmber
class node_express_server,node_auth_routes,node_destination_routes,node_recommendation_routes,node_accommodation_routes,node_activity_routes,node_auth_middleware,node_unsplash,node_booking toneMint
class node_user_model,node_destination_model toneRose
class node_traveler,node_google_places,node_openweather,node_openai toneIndigo
```

## Components

### Travel client

- [App router](https://github.com/selawi7/jetsetgo/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Travel pages](https://github.com/selawi7/jetsetgo/tree/main/client/src/pages): `client/src/pages`
- [Destination details](https://github.com/selawi7/jetsetgo/blob/main/client/src/components/DestinationDetails.jsx): `client/src/components/DestinationDetails.jsx`
- [Travel search](https://github.com/selawi7/jetsetgo/blob/main/client/src/components/TravelSearch.jsx): `client/src/components/TravelSearch.jsx`
- [Auth state](https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/authSlice.js): `client/src/store/slices/authSlice.js`
- [Destination state](https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/destinationSlice.js): `client/src/store/slices/destinationSlice.js`
- [Recommendation state](https://github.com/selawi7/jetsetgo/blob/main/client/src/store/slices/recommendationSlice.js): `client/src/store/slices/recommendationSlice.js`

### Client services

- [API client](https://github.com/selawi7/jetsetgo/blob/main/client/src/services/apiService.js): `client/src/services/apiService.js`
- [Destination service](https://github.com/selawi7/jetsetgo/blob/main/client/src/services/destinationService.js): `client/src/services/destinationService.js`
- [Flight and hotel service](https://github.com/selawi7/jetsetgo/blob/main/client/src/services/travelService.js): `client/src/services/travelService.js`
- [Places service](https://github.com/selawi7/jetsetgo/blob/main/client/src/services/placesService.js): `client/src/services/placesService.js`
- [Weather service](https://github.com/selawi7/jetsetgo/blob/main/client/src/services/weatherService.js): `client/src/services/weatherService.js`

### API server

- [Express server](https://github.com/selawi7/jetsetgo/blob/main/server/src/server.js): `server/src/server.js`
- [Authentication routes](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/auth.js): `server/src/routes/auth.js`
- [Destination routes](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/destinations.js): `server/src/routes/destinations.js`
- [Recommendation routes](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/recommendations.js): `server/src/routes/recommendations.js`
- [Accommodation routes](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/accommodations.js): `server/src/routes/accommodations.js`
- [Activity routes](https://github.com/selawi7/jetsetgo/blob/main/server/src/routes/activities.js): `server/src/routes/activities.js`
- [JWT middleware](https://github.com/selawi7/jetsetgo/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Photo lookup](https://github.com/selawi7/jetsetgo/blob/main/server/src/utils/unsplash.js): `server/src/utils/unsplash.js`

### Domain data

- [User model](https://github.com/selawi7/jetsetgo/blob/main/server/src/models/User.js): `server/src/models/User.js`
- [Destination model](https://github.com/selawi7/jetsetgo/blob/main/server/src/models/Destination.js): `server/src/models/Destination.js`

### Other components

- **Traveler**
- **MongoDB**
- **Booking.com API**
- **Google Places**
- **OpenWeather**
- **OpenAI**

## Connections

- Traveler → App router: uses (evidence: `client/src/App.jsx`)
- App router → Travel pages: routes to (evidence: `client/src/App.jsx`)
- App router → Destination details: routes to (evidence: `client/src/App.jsx`)
- App router → Travel search: routes to (evidence: `client/src/App.jsx`)
- App router → Auth state: dispatches (evidence: `client/src/App.jsx`)
- Auth state → API client: requests user data (evidence: `client/src/store/slices/authSlice.js`)
- API client → Express server: sends API requests (evidence: `client/src/services/apiService.js`)
- Express server → Authentication routes: mounts (evidence: `server/src/server.js`)
- Express server → Destination routes: mounts (evidence: `server/src/server.js`)
- Express server → Recommendation routes: mounts (evidence: `server/src/server.js`)
- Express server → Accommodation routes: mounts (evidence: `server/src/server.js`)
- Express server → Activity routes: mounts (evidence: `server/src/server.js`)
- Authentication routes → User model: reads and saves (evidence: `server/src/routes/auth.js`)
- JWT middleware → User model: loads user (evidence: `server/src/middleware/auth.js`)
- Destination routes → Destination model: queries (evidence: `server/src/routes/destinations.js`)
- Recommendation routes → JWT middleware: protects routes (evidence: `server/src/routes/recommendations.js`)
- Recommendation routes → Destination model: queries (evidence: `server/src/routes/recommendations.js`)
- Recommendation routes → OpenAI: requests suggestions (evidence: `server/src/routes/recommendations.js`)
- Recommendation routes → Photo lookup: gets city photos (evidence: `server/src/routes/recommendations.js`)
- Express server → MongoDB: connects (evidence: `server/src/server.js`)
- Travel search → Flight and hotel service: searches flights and hotels (evidence: `client/src/components/TravelSearch.jsx`)
- Flight and hotel service → Booking.com API: searches (evidence: `client/src/services/travelService.js`)
- Destination details → Places service: loads place information (evidence: `client/src/components/DestinationDetails.jsx`)
- Destination details → Weather service: loads weather (evidence: `client/src/components/DestinationDetails.jsx`)
- Places service → Google Places: searches places (evidence: `client/src/services/placesService.js`)
- Weather service → OpenWeather: requests forecasts
- API client → Destination service: shares API configuration
- App router → Destination state: provides shared state
- App router → Recommendation state: provides shared state
