A full-stack web application for discovering, sharing, and reviewing campgrounds around the world. Built with React and Node.js.
- Browse Campgrounds: Explore a collection of campgrounds with images, locations, and descriptions
- User Authentication: Secure registration and login system
- Create & Edit: Add new campgrounds or edit your own listings
- Reviews & Ratings: Leave reviews and rate campgrounds with a 5-star system
- Interactive Maps: View campground locations on an interactive map
- AI-Powered Guides: Get personalized activity suggestions for each location
- React 19
- React Router DOM
- Axios
- Vite
- MapTiler SDK
- Node.js & Express
- MongoDB & Mongoose
- Passport.js (Local Strategy)
- Cloudinary (Image Upload)
- Google Gemini AI
- Joi (Validation)
- Node.js (v14 or higher)
- MongoDB (running locally on port 27017)
- Cloudinary account (for image uploads)
- Google Gemini API key (optional, for AI guides)
-
Clone the repository
git clone <repository-url> cd Yelpcamp
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Environment Variables
Create a
.envfile in the root directory:CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret GEMINI_API_KEY=your_gemini_api_key
-
Start MongoDB
# Make sure MongoDB is running locally mongod -
Run the application
Terminal 1 - Backend:
cd backend node index.jsBackend runs on
http://localhost:3000Terminal 2 - Frontend:
cd frontend npm run devFrontend runs on
http://localhost:5173
Yelpcamp/
├── backend/
│ ├── models/ # Mongoose schemas
│ ├── routers/ # API routes
│ ├── middleware/ # Authentication & validation
│ ├── utils/ # Helper utilities
│ └── index.js # Server entry point
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ └── App.jsx # Main app component
│ └── package.json
└── README.md
- Register/Login: Create an account or sign in to access all features
- Browse: View all available campgrounds on the main page
- Explore: Click on any campground to see details, reviews, and location
- Contribute: Add your own campground or leave reviews
- Manage: Edit or delete campgrounds you've created
- Passport.js authentication with bcrypt password hashing
- Session-based authentication
- Middleware-protected routes
- Input validation with Joi schemas
- CORS configured for secure cross-origin requests
ISC