# utsbasic/wanderlust architecture

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

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

## Overview

WanderLust is an Airbnb-style campground listing application. Visitors browse listings and view their details; signed-in users can create, edit, and delete listings, upload images, and add or remove reviews. Separate account routes handle signup and login. The README also advertises interactive maps. The graph reflects documented capabilities, but map wiring and several implementation details are unsampled, so their relationship is left unverified.

Main entry points: [`app.js`](https://github.com/utsbasic/wanderlust/blob/main/app.js) (Express application), [`routes/listing.js`](https://github.com/utsbasic/wanderlust/blob/main/routes/listing.js) (Listing routes), [`routes/review.js`](https://github.com/utsbasic/wanderlust/blob/main/routes/review.js) (Review routes), [`routes/user.js`](https://github.com/utsbasic/wanderlust/blob/main/routes/user.js) (Account routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_domain["Listing and reviews"]
  node_listing_controller["Listing operations<br/>[listing.js]"]
  node_review_controller["Review operations<br/>[reviews.js]"]
  node_listing_model[("Listing records<br/>[db.js]")]
  node_review_model[("Review records<br/>[review.js]")]
  node_listing_validation["Listing and review validation<br/>[schema.js]"]
end

subgraph group_identity["Accounts and access"]
  node_access_middleware["Access checks<br/>[middleware.js]"]
  node_user_controller["Account operations<br/>[users.js]"]
  node_user_model[("User records<br/>[user.js]")]
end

subgraph group_experience["Views and integrations"]
  node_listing_views["Listing pages"]
  node_account_views["Account pages"]
  node_error_view["Error page<br/>[error.ejs]"]
  node_image_storage_config["Image storage setup<br/>[cloudConfig.js]"]
  node_map_client["Interactive map client<br/>[map.js]"]
end

node_visitor(("Visitor"))
node_mongo[("MongoDB")]
node_cloudinary[("Cloudinary")]

node_visitor -->|"sends requests"| node_app
node_app -->|"mounts listings"| node_listing_routes
node_app -->|"mounts reviews"| node_review_routes
node_app -->|"mounts accounts"| node_user_routes
node_app -->|"connects to"| node_mongo
node_app -->|"configures Passport"| node_user_model
node_app -->|"renders errors"| node_error_view
node_listing_routes -->|"dispatches to"| node_listing_controller
node_listing_routes -->|"checks access"| node_access_middleware
node_listing_routes -->|"validates input"| node_listing_validation
node_listing_routes -->|"uses storage"| node_image_storage_config
node_listing_controller -->|"reads and writes"| node_listing_model
node_listing_controller -->|"renders pages"| node_listing_views
node_review_routes -->|"dispatches to"| node_review_controller
node_review_routes -->|"checks access"| node_access_middleware
node_review_routes -->|"validates input"| node_listing_validation
node_review_controller -->|"updates listing"| node_listing_model
node_review_controller -->|"creates or deletes"| node_review_model
node_user_routes -->|"dispatches to"| node_user_controller
node_user_routes -->|"saves redirect"| node_access_middleware
node_user_controller -->|"uses accounts"| node_user_model
node_image_storage_config -.->|"configures uploads"| node_cloudinary
node_listing_views -.->|"map wiring unverified"| node_map_client

click node_app "https://github.com/utsbasic/wanderlust/blob/main/app.js"
click node_listing_routes "https://github.com/utsbasic/wanderlust/blob/main/routes/listing.js"
click node_review_routes "https://github.com/utsbasic/wanderlust/blob/main/routes/review.js"
click node_user_routes "https://github.com/utsbasic/wanderlust/blob/main/routes/user.js"
click node_listing_controller "https://github.com/utsbasic/wanderlust/blob/main/controllers/listing.js"
click node_review_controller "https://github.com/utsbasic/wanderlust/blob/main/controllers/reviews.js"
click node_listing_model "https://github.com/utsbasic/wanderlust/blob/main/models/db.js"
click node_review_model "https://github.com/utsbasic/wanderlust/blob/main/models/review.js"
click node_listing_validation "https://github.com/utsbasic/wanderlust/blob/main/schema.js"
click node_access_middleware "https://github.com/utsbasic/wanderlust/blob/main/middleware.js"
click node_user_controller "https://github.com/utsbasic/wanderlust/blob/main/controllers/users.js"
click node_user_model "https://github.com/utsbasic/wanderlust/blob/main/models/user.js"
click node_listing_views "https://github.com/utsbasic/wanderlust/tree/main/views/listings"
click node_account_views "https://github.com/utsbasic/wanderlust/tree/main/views/users"
click node_error_view "https://github.com/utsbasic/wanderlust/blob/main/views/error.ejs"
click node_image_storage_config "https://github.com/utsbasic/wanderlust/blob/main/cloudConfig.js"
click node_map_client "https://github.com/utsbasic/wanderlust/blob/main/public/js/map.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_review_controller,node_listing_model,node_review_model,node_listing_validation,node_mongo,node_cloudinary toneAmber
class node_access_middleware,node_user_controller,node_user_model toneMint
class node_listing_views,node_account_views,node_error_view,node_image_storage_config,node_map_client toneRose
class node_visitor toneIndigo
```

## Components

### Web routing

- [Express application](https://github.com/utsbasic/wanderlust/blob/main/app.js): `app.js`
- [Listing routes](https://github.com/utsbasic/wanderlust/blob/main/routes/listing.js): `routes/listing.js`
- [Review routes](https://github.com/utsbasic/wanderlust/blob/main/routes/review.js): `routes/review.js`
- [Account routes](https://github.com/utsbasic/wanderlust/blob/main/routes/user.js): `routes/user.js`

### Listing and reviews

- [Listing operations](https://github.com/utsbasic/wanderlust/blob/main/controllers/listing.js): `controllers/listing.js`
- [Review operations](https://github.com/utsbasic/wanderlust/blob/main/controllers/reviews.js): `controllers/reviews.js`
- [Listing records](https://github.com/utsbasic/wanderlust/blob/main/models/db.js): `models/db.js`
- [Review records](https://github.com/utsbasic/wanderlust/blob/main/models/review.js): `models/review.js`
- [Listing and review validation](https://github.com/utsbasic/wanderlust/blob/main/schema.js): `schema.js`

### Accounts and access

- [Access checks](https://github.com/utsbasic/wanderlust/blob/main/middleware.js): `middleware.js`
- [Account operations](https://github.com/utsbasic/wanderlust/blob/main/controllers/users.js): `controllers/users.js`
- [User records](https://github.com/utsbasic/wanderlust/blob/main/models/user.js): `models/user.js`

### Views and integrations

- [Listing pages](https://github.com/utsbasic/wanderlust/tree/main/views/listings): `views/listings`
- [Account pages](https://github.com/utsbasic/wanderlust/tree/main/views/users): `views/users`
- [Error page](https://github.com/utsbasic/wanderlust/blob/main/views/error.ejs): `views/error.ejs`
- [Image storage setup](https://github.com/utsbasic/wanderlust/blob/main/cloudConfig.js): `cloudConfig.js`
- [Interactive map client](https://github.com/utsbasic/wanderlust/blob/main/public/js/map.js): `public/js/map.js`

### Other components

- **Visitor**
- **MongoDB**
- **Cloudinary**

## Connections

- Visitor → Express application: sends requests (evidence: `app.js`)
- Express application → Listing routes: mounts listings (evidence: `app.js`)
- Express application → Review routes: mounts reviews (evidence: `app.js`)
- Express application → Account routes: mounts accounts (evidence: `app.js`)
- Express application → MongoDB: connects to (evidence: `app.js`)
- Express application → User records: configures Passport (evidence: `app.js`)
- Express application → Error page: renders errors (evidence: `app.js`)
- Listing routes → Listing operations: dispatches to (evidence: `routes/listing.js`)
- Listing routes → Access checks: checks access (evidence: `routes/listing.js`)
- Listing routes → Listing and review validation: validates input
- Listing routes → Image storage setup: uses storage (evidence: `routes/listing.js`)
- Listing operations → Listing records: reads and writes (evidence: `controllers/listing.js`)
- Listing operations → Listing pages: renders pages (evidence: `controllers/listing.js`)
- Review routes → Review operations: dispatches to (evidence: `routes/review.js`)
- Review routes → Access checks: checks access (evidence: `routes/review.js`)
- Review routes → Listing and review validation: validates input
- Review operations → Listing records: updates listing (evidence: `controllers/reviews.js`)
- Review operations → Review records: creates or deletes (evidence: `controllers/reviews.js`)
- Account routes → Account operations: dispatches to (evidence: `routes/user.js`)
- Account routes → Access checks: saves redirect (evidence: `routes/user.js`)
- Account operations → User records: uses accounts (evidence: `controllers/users.js`)
- Image storage setup → Cloudinary: configures uploads (evidence: `README.md`)
- Listing pages → Interactive map client: map wiring unverified
