How kvreddy9120/3-tier-full-stack-yelp-camp works
Yelp Camp is an Express web application for browsing, creating, editing, and reviewing campgrounds, with user accounts, image uploads, and location maps. The main request flow runs from a visitor through the app’s mounted routes and authorization/validation middleware to controllers, which read or update MongoDB-backed models and render pages or redirect. Campground images use Cloudinary; Mapbox powers the documented map capability. The excerpts support the main route, controller, and model relationships; map-to-page wiring is not shown, so it is left unclaimed.
Main entry points: app.js Express app · middleware.js Access and validation · campground.js Campground model · campgrounds.js Campground operations
Components 22
Web entry and pages
- Express app
app.js - Campground routes
routes/campgrounds.js - Review routes
routes/reviews.js - Campground pages
views/campgrounds - Home page
views/home.ejs
Campground and reviews
- Campground operations
controllers/campgrounds.js - Review operations
controllers/reviews.js - Campground model
models/campground.js - Review model
models/review.js - Input schemas
schemas.js
Accounts and access
- User routes
routes/users.js - Account pages
views/users - Access and validation
middleware.js - Account operations
controllers/users.js - User model
models/user.js
Persistence and integrations
- MongoDB
- Image storage adapter
cloudinary/index.js - Cloudinary
Browser maps
- Cluster map
public/javascripts/clusterMap.js - Campground map
public/javascripts/showPageMap.js - Mapbox
Other components
- Visitor
Connections 28
- Visitor → Express app: requests pages
app.js - Express app → Campground routes: mounts routes
app.js - Express app → Review routes: mounts routes
app.js - Express app → User routes: mounts routes
app.js - Express app → MongoDB: connects to
app.js - Campground routes → Access and validation: checks access
routes/campgrounds.js - Review routes → Access and validation: checks access
routes/reviews.js - Campground routes → Campground operations: dispatches to
routes/campgrounds.js - Review routes → Review operations: dispatches to
routes/reviews.js - User routes → Account operations: dispatches to
routes/users.js - Access and validation → Input schemas: validates input
middleware.js - Access and validation → Campground model: loads campground
middleware.js - Access and validation → Review model: loads review
middleware.js - Campground operations → Campground model: reads and writes
controllers/campgrounds.js - Campground operations → Campground pages: renders pages
controllers/campgrounds.js - Campground operations → Image storage adapter: manages images
controllers/campgrounds.js - Review operations → Campground model: updates campground
controllers/reviews.js - Review operations → Review model: saves review
controllers/reviews.js - Account operations → User model: manages accounts
controllers/users.js - Account operations → Account pages: renders pages
controllers/users.js - Express app → Home page: renders home
app.js - Campground model → Review model: deletes related reviews
models/campground.js - Campground model → Image storage adapter: deletes stored images
models/campground.js - Image storage adapter → Cloudinary: uploads and deletes
cloudinary/index.js - Express app → Cluster map: serves static assets
app.js - Express app → Campground map: serves static assets
app.js - Cluster map → Mapbox: uses maps
- Campground map → Mapbox: uses maps