A Full-Stack Campground Discovery & Sharing Platform
Discover, share, and review the best campgrounds around the world. Join a thriving community of outdoor enthusiasts!
Live Demo β’ Report Bug β’ Request Feature
- About The Project
- Features
- Tech Stack
- Getting Started
- Usage
- Project Structure
- Security Features
- API Routes
- Screenshots
- Contributing
- License
- Contact
- Acknowledgments
YelpCamp is a comprehensive web application that allows users to discover, share, and review campgrounds from around the world. Built with modern web technologies, it provides a seamless experience for camping enthusiasts to find their next adventure.
Note: Any statistics or counts (such as the number of campgrounds) in the UI are currently hardcoded for illustrative purposes.
- πΊοΈ Interactive Maps: Visualize campground locations with integrated MapTiler mapping
- βοΈ User Reviews: Read and write authentic reviews from fellow campers
- πΈ Photo Sharing: Upload and share beautiful campground photos
- π Secure Authentication: Safe and secure user authentication system
- π± Responsive Design: Works flawlessly on desktop, tablet, and mobile devices
- β Rating System: 5-star rating system for honest campground reviews
- ποΈ Browse Campgrounds: Explore a collection of campgrounds added by the community
- π Add Campgrounds: Share your favorite camping spots with the community
- β Review System: Leave ratings and reviews for campgrounds
- πΊοΈ Interactive Maps: View campground locations on an interactive map
- π Search & Filter: Find campgrounds by location and amenities
- π€ User Profiles: Create and manage your camping profile
- β Secure registration and login system
- π Password encryption with Passport.js
- π₯ Session management
- π‘οΈ Authorization for edit/delete actions
- π· Multi-image upload with Cloudinary integration
- π¬ Flash messages for user feedback
- π¨ Modern, responsive UI with Bootstrap 5
- π Input validation and sanitization
- π« MongoDB injection prevention
- π‘οΈ Helmet.js security headers
- π Geocoding for campground locations
- Node.js - Runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Passport.js - Authentication middleware
- Express Session - Session management
- Connect Flash - Flash messages
- EJS - Embedded JavaScript templating
- Bootstrap 5 - CSS framework
- Bootstrap Icons - Icon library
- Custom CSS - Modern, responsive styling
- Cloudinary - Image hosting and management
- MapTiler - Interactive maps and geocoding
- MongoDB Atlas - Cloud database hosting
- Helmet.js - Security headers
- Joi - Schema validation
- Express Mongo Sanitize - MongoDB injection prevention
- Sanitize HTML - XSS protection
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local or Atlas account)
-
Clone the repository
git clone https://github.com/yourusername/YelpCamp.git cd YelpCamp -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:# Database MONGO_URI=your_mongodb_connection_string # Cloudinary CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_KEY=your_cloudinary_key CLOUDINARY_SECRET=your_cloudinary_secret # MapTiler MAPTILER_API_KEY=your_maptiler_api_key
-
Seed the database (optional)
node seeds/index.js
-
Start the development server
npm start
-
Open your browser
Navigate to
http://localhost:8080
Create a .env file with the following variables:
| Variable | Description | Required |
|---|---|---|
MONGO_URI |
MongoDB connection string | Yes |
CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name | Yes |
CLOUDINARY_KEY |
Cloudinary API key | Yes |
CLOUDINARY_SECRET |
Cloudinary API secret | Yes |
MAPTILER_API_KEY |
MapTiler API key | Yes |
- Register/Login: Create an account or login to access full features
- Browse Campgrounds: Explore campgrounds on the homepage
- View Details: Click on any campground to see detailed information
- Add Review: Leave a rating and review for campgrounds you've visited
- Create Campground: Share your own campground discoveries
- Edit/Delete: Manage your own campground listings
# Development mode
npm run dev
# Production mode
npm start
# Seed database
node seeds/index.jsYelpCamp/
βββ controllers/ # Route controllers
β βββ campgrounds.js
β βββ reviews.js
β βββ users.js
βββ models/ # Mongoose models
β βββ campground.js
β βββ review.js
β βββ user.js
βββ public/ # Static assets
β βββ javascripts/
β βββ stylesheets/
βββ routes/ # Express routes
β βββ campgrounds.js
β βββ reviews.js
β βββ users.js
βββ seeds/ # Database seeding
β βββ cities.js
β βββ index.js
βββ utils/ # Utility functions
β βββ catchAsync.js
β βββ ExpressError.js
βββ views/ # EJS templates
β βββ campgrounds/
β βββ layouts/
β βββ partials/
β βββ users/
βββ middleware.js # Custom middleware
βββ schemas.js # Joi validation schemas
βββ app.js # Express app setup
βββ package.json
YelpCamp implements multiple security layers:
- Authentication: Passport.js with local strategy
- Authorization: User-specific permissions for CRUD operations
- Password Security: Encrypted password storage
- Session Security: Secure session configuration with MongoDB store
- Input Validation: Joi schema validation on all inputs
- XSS Protection: HTML sanitization with sanitize-html
- MongoDB Injection Prevention: Express-mongo-sanitize
- Security Headers: Helmet.js CSP configuration
- CSRF Protection: Built-in Express protections
GET /campgrounds - View all campgrounds
GET /campgrounds/new - Form to create new campground
POST /campgrounds - Create new campground
GET /campgrounds/:id - View single campground
GET /campgrounds/:id/edit - Form to edit campground
PUT /campgrounds/:id - Update campground
DELETE /campgrounds/:id - Delete campground
POST /campgrounds/:id/reviews - Create review
DELETE /campgrounds/:id/reviews/:reviewId - Delete review
GET /register - Registration form
POST /register - Create new user
GET /login - Login form
POST /login - Authenticate user
GET /logout - Logout user
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Write clean, documented code
- Follow the existing code style
- Test your changes thoroughly
- Update documentation as needed
Distributed under the MIT License. See LICENSE for more information.
Abhinav Rajput - LinkedIn
Project Link: https://github.com/abhinavxdd/YelpCamp
This project was built as part of learning full-stack web development. Special thanks to:
- Bootstrap - Frontend framework
- MapTiler - Interactive maps
- Cloudinary - Image hosting
- MongoDB Atlas - Database hosting
- Font Awesome - Icons
- All the amazing open-source contributors
Made with β₯ for campers
Β© 2025 YelpCamp. All rights reserved.