A full-stack tour booking platform built with modern web technologies, allowing users to discover and book adventurous tours at the best prices.
- Tour Discovery: Browse through various adventure tours with detailed information
- Interactive Maps: View tour locations with integrated mapping functionality
- User Reviews: Read and write reviews for tours with star ratings
- User Authentication: Secure login/logout and user account management
- Booking System: Book tours with integrated payment processing
- Responsive Design: Optimized for all devices
- Tour Management: Create, update, and delete tour listings
- User Management: Manage user accounts and permissions
- Review Management: Moderate user reviews
- Booking Management: Track and manage tour bookings
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - MongoDB object modeling
- Pug - Template engine
- CSS3 - Styling with custom design
- JavaScript - Client-side functionality
- Helmet - Security headers
- Express Rate Limit - Rate limiting
- Express Mongo Sanitize - NoSQL injection prevention
- XSS Clean - Cross-site scripting protection
- HPP - HTTP Parameter Pollution protection
- Stripe - Payment processing
- MapLibre GL - Interactive maps
- Email Templates - Welcome emails and notifications
natours/
βββ controllers/ # Route controllers
βββ models/ # Database models
βββ routes/ # API routes
βββ views/ # Pug templates
βββ public/ # Static files (CSS, images, HTML)
βββ utilities/ # Utility functions
βββ dev-data/ # Development data and templates
βββ app.js # Express app configuration
βββ server.js # Server startup
βββ config.env # Environment variables
- Node.js (v14 or higher)
- MongoDB (local or Atlas)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/natours.git cd natours -
Install dependencies
npm install
-
Set up environment variables Create a
config.envfile in the root directory:NODE_ENV=development PORT=3000 DB_LOCAL=mongodb://localhost:27017/natours DB_REMOTE=mongodb+srv://<username>:<password>@cluster.mongodb.net/natours DB_PASSWORD=your_password JWT_SECRET=your-super-secret-jwt-string JWT_EXPIRES_IN=90d EMAIL_FROM=noreply@natours.io STRIPE_SECRET_KEY=your_stripe_secret_key
-
Import sample data (optional)
node dev-data/data/import-dev-data.js --import
-
Start the development server
npm start
-
Visit the application Open your browser and go to
http://localhost:3000
GET /api/v1/tours- Get all toursGET /api/v1/tours/:id- Get a specific tourPOST /api/v1/tours- Create a new tourPATCH /api/v1/tours/:id- Update a tourDELETE /api/v1/tours/:id- Delete a tour
GET /api/v1/users- Get all usersPOST /api/v1/users/signup- User registrationPOST /api/v1/users/login- User loginGET /api/v1/users/me- Get current user profile
GET /api/v1/reviews- Get all reviewsPOST /api/v1/tours/:tourId/reviews- Create a review for a tourGET /api/v1/reviews/:id- Get a specific review
GET /api/v1/bookings- Get all bookingsPOST /api/v1/bookings- Create a new booking
- Basic information (name, duration, difficulty, price)
- Location data with coordinates
- Images and description
- Tour guides and group size limits
- Ratings and reviews
- Authentication details
- Personal information
- User roles (user, guide, lead-guide, admin)
- Password management
- Review text and rating (1-5 stars)
- User and tour references
- Creation timestamp
- User and tour references
- Payment information
- Booking status
- Set
NODE_ENV=productionin your production environment - Configure your production database
- Set up environment variables on your hosting platform
- Rate limiting (100 requests per hour in production)
- Data sanitization against NoSQL injection attacks
- XSS protection
- Parameter pollution prevention
- Security headers with Helmet
- Fork the repository
- Create a 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
This project is part of "Node.js, Express, MongoDB & More: The Complete Bootcamp" by Jonas Schmedtmann.
- Jonas Schmedtmann - Course instructor and original project creator
- Unsplash - Tour images
- MapLibre - Mapping functionality
- Stripe - Payment processing
If you encounter any issues or have questions, please create an issue in the repository.