# sonukumar1537/wanderlust architecture

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

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

## Overview

Wanderlust is an Express/MongoDB vacation-listing application. Visitors browse listings, open details, and submit reviews; listing routes validate and persist listing changes, while review routes attach or remove reviews. A separate user route handles account flows, with Passport-backed sessions configured in the application. The graph also shows the listing/review data relationship and rendered views. The README is empty, and unsampled route and view details are not inferred; classroom files appear to be a separate demo, not part of the main request flow.

Main entry points: [`app.js`](https://github.com/sonukumar1537/wanderlust/blob/main/app.js) (Express app), [`routes/listing.js`](https://github.com/sonukumar1537/wanderlust/blob/main/routes/listing.js) (Listing routes), [`routes/review.js`](https://github.com/sonukumar1537/wanderlust/blob/main/routes/review.js) (Review routes), [`models/listing.js`](https://github.com/sonukumar1537/wanderlust/blob/main/models/listing.js) (Listing 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_views["Listing and account views"]
end

subgraph group_domain["Marketplace domain"]
  node_listing_model["Listing model<br/>[listing.js]"]
  node_review_model["Review model<br/>[review.js]"]
  node_validation["Request validation<br/>[schema.js]"]
  node_database[("MongoDB")]
  node_seed_data["Sample listings<br/>[data.js]"]
end

subgraph group_identity["User identity"]
  node_user_routes["User routes<br/>[user.js]"]
  node_user_model["User model<br/>[user.js]"]
end

subgraph group_demo["Classroom demo"]
  node_classroom_server["Classroom server<br/>[server.js]"]
  node_classroom_users["Classroom user routes<br/>[user.js]"]
  node_classroom_posts["Classroom post routes<br/>[post.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"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 -->|"configures Passport"| node_user_model
node_app -->|"connects"| node_database
node_listing_routes -->|"validates listings"| node_validation
node_listing_routes -->|"queries and updates"| node_listing_model
node_review_routes -->|"validates reviews"| node_validation
node_review_routes -->|"loads listings"| node_listing_model
node_review_routes -->|"creates and deletes"| node_review_model
node_listing_routes -->|"renders pages"| node_views
node_listing_model -->|"deletes dependent reviews"| node_review_model
node_user_routes -->|"uses accounts"| node_user_model
node_classroom_server -.->|"imports"| node_classroom_users
node_classroom_server -.->|"imports"| node_classroom_posts

click node_app "https://github.com/sonukumar1537/wanderlust/blob/main/app.js"
click node_listing_routes "https://github.com/sonukumar1537/wanderlust/blob/main/routes/listing.js"
click node_review_routes "https://github.com/sonukumar1537/wanderlust/blob/main/routes/review.js"
click node_user_routes "https://github.com/sonukumar1537/wanderlust/blob/main/routes/user.js"
click node_views "https://github.com/sonukumar1537/wanderlust/tree/main/views"
click node_listing_model "https://github.com/sonukumar1537/wanderlust/blob/main/models/listing.js"
click node_review_model "https://github.com/sonukumar1537/wanderlust/blob/main/models/review.js"
click node_user_model "https://github.com/sonukumar1537/wanderlust/blob/main/models/user.js"
click node_validation "https://github.com/sonukumar1537/wanderlust/blob/main/schema.js"
click node_seed_data "https://github.com/sonukumar1537/wanderlust/blob/main/init/data.js"
click node_classroom_server "https://github.com/sonukumar1537/wanderlust/blob/main/classroom/server.js"
click node_classroom_users "https://github.com/sonukumar1537/wanderlust/blob/main/classroom/routes/user.js"
click node_classroom_posts "https://github.com/sonukumar1537/wanderlust/blob/main/classroom/routes/post.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_views toneBlue
class node_listing_model,node_review_model,node_validation,node_database,node_seed_data toneAmber
class node_user_routes,node_user_model toneMint
class node_classroom_server,node_classroom_users,node_classroom_posts toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Express app](https://github.com/sonukumar1537/wanderlust/blob/main/app.js): `app.js`
- [Listing routes](https://github.com/sonukumar1537/wanderlust/blob/main/routes/listing.js): `routes/listing.js`
- [Review routes](https://github.com/sonukumar1537/wanderlust/blob/main/routes/review.js): `routes/review.js`
- [Listing and account views](https://github.com/sonukumar1537/wanderlust/tree/main/views): `views`

### Marketplace domain

- [Listing model](https://github.com/sonukumar1537/wanderlust/blob/main/models/listing.js): `models/listing.js`
- [Review model](https://github.com/sonukumar1537/wanderlust/blob/main/models/review.js): `models/review.js`
- [Request validation](https://github.com/sonukumar1537/wanderlust/blob/main/schema.js): `schema.js`
- **MongoDB**
- [Sample listings](https://github.com/sonukumar1537/wanderlust/blob/main/init/data.js): `init/data.js`

### User identity

- [User routes](https://github.com/sonukumar1537/wanderlust/blob/main/routes/user.js): `routes/user.js`
- [User model](https://github.com/sonukumar1537/wanderlust/blob/main/models/user.js): `models/user.js`

### Classroom demo

- [Classroom server](https://github.com/sonukumar1537/wanderlust/blob/main/classroom/server.js): `classroom/server.js`
- [Classroom user routes](https://github.com/sonukumar1537/wanderlust/blob/main/classroom/routes/user.js): `classroom/routes/user.js`
- [Classroom post routes](https://github.com/sonukumar1537/wanderlust/blob/main/classroom/routes/post.js): `classroom/routes/post.js`

### Other components

- **Visitor**

## Connections

- Visitor → Express app: requests (evidence: `app.js`)
- Express app → Listing routes: mounts listings (evidence: `app.js`)
- Express app → Review routes: mounts reviews (evidence: `app.js`)
- Express app → User routes: mounts accounts (evidence: `app.js`)
- Express app → User model: configures Passport (evidence: `app.js`)
- Express app → MongoDB: connects (evidence: `app.js`)
- Listing routes → Request validation: validates listings (evidence: `routes/listing.js`)
- Listing routes → Listing model: queries and updates (evidence: `routes/listing.js`)
- Review routes → Request validation: validates reviews (evidence: `routes/review.js`)
- Review routes → Listing model: loads listings (evidence: `routes/review.js`)
- Review routes → Review model: creates and deletes (evidence: `routes/review.js`)
- Listing routes → Listing and account views: renders pages (evidence: `routes/listing.js`)
- Listing model → Review model: deletes dependent reviews (evidence: `models/listing.js`)
- User routes → User model: uses accounts (evidence: `routes/user.js`)
- Classroom server → Classroom user routes: imports (evidence: `classroom/server.js`)
- Classroom server → Classroom post routes: imports (evidence: `classroom/server.js`)
