How pavan9464/wanderlust works
Wanderlust is a server-rendered travel-listing app. Visitors browse or search listings, then view listing details, reviews, and a map; registered users can create listings and reviews, while ownership and authorship checks protect edits and deletions. Listing writes validate input, upload images, and geocode locations; MongoDB holds listings, reviews, users, and sessions. The graph also shows authentication, shared error handling, and the documented sample-data seeding capability. Some view and seed relationships are based on README descriptions rather than sampled implementation excerpts.
Main entry points: app.js Express application · listingController.js Listing handlers · reviewController.js Review handlers · Listing.js Listing model
Components 25
Web application
- Express application
app.js - Error page
views/error.ejs - Search behavior
public/js/script.js - Map display
public/js/map.js
Listings
- Listing routes
routes/listings.js - Listing handlers
controllers/listingController.js - Listing model
models/Listing.js - Listing pages
views/listings
Reviews
- Review routes
routes/review.js - Review handlers
controllers/reviewController.js - Review model
models/review.js - Review views
views/listings/show.ejs
Identity and access
- User routes
routes/user.js - User handlers
controllers/userController.js - User model
models/user.js - Access and validation
middelware.js - Input schemas
schema.js
Storage and integrations
- MongoDB
- Image upload config
cloudConfig.js - Cloudinary
- Mapbox geocoding
- Mapbox GL JS
Sample data
- Seed script
init/index.js - Sample listings
init/data.js
Other components
- Visitor
Connections 31
- Visitor → Express application: sends requests
README.md - Express application → Listing routes: mounts routes
app.js - Express application → Review routes: mounts routes
app.js - Express application → User routes: mounts routes
app.js - Listing routes → Listing handlers: dispatches to
routes/listings.js - Listing routes → Access and validation: checks access
routes/listings.js - Access and validation → Input schemas: validates with
middelware.js - Listing handlers → Listing model: reads and writes
controllers/listingController.js - Listing handlers → Listing pages: renders
controllers/listingController.js - Listing handlers → Image upload config: uses uploads
controllers/listingController.js - Image upload config → Cloudinary: stores images
- Listing handlers → Mapbox geocoding: forward geocodes
controllers/listingController.js - Listing pages → Map display: provides map page
- Map display → Mapbox GL JS: renders map
- Review routes → Review handlers: dispatches to
routes/review.js - Review routes → Access and validation: checks access
routes/review.js - Review handlers → Listing model: loads listing
controllers/reviewController.js - Review handlers → Review model: creates and deletes
controllers/reviewController.js - Review handlers → Review views: redirects to
controllers/reviewController.js - User routes → User handlers: dispatches to
routes/user.js - User routes → Access and validation: uses access checks
routes/user.js - User handlers → User model: registers users
controllers/userController.js - Express application → User model: configures authentication
app.js - Express application → Error page: renders errors
app.js - Search behavior → Listing pages: clears search
- Listing model → MongoDB: persists listings
- Review model → MongoDB: persists reviews
- User model → MongoDB: persists users
- Seed script → Sample listings: loads sample data
README.md - Seed script → Listing model: inserts listings
README.md - Seed script → Mapbox geocoding: geocodes samples
README.md