How niyatigupta-hub/stayscape works
StayScape is an accommodation-listing web app. Visitors browse listings and details; signed-in users can create or manage listings and add or delete reviews, with ownership and authorship checks. Express routes dispatch to controllers, which use Mongoose models and render EJS pages. The README also documents client-side category/price filtering and an interactive map. Those client features are represented from documentation; their implementation details were not excerpted.
Main entry points: app.js Express app · listing.js Listing routes · review.js Review routes · user.js User routes
Components 22
Web runtime
- Express app
app.js - Listing routes
routes/listing.js - Review routes
routes/review.js - User routes
routes/user.js - Auth and validation
utils/middleware.js - Async wrapper
utils/wrapAsync.js - Request schemas
schema.js
Listing experience
- Listing operations
controllers/listing.js - Listing pages
views/listings
Accounts and reviews
- Review operations
controllers/review.js - Account operations
controllers/user.js - Login and signup
views/users
Persistence and uploads
- Listing model
models/listing.js - Review model
models/review.js - User model
models/user.js - Upload storage config
cloudConfig.js - Seed listings
init/data.js
Client discovery
- Discovery interactions
public/js/script.js
Other components
- Visitor
- MongoDB
- Cloudinary
- Map and geocoding
Connections 31
- Visitor → Express app: requests pages
README.md - Express app → Listing routes: mounts routes
app.js - Express app → Review routes: mounts routes
app.js - Express app → User routes: mounts routes
app.js - Listing routes → Listing operations: dispatches to
routes/listing.js - Review routes → Review operations: dispatches to
routes/review.js - User routes → Account operations: dispatches to
routes/user.js - Listing routes → Auth and validation: checks access
routes/listing.js - Review routes → Auth and validation: checks access
routes/review.js - User routes → Auth and validation: restores redirect
routes/user.js - Listing routes → Async wrapper: wraps handlers
routes/listing.js - Review routes → Async wrapper: wraps handlers
routes/review.js - User routes → Async wrapper: wraps handlers
routes/user.js - Auth and validation → Request schemas: validates requests
utils/middleware.js - Listing operations → Listing model: queries listings
controllers/listing.js - Listing operations → Listing pages: renders pages
controllers/listing.js - Review operations → Listing model: updates listing
controllers/review.js - Review operations → Review model: saves reviews
controllers/review.js - Account operations → User model: uses accounts
controllers/user.js - Account operations → Login and signup: serves auth forms
README.md - Listing model → Review model: cascade deletes
models/listing.js - Express app → User model: configures Passport
app.js - Listing routes → Upload storage config: configures uploads
routes/listing.js - Upload storage config → Cloudinary: stores images
README.md - Listing model → MongoDB: persists listings
models/listing.js - Review model → MongoDB: persists reviews
models/review.js - User model → MongoDB: persists accounts
models/user.js - Express app → MongoDB: connects session and data store
app.js - Listing pages → Discovery interactions: supports filtering
README.md - Discovery interactions → Map and geocoding: renders map
README.md - Visitor → Discovery interactions: filters listings
README.md