# vinay99199/wanderlust architecture

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

- Interactive diagram: https://gitdiagram.com/vinay99199/wanderlust
- Repository: https://github.com/vinay99199/wanderlust

## Overview

Wanderlust is an Express/EJS travel-listing application backed by MongoDB. Users browse listings, create or manage listings, and can authenticate, save favourites, review listings, and book stays with Razorpay payments. The graph follows the documented HTTP routing and sampled controller/model calls; unsampled view rendering and several route implementations are not expanded into guessed relationships.

Main entry points: [`app.js`](https://github.com/vinay99199/wanderlust/blob/main/app.js) (Express application), [`routes/listing.js`](https://github.com/vinay99199/wanderlust/blob/main/routes/listing.js) (Listing routes), [`controllers/bookings.js`](https://github.com/vinay99199/wanderlust/blob/main/controllers/bookings.js) (Booking operations), [`models/listing.js`](https://github.com/vinay99199/wanderlust/blob/main/models/listing.js) (Listing model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_app["Express application<br/>[app.js]"]
  node_listing_validation["Request validation<br/>[middleware.js]"]
end

subgraph group_marketplace["Listings and reviews"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_listing_controller["Listing operations<br/>[listings.js]"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_review_controller["Review operations<br/>[reviews.js]"]
  node_cloud_storage["Image storage<br/>[cloudConfig.js]"]
end

subgraph group_booking["Booking and payment"]
  node_booking_routes["Booking routes<br/>[bookings.js]"]
  node_booking_controller["Booking operations<br/>[bookings.js]"]
  node_razorpay["Razorpay payments"]
end

subgraph group_identity["Accounts and support"]
  node_user_routes["Account routes<br/>[user.js]"]
  node_user_controller["Account operations<br/>[users.js]"]
  node_newsletter_routes["Newsletter routes<br/>[newsletter.js]"]
  node_support_routes["Support routes<br/>[support.js]"]
end

subgraph group_persistence["MongoDB models"]
  node_listing_model[("Listing model<br/>[listing.js]")]
  node_review_model[("Review model<br/>[review.js]")]
  node_booking_model[("Booking model<br/>[booking.js]")]
  node_user_model[("User model<br/>[user.js]")]
  node_newsletter_model[("Newsletter model<br/>[newsletter.js]")]
end

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

node_traveler -->|"uses"| node_app
node_app -->|"mounts routes"| node_listing_routes
node_app -->|"mounts routes"| node_review_routes
node_app -->|"mounts routes"| node_booking_routes
node_app -->|"mounts routes"| node_user_routes
node_app -->|"mounts routes"| node_newsletter_routes
node_app -->|"mounts routes"| node_support_routes
node_app -->|"authenticates with"| node_user_model
node_listing_routes -->|"dispatches"| node_listing_controller
node_listing_routes -->|"validates requests"| node_listing_validation
node_listing_routes -->|"uploads images"| node_cloud_storage
node_listing_controller -->|"reads and writes"| node_listing_model
node_review_routes -->|"dispatches"| node_review_controller
node_review_routes -->|"checks reviews"| node_listing_validation
node_review_controller -->|"creates and deletes"| node_review_model
node_review_controller -->|"updates listing"| node_listing_model
node_booking_routes -->|"dispatches"| node_booking_controller
node_booking_controller -->|"manages bookings"| node_booking_model
node_booking_controller -->|"checks listing"| node_listing_model
node_booking_controller -->|"charges and refunds"| node_razorpay
node_user_routes -->|"dispatches"| node_user_controller
node_user_controller -->|"manages accounts"| node_user_model
node_newsletter_routes -->|"stores submissions"| node_newsletter_model
node_support_routes -->|"uses account data"| node_user_model
node_app -->|"connects"| node_mongo
node_listing_model -->|"persists listings"| node_mongo
node_review_model -->|"persists reviews"| node_mongo
node_booking_model -->|"persists bookings"| node_mongo
node_user_model -->|"persists accounts"| node_mongo
node_newsletter_model -->|"persists subscribers"| node_mongo

click node_app "https://github.com/vinay99199/wanderlust/blob/main/app.js"
click node_listing_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/listing.js"
click node_listing_controller "https://github.com/vinay99199/wanderlust/blob/main/controllers/listings.js"
click node_listing_model "https://github.com/vinay99199/wanderlust/blob/main/models/listing.js"
click node_review_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/review.js"
click node_review_controller "https://github.com/vinay99199/wanderlust/blob/main/controllers/reviews.js"
click node_review_model "https://github.com/vinay99199/wanderlust/blob/main/models/review.js"
click node_listing_validation "https://github.com/vinay99199/wanderlust/blob/main/middleware.js"
click node_booking_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/bookings.js"
click node_booking_controller "https://github.com/vinay99199/wanderlust/blob/main/controllers/bookings.js"
click node_booking_model "https://github.com/vinay99199/wanderlust/blob/main/models/booking.js"
click node_user_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/user.js"
click node_user_controller "https://github.com/vinay99199/wanderlust/blob/main/controllers/users.js"
click node_user_model "https://github.com/vinay99199/wanderlust/blob/main/models/user.js"
click node_newsletter_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/newsletter.js"
click node_newsletter_model "https://github.com/vinay99199/wanderlust/blob/main/models/newsletter.js"
click node_support_routes "https://github.com/vinay99199/wanderlust/blob/main/routes/support.js"
click node_cloud_storage "https://github.com/vinay99199/wanderlust/blob/main/cloudConfig.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_listing_validation toneBlue
class node_listing_routes,node_listing_controller,node_review_routes,node_review_controller,node_cloud_storage,node_mongo toneAmber
class node_booking_routes,node_booking_controller,node_razorpay toneMint
class node_user_routes,node_user_controller,node_newsletter_routes,node_support_routes toneRose
class node_listing_model,node_review_model,node_booking_model,node_user_model,node_newsletter_model,node_traveler toneIndigo
```

## Components

### Web entry

- [Express application](https://github.com/vinay99199/wanderlust/blob/main/app.js): `app.js`
- [Request validation](https://github.com/vinay99199/wanderlust/blob/main/middleware.js): `middleware.js`

### Listings and reviews

- [Listing routes](https://github.com/vinay99199/wanderlust/blob/main/routes/listing.js): `routes/listing.js`
- [Listing operations](https://github.com/vinay99199/wanderlust/blob/main/controllers/listings.js): `controllers/listings.js`
- [Review routes](https://github.com/vinay99199/wanderlust/blob/main/routes/review.js): `routes/review.js`
- [Review operations](https://github.com/vinay99199/wanderlust/blob/main/controllers/reviews.js): `controllers/reviews.js`
- [Image storage](https://github.com/vinay99199/wanderlust/blob/main/cloudConfig.js): `cloudConfig.js`

### Booking and payment

- [Booking routes](https://github.com/vinay99199/wanderlust/blob/main/routes/bookings.js): `routes/bookings.js`
- [Booking operations](https://github.com/vinay99199/wanderlust/blob/main/controllers/bookings.js): `controllers/bookings.js`
- **Razorpay payments**

### Accounts and support

- [Account routes](https://github.com/vinay99199/wanderlust/blob/main/routes/user.js): `routes/user.js`
- [Account operations](https://github.com/vinay99199/wanderlust/blob/main/controllers/users.js): `controllers/users.js`
- [Newsletter routes](https://github.com/vinay99199/wanderlust/blob/main/routes/newsletter.js): `routes/newsletter.js`
- [Support routes](https://github.com/vinay99199/wanderlust/blob/main/routes/support.js): `routes/support.js`

### MongoDB models

- [Listing model](https://github.com/vinay99199/wanderlust/blob/main/models/listing.js): `models/listing.js`
- [Review model](https://github.com/vinay99199/wanderlust/blob/main/models/review.js): `models/review.js`
- [Booking model](https://github.com/vinay99199/wanderlust/blob/main/models/booking.js): `models/booking.js`
- [User model](https://github.com/vinay99199/wanderlust/blob/main/models/user.js): `models/user.js`
- [Newsletter model](https://github.com/vinay99199/wanderlust/blob/main/models/newsletter.js): `models/newsletter.js`

### Other components

- **Traveler / host**
- **MongoDB**

## Connections

- Traveler / host → Express application: uses (evidence: `README.md`)
- Express application → Listing routes: mounts routes (evidence: `app.js`)
- Express application → Review routes: mounts routes (evidence: `app.js`)
- Express application → Booking routes: mounts routes (evidence: `app.js`)
- Express application → Account routes: mounts routes (evidence: `app.js`)
- Express application → Newsletter routes: mounts routes (evidence: `app.js`)
- Express application → Support routes: mounts routes (evidence: `app.js`)
- Express application → User model: authenticates with (evidence: `app.js`)
- Listing routes → Listing operations: dispatches (evidence: `routes/listing.js`)
- Listing routes → Request validation: validates requests (evidence: `routes/listing.js`)
- Listing routes → Image storage: uploads images (evidence: `routes/listing.js`)
- Listing operations → Listing model: reads and writes (evidence: `controllers/listings.js`)
- Review routes → Review operations: dispatches (evidence: `routes/review.js`)
- Review routes → Request validation: checks reviews (evidence: `routes/review.js`)
- Review operations → Review model: creates and deletes (evidence: `controllers/reviews.js`)
- Review operations → Listing model: updates listing (evidence: `controllers/reviews.js`)
- Booking routes → Booking operations: dispatches (evidence: `routes/bookings.js`)
- Booking operations → Booking model: manages bookings (evidence: `controllers/bookings.js`)
- Booking operations → Listing model: checks listing (evidence: `controllers/bookings.js`)
- Booking operations → Razorpay payments: charges and refunds (evidence: `controllers/bookings.js`)
- Account routes → Account operations: dispatches (evidence: `routes/user.js`)
- Account operations → User model: manages accounts (evidence: `controllers/users.js`)
- Newsletter routes → Newsletter model: stores submissions (evidence: `routes/newsletter.js`)
- Support routes → User model: uses account data (evidence: `routes/support.js`)
- Express application → MongoDB: connects (evidence: `app.js`)
- Listing model → MongoDB: persists listings (evidence: `models/listing.js`)
- Review model → MongoDB: persists reviews (evidence: `models/review.js`)
- Booking model → MongoDB: persists bookings (evidence: `models/booking.js`)
- User model → MongoDB: persists accounts (evidence: `models/user.js`)
- Newsletter model → MongoDB: persists subscribers (evidence: `models/newsletter.js`)
