YelpCamp is a full-stack web application where users can create, view, and review campgrounds. This project is built with Node.js, Express, MongoDB, and EJS. It allows users to share their favorite camping spots and experiences with others.
-
Frontend:
- EJS (Embedded JavaScript templating)
- Bootstrap 5
- Mapbox GL JS for interactive maps
-
Backend:
- Node.js
- Express.js
-
Database:
- MongoDB with Mongoose ODM
-
Authentication:
- Passport.js (with local strategy for username/password)
-
Image Storage:
- Cloudinary for cloud-based image hosting
-
Middleware & Other Libraries:
express-sessionfor session managementconnect-flashfor flash messagesmethod-overrideto use HTTP verbs such as PUT or DELETEJoifor server-side data validationhelmetfor securing HTTP headersexpress-mongo-sanitizeto prevent MongoDB query injectionmulterandmulter-storage-cloudinaryfor file uploads
-
User Authentication:
- Users can register, login, and logout.
- Authentication middleware protects routes from unauthorized access.
- User sessions are persisted using
express-sessionandconnect-mongo.
-
Campground Management (CRUD):
- Authenticated users can create new campgrounds with a name, price, description, location, and images.
- All users can view a list of all campgrounds.
- All users can view detailed information for a single campground.
- Campground authors can edit their own campgrounds.
- Campground authors can delete their own campgrounds.
-
Reviews and Ratings:
- Authenticated users can add text reviews and star ratings to campgrounds.
- Review authors can delete their own reviews.
-
Image Uploads:
- Users can upload multiple images for a campground.
- Images are uploaded to and served from Cloudinary.
-
Interactive Maps:
- Campground locations are displayed on an interactive Mapbox map on the show page.
- A cluster map on the index page shows the locations of all campgrounds, with markers clustering at higher zoom levels.
-
Authorization:
- Users must be logged in to create campgrounds and leave reviews.
- Users can only edit or delete campgrounds and reviews that they have authored.
-
Flash Messages:
- Users receive feedback for actions (e.g., successful login, error messages) via flash messages.
- User Profiles: Implement user profiles where users can see all the campgrounds they have created and the reviews they have written.
- Search and Filter: Add a search bar to find campgrounds by name or location, and add filtering options (e.g., by price, rating).
- Pagination: Implement pagination on the campgrounds index page to improve performance with a large number of campgrounds.
- Password Reset: Add a "forgot password" feature to allow users to reset their passwords via email.
- Admin Panel: Create an admin role and a dashboard for managing users, campgrounds, and reviews.
- Social Logins: Allow users to register and log in using third-party providers like Google, Facebook, or GitHub.
- AJAX/Single-Page Feel: Use AJAX to submit reviews and perform other actions without a full page reload for a smoother user experience.