# madeeha-tazeen/wanderlust- architecture

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

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

## Overview

Wanderlust is an Express/Mongoose vacation-listing application. Visitors browse listings and listing details; authenticated users create, edit, and delete listings, submit reviews, and sign up or log in. Routes own validation and database operations, while EJS views render results. The supplied excerpts document listing and review flows, authentication, and MongoDB setup; other UI details and route internals are not inferred. The README provides no further capability detail.

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

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Express app<br/>[app.js]"]
  node_validation["Request validation<br/>[schema.js]"]
  node_async_errors["Async wrapper<br/>[wrapAsync.js]"]
  node_error_type["HTTP errors<br/>[ExpressError.js]"]
end

subgraph group_domain["Marketplace domain"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_listing_model["Listing model<br/>[listing.js]"]
  node_review_model["Review model<br/>[review.js]"]
  node_mongodb[("MongoDB")]
  node_seed_data["Sample listings<br/>[data.js]"]
  node_seed_runner["Seed runner<br/>[index.js]"]
end

subgraph group_identity["Identity"]
  node_user_routes["Account routes<br/>[user.js]"]
  node_auth_middleware["Login middleware<br/>[middleware.js]"]
  node_user_model["User model<br/>[user.js]"]
end

subgraph group_views["User interface"]
  node_views["EJS pages"]
  node_listing_pages["Listing pages"]
  node_account_pages["Account pages"]
  node_home_page["Home page<br/>[home.ejs]"]
end

node_visitor(("Visitor"))

node_visitor -->|"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 -->|"queries API"| node_listing_model
node_app -->|"configures auth"| node_user_model
node_app -->|"connects"| node_mongodb
node_app -->|"renders"| node_home_page
node_listing_routes -->|"reads and writes"| node_listing_model
node_listing_routes -->|"validates input"| node_validation
node_listing_routes -->|"checks login"| node_auth_middleware
node_listing_routes -->|"wraps handlers"| node_async_errors
node_listing_routes -->|"raises errors"| node_error_type
node_listing_routes -->|"renders listing views"| node_listing_pages
node_listing_model -->|"deletes related reviews"| node_review_model
node_review_routes -->|"loads and updates"| node_listing_model
node_review_routes -->|"creates reviews"| node_review_model
node_review_routes -->|"validates input"| node_validation
node_review_routes -->|"wraps handlers"| node_async_errors
node_review_routes -->|"raises errors"| node_error_type
node_user_routes -->|"registers users"| node_user_model
node_user_routes -->|"restores redirect"| node_auth_middleware
node_user_routes -->|"wraps handlers"| node_async_errors
node_user_routes -->|"renders forms"| node_account_pages
node_seed_runner -->|"loads samples"| node_seed_data
node_seed_runner -->|"creates listings"| node_listing_model
node_app -->|"configures templates"| node_views

click node_app "https://github.com/madeeha-tazeen/wanderlust-/blob/main/app.js"
click node_listing_routes "https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/listing.js"
click node_review_routes "https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/review.js"
click node_user_routes "https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/user.js"
click node_auth_middleware "https://github.com/madeeha-tazeen/wanderlust-/blob/main/middleware.js"
click node_listing_model "https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/listing.js"
click node_review_model "https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/review.js"
click node_user_model "https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/user.js"
click node_validation "https://github.com/madeeha-tazeen/wanderlust-/blob/main/schema.js"
click node_async_errors "https://github.com/madeeha-tazeen/wanderlust-/blob/main/utils/wrapAsync.js"
click node_error_type "https://github.com/madeeha-tazeen/wanderlust-/blob/main/utils/ExpressError.js"
click node_views "https://github.com/madeeha-tazeen/wanderlust-/tree/main/views"
click node_listing_pages "https://github.com/madeeha-tazeen/wanderlust-/tree/main/views/listings"
click node_account_pages "https://github.com/madeeha-tazeen/wanderlust-/tree/main/views/users"
click node_home_page "https://github.com/madeeha-tazeen/wanderlust-/blob/main/views/home.ejs"
click node_seed_data "https://github.com/madeeha-tazeen/wanderlust-/blob/main/init/data.js"
click node_seed_runner "https://github.com/madeeha-tazeen/wanderlust-/blob/main/init/index.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_validation,node_async_errors,node_error_type toneBlue
class node_listing_routes,node_review_routes,node_listing_model,node_review_model,node_mongodb,node_seed_data,node_seed_runner toneAmber
class node_user_routes,node_auth_middleware,node_user_model toneMint
class node_views,node_listing_pages,node_account_pages,node_home_page toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Express app](https://github.com/madeeha-tazeen/wanderlust-/blob/main/app.js): `app.js`
- [Request validation](https://github.com/madeeha-tazeen/wanderlust-/blob/main/schema.js): `schema.js`
- [Async wrapper](https://github.com/madeeha-tazeen/wanderlust-/blob/main/utils/wrapAsync.js): `utils/wrapAsync.js`
- [HTTP errors](https://github.com/madeeha-tazeen/wanderlust-/blob/main/utils/ExpressError.js): `utils/ExpressError.js`

### Marketplace domain

- [Listing routes](https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/listing.js): `routes/listing.js`
- [Review routes](https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/review.js): `routes/review.js`
- [Listing model](https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/listing.js): `models/listing.js`
- [Review model](https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/review.js): `models/review.js`
- **MongoDB**
- [Sample listings](https://github.com/madeeha-tazeen/wanderlust-/blob/main/init/data.js): `init/data.js`
- [Seed runner](https://github.com/madeeha-tazeen/wanderlust-/blob/main/init/index.js): `init/index.js`

### Identity

- [Account routes](https://github.com/madeeha-tazeen/wanderlust-/blob/main/routes/user.js): `routes/user.js`
- [Login middleware](https://github.com/madeeha-tazeen/wanderlust-/blob/main/middleware.js): `middleware.js`
- [User model](https://github.com/madeeha-tazeen/wanderlust-/blob/main/models/user.js): `models/user.js`

### User interface

- [EJS pages](https://github.com/madeeha-tazeen/wanderlust-/tree/main/views): `views`
- [Listing pages](https://github.com/madeeha-tazeen/wanderlust-/tree/main/views/listings): `views/listings`
- [Account pages](https://github.com/madeeha-tazeen/wanderlust-/tree/main/views/users): `views/users`
- [Home page](https://github.com/madeeha-tazeen/wanderlust-/blob/main/views/home.ejs): `views/home.ejs`

### Other components

- **Visitor**

## Connections

- Visitor → Express app: sends requests (evidence: `app.js`)
- Express app → Listing routes: mounts routes (evidence: `app.js`)
- Express app → Review routes: mounts routes (evidence: `app.js`)
- Express app → Account routes: mounts routes (evidence: `app.js`)
- Express app → Listing model: queries API (evidence: `app.js`)
- Express app → User model: configures auth (evidence: `app.js`)
- Express app → MongoDB: connects (evidence: `app.js`)
- Express app → Home page: renders (evidence: `app.js`)
- Listing routes → Listing model: reads and writes (evidence: `routes/listing.js`)
- Listing routes → Request validation: validates input (evidence: `routes/listing.js`)
- Listing routes → Login middleware: checks login (evidence: `routes/listing.js`)
- Listing routes → Async wrapper: wraps handlers (evidence: `routes/listing.js`)
- Listing routes → HTTP errors: raises errors (evidence: `routes/listing.js`)
- Listing routes → Listing pages: renders listing views (evidence: `routes/listing.js`)
- Listing model → Review model: deletes related reviews (evidence: `models/listing.js`)
- Review routes → Listing model: loads and updates (evidence: `routes/review.js`)
- Review routes → Review model: creates reviews (evidence: `routes/review.js`)
- Review routes → Request validation: validates input (evidence: `routes/review.js`)
- Review routes → Async wrapper: wraps handlers (evidence: `routes/review.js`)
- Review routes → HTTP errors: raises errors (evidence: `routes/review.js`)
- Account routes → User model: registers users (evidence: `routes/user.js`)
- Account routes → Login middleware: restores redirect (evidence: `routes/user.js`)
- Account routes → Async wrapper: wraps handlers (evidence: `routes/user.js`)
- Account routes → Account pages: renders forms (evidence: `routes/user.js`)
- Seed runner → Sample listings: loads samples (evidence: `init/index.js`)
- Seed runner → Listing model: creates listings (evidence: `init/index.js`)
- Express app → EJS pages: configures templates (evidence: `app.js`)
