# yrpyash22/wonderlist-project architecture

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

- Interactive diagram: https://gitdiagram.com/yrpyash22/wonderlist-project
- Repository: https://github.com/yrpyash22/wonderlist-project

## Overview

Wanderlust is an accommodation-listing web app: visitors browse or search category-filtered stays, view listing details and map coordinates, while signed-in users create, edit, and delete listings and post reviews. The Express entry point mounts listing, review, and user routes, and controllers render EJS pages using Mongo-backed models. Listing creation also geocodes locations and accepts Cloudinary-backed image uploads. User routes and their implementation were not sampled, so account flows are represented from the route wiring and README/configuration evidence only.

Main entry points: [`app.js`](https://github.com/yrpyash22/wonderlist-project/blob/main/app.js) (Express app), [`controllers/listings.js`](https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/listings.js) (Listing controller), [`controllers/reviews.js`](https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/reviews.js) (Review controller), [`models/user.js`](https://github.com/yrpyash22/wonderlist-project/blob/main/models/user.js) (User model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Express app<br/>[app.js]"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_user_routes["User routes<br/>[user.js]"]
end

subgraph group_catalog["Stay listings"]
  node_listing_controller["Listing controller<br/>[listings.js]"]
  node_listing_model["Listing model<br/>[listing.js]"]
  node_listing_views["Listing pages"]
  node_map_ui["Listing map<br/>[map.js]"]
end

subgraph group_community["Accounts and reviews"]
  node_review_controller["Review controller<br/>[reviews.js]"]
  node_review_model["Review model<br/>[review.js]"]
  node_user_controller["User controller<br/>[users.js]"]
  node_user_model["User model<br/>[user.js]"]
  node_user_pages["Account pages"]
end

subgraph group_integrations["External services"]
  node_geocoder["Geocoding helper<br/>[geocode.js]"]
  node_mongo[("MongoDB")]
  node_cloudinary["Cloudinary storage<br/>[cloudConfig.js]"]
  node_nominatim["Nominatim"]
end

node_traveler(("Traveler"))

node_traveler -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_listing_routes
node_app -->|"mounts routes"| node_review_routes
node_app -->|"mounts routes"| node_user_routes
node_app -->|"connects"| node_mongo
node_app -->|"authenticates with"| node_user_model
node_listing_routes -->|"dispatches"| node_listing_controller
node_listing_controller -->|"queries and saves"| node_listing_model
node_listing_controller -->|"renders"| node_listing_views
node_listing_controller -->|"requests coordinates"| node_geocoder
node_geocoder -->|"looks up places"| node_nominatim
node_listing_routes -->|"uploads images"| node_cloudinary
node_listing_controller -->|"renders coordinates"| node_map_ui
node_review_routes -->|"dispatches"| node_review_controller
node_review_controller -->|"updates listing reviews"| node_listing_model
node_review_controller -->|"creates and deletes"| node_review_model
node_review_controller -->|"uses author identity"| node_user_model
node_user_routes -->|"dispatches"| node_user_controller
node_user_controller -->|"manages accounts"| node_user_model
node_user_controller -->|"renders"| node_user_pages
node_listing_model -->|"persists listings"| node_mongo
node_review_model -->|"persists reviews"| node_mongo
node_user_model -->|"persists accounts"| node_mongo

click node_app "https://github.com/yrpyash22/wonderlist-project/blob/main/app.js"
click node_listing_routes "https://github.com/yrpyash22/wonderlist-project/blob/main/routes/listing.js"
click node_review_routes "https://github.com/yrpyash22/wonderlist-project/blob/main/routes/review.js"
click node_user_routes "https://github.com/yrpyash22/wonderlist-project/blob/main/routes/user.js"
click node_listing_controller "https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/listings.js"
click node_listing_model "https://github.com/yrpyash22/wonderlist-project/blob/main/models/listing.js"
click node_listing_views "https://github.com/yrpyash22/wonderlist-project/tree/main/views/listings"
click node_map_ui "https://github.com/yrpyash22/wonderlist-project/blob/main/public/js/map.js"
click node_geocoder "https://github.com/yrpyash22/wonderlist-project/blob/main/utils/geocode.js"
click node_review_controller "https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/reviews.js"
click node_review_model "https://github.com/yrpyash22/wonderlist-project/blob/main/models/review.js"
click node_user_controller "https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/users.js"
click node_user_model "https://github.com/yrpyash22/wonderlist-project/blob/main/models/user.js"
click node_user_pages "https://github.com/yrpyash22/wonderlist-project/tree/main/views/users"
click node_cloudinary "https://github.com/yrpyash22/wonderlist-project/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_routes,node_review_routes,node_user_routes toneBlue
class node_listing_controller,node_listing_model,node_listing_views,node_map_ui toneAmber
class node_review_controller,node_review_model,node_user_controller,node_user_model,node_user_pages toneMint
class node_geocoder,node_mongo,node_cloudinary,node_nominatim toneRose
class node_traveler toneIndigo
```

## Components

### Web application

- [Express app](https://github.com/yrpyash22/wonderlist-project/blob/main/app.js): `app.js`
- [Listing routes](https://github.com/yrpyash22/wonderlist-project/blob/main/routes/listing.js): `routes/listing.js`
- [Review routes](https://github.com/yrpyash22/wonderlist-project/blob/main/routes/review.js): `routes/review.js`
- [User routes](https://github.com/yrpyash22/wonderlist-project/blob/main/routes/user.js): `routes/user.js`

### Stay listings

- [Listing controller](https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/listings.js): `controllers/listings.js`
- [Listing model](https://github.com/yrpyash22/wonderlist-project/blob/main/models/listing.js): `models/listing.js`
- [Listing pages](https://github.com/yrpyash22/wonderlist-project/tree/main/views/listings): `views/listings`
- [Listing map](https://github.com/yrpyash22/wonderlist-project/blob/main/public/js/map.js): `public/js/map.js`

### Accounts and reviews

- [Review controller](https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/reviews.js): `controllers/reviews.js`
- [Review model](https://github.com/yrpyash22/wonderlist-project/blob/main/models/review.js): `models/review.js`
- [User controller](https://github.com/yrpyash22/wonderlist-project/blob/main/controllers/users.js): `controllers/users.js`
- [User model](https://github.com/yrpyash22/wonderlist-project/blob/main/models/user.js): `models/user.js`
- [Account pages](https://github.com/yrpyash22/wonderlist-project/tree/main/views/users): `views/users`

### External services

- [Geocoding helper](https://github.com/yrpyash22/wonderlist-project/blob/main/utils/geocode.js): `utils/geocode.js`
- **MongoDB**
- [Cloudinary storage](https://github.com/yrpyash22/wonderlist-project/blob/main/cloudConfig.js): `cloudConfig.js`
- **Nominatim**

### Other components

- **Traveler**

## Connections

- Traveler → Express app: sends requests
- Express app → Listing routes: mounts routes
- Express app → Review routes: mounts routes
- Express app → User routes: mounts routes
- Express app → MongoDB: connects
- Express app → User model: authenticates with
- Listing routes → Listing controller: dispatches
- Listing controller → Listing model: queries and saves
- Listing controller → Listing pages: renders
- Listing controller → Geocoding helper: requests coordinates
- Geocoding helper → Nominatim: looks up places
- Listing routes → Cloudinary storage: uploads images
- Listing controller → Listing map: renders coordinates
- Review routes → Review controller: dispatches
- Review controller → Listing model: updates listing reviews
- Review controller → Review model: creates and deletes
- Review controller → User model: uses author identity
- User routes → User controller: dispatches
- User controller → User model: manages accounts
- User controller → Account pages: renders
- Listing model → MongoDB: persists listings
- Review model → MongoDB: persists reviews
- User model → MongoDB: persists accounts
