Welcome to Natours, a web application that allows users to browse, book, and review tour sites. This project is built using Node.js, Express, and MongoDB for the backend, and Pug for the frontend. Natours follows the Model-View-Controller (MVC) architecture and includes user authentication with web tokens stored in cookies.
Before you can run the Natours project, ensure you have the following software installed:
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/natours.git
-
Navigate to the project directory:
cd natours
-
Install the project dependencies:
npm install
-
Create a .env file in the root directory based on the provided .env.example template. Replace the placeholder values with your own configuration.
-
Start the application:
npm start
-
The Natours app will be accessible at http://localhost:3000 in your web browser.
- User authentication with JWT (JSON Web Tokens) stored in cookies.
- Browse and search for tour sites.
- Book tours with user-specific details.
- Write and edit reviews for tours.
- View tour details, including pricing, duration, and user ratings.
- User account management (profile, password reset, etc.).
- Secure password hashing using bcrypt.
- Scalable and modular MVC architecture.
- Custom error handling and user-friendly error messages.
The Natours project follows a structured directory layout:
controllers/
: Contains the controller logic for different routes and features.models/
: Defines the data models used in the application.public/
: Contains static files (e.g., stylesheets, images).routes/
: Defines the application routes and their corresponding controllers.views/
: Contains Pug templates for rendering HTML views.utils/
: Includes utility functions and modules.
- Visit
http://localhost:3000
in your web browser. - Register for an account or log in if you already have one.
- Browse available tours, view tour details, and book a tour.
- Write reviews for tours you have booked.
- Update your user profile and password.
- Log out when you're done.
Contributions to the Natours project are welcome! If you have suggestions, enhancements, or bug fixes, please open an issue or create a pull request.
Thank you for using Natours! We hope you enjoy booking and reviewing tour sites on our platform. If you have any questions or encounter any issues, please don't hesitate to reach out to us. Happy touring! 🌍🌟