How vaibhavsanmani/gobnb-stayfinder works
This is an Express/Mongoose listings marketplace with account authentication, listing creation and editing, image uploads, and listing reviews. The main workflow is a browser request entering the app’s mounted routes, passing route-level validation or login checks, reaching a controller, and reading or changing MongoDB-backed listing, review, or user records before returning a rendered response or redirect. The graph also shows the documented-by-code upload configuration and seed-data path. Some controllers and configuration were indexed but not excerpted, so their internal behavior is represented only where the source index supports a relationship.
Main entry points: app.js Express app · listing.js Listing routes · routes/review.js Review routes · controllers/review.js Review controller
Components 19
Web application
- Express app
app.js - Request schemas
schema.js - Async wrapper
utils/wrapAsync.js
Listings
- Listing routes
routes/listing.js - Listing controller
controllers/listings.js - Listing views
views/listings
Accounts and reviews
- Login middleware
middleware.js - Review routes
routes/review.js - Review controller
controllers/review.js - User routes
routes/user.js - User controller
controllers/usesr.js
Persistence and uploads
- Listing model
models/listing.js - Review model
models/review.js - User model
models/user.js - MongoDB
- Image storage config
cloudConfig.js - Seed listings
init/data.js - Seed runner
init/index.js
Other components
- Browser user
Connections 23
- Browser user → Express app: sends requests
- Express app → MongoDB: connects
app.js - Express app → Listing routes: mounts routes
app.js - Express app → Review routes: mounts routes
app.js - Express app → User routes: mounts routes
app.js - Express app → Listing views: configures views
app.js - Listing routes → Listing controller: dispatches
routes/listing.js - Listing routes → Request schemas: validates with
routes/listing.js - Listing routes → Login middleware: checks login
routes/listing.js - Listing routes → Image storage config: configures upload
routes/listing.js - Listing routes → Async wrapper: wraps handlers
routes/listing.js - Listing controller → Listing model: uses
controllers/listings.js - Review routes → Review controller: dispatches
routes/review.js - Review routes → Request schemas: validates with
routes/review.js - Review routes → Login middleware: checks login
routes/review.js - Review routes → Async wrapper: wraps handlers
routes/review.js - Review controller → Listing model: reads and updates
controllers/review.js - Review controller → Review model: creates and deletes
controllers/review.js - User routes → User controller: dispatches
routes/user.js - User routes → Login middleware: preserves redirect
routes/user.js - User controller → User model: uses
controllers/usesr.js - Seed runner → Seed listings: loads data
init/index.js - Seed runner → Listing model: creates records
init/index.js