How igoswamik/yelpcamp works
Project type and purpose
• YelpCamp is a full‑stack, monolithic web application built with Node.js, Express.js, MongoDB, and EJS templates. It implements MVC and RESTful patterns, allowing users to sign up, create campgrounds, and post reviews. Images are stored on Cloudinary; the app is deployed on Heroku/AWS.
File structure
• Top level:
• app.js – entry point / Express server setup
• controllers/ – request handlers (campgrounds, reviews, users)
• routes/ – route definitions, mapping URLs to controllers
• models/ – Mongoose schemas for Campground, Review, User
• views/ – EJS templates (layouts, partials, pages)
• public/ – static assets (CSS, client‑side JS for maps & form validation)
• middleware.js – custom Express middleware (auth checks, error handling)
• utils/ – helper classes (ExpressError, catchAsync)
• cloudinary/ – Cloudinary configuration for image uploads
• seeds/ – seed scripts for populating the database
• schemas.js – JOI schemas for request validation
Insights from README
• Auth flow via Passport.js
• Data persistence in MongoDB hosted on AWS (EC2 or Atlas)
• Deployment on Heroku
• RESTful CRUD operations for campgrounds & reviews
Diagramming recommendations
• Components: use rectangles:
• Browser (client)
• Web Server (Express) – subdivided into middleware, routers, controllers, models
• MongoDB
• Cloudinary
• Deployment (Heroku Load Balancer)
• Frontend (blue)
• Backend (green)
• Database (orange)
• External Services (gray)