Natours is a modern application built using Node.js, Express, MongoDB, and Mongoose. It is designed to provide a platform for managing and organizing tours and related services. A lecture from Udemy by Jonas Schmedtmann. Node.js, Express, MongoDB & More: The Complete Bootcamp
Made the project more responsive and added som pages to it.
Natours/
│
├── controllers/
├── models/
├── public/
├── routes/
├── utils/
├── views/
│
├── app.js
├── server.js
├── package.json
├── package-lock.json
└── README.md
- Node.js (version 16 or higher)
- MongoDB
-
Clone the repository:
git clone https://github.com/mikae/Natours.git -
Navigate to the project directory:
cd Natours -
Install dependencies:
npm install -
Set up environment variables: Create a
.envfile in the root directory and add your MongoDB connection string and other required variables.
To run the application in development mode:
npm run dev
To start the server:
npm start
API documentation is available at /api-docs when the server is running.
- Express.js: Web application framework
- MongoDB: Database
- Mongoose: MongoDB object modeling tool
- Pug: Template engine
- JSON Web Tokens (JWT): Authentication
- Bcrypt: Password hashing
- Nodemailer: Email functionality
- Multer: File uploading
- Sharp: Image processing
- Stripe: Payment processing
- Swagger: API documentation
- CORS (Cross-Origin Resource Sharing)
- Rate limiting
- Data sanitization against NoSQL query injection
- XSS protection
- HTTP security headers with Helmet
Mikael Engvall
This project is licensed under the ISC License!
-
User Authentication and Authorization
- Sign up, log in, and log out functionality
- Password reset via email
- Role-based access control (admin, guide, user)
-
Tour Management
- Create, read, update, and delete tours
- Advanced filtering, sorting, and pagination of tours
- Tour statistics and analytics
-
Booking System
- Users can book tours
- Secure payment processing with Stripe integration
- Booking management for users and admins
-
User Profile
- Update user information
- Change password
- Upload and manage profile picture
-
Review System
- Users can leave reviews for tours they've taken
- Calculate and display average ratings for tours
-
Interactive Maps
- Display tour locations on interactive maps
- Show tour routes and stops
-
Email Notifications
- Welcome emails for new users
- Password reset emails
- Booking confirmation emails
-
Image Processing
- Resize and optimize tour and user images
- Store multiple sizes of images for responsive design
-
Performance Optimization
- Implement caching strategies
- Database indexing for faster queries
-
API Features
- RESTful API design
- Advanced filtering, sorting, and pagination
- Field limiting and aliasing
-
Error Handling
- Global error handling middleware
- Detailed error messages in development mode
- Simplified error messages in production mode
-
Data Modeling
- Implement data validation and sanitization
- Use of Mongoose middleware for data processing
-
Server-Side Rendering
- Use Pug templates for server-side rendering of pages
- Implement a responsive design for various screen sizes
-
Security Measures
- Implement rate limiting to prevent brute-force attacks
- Use security headers to protect against common vulnerabilities
- Sanitize user input to prevent XSS attacks
-
Geospatial Queries
- Find tours within radius
- Calculate distances from user locations
This application provides a comprehensive solution for tour management, from user authentication to booking processing, with a focus on security, performance, and user experience.





