Natours is a full-stack web application built using Node.js that includes both a RESTful API (backend) and a server-side rendered website (frontend). This project aims to provide an online platform for booking and exploring exciting nature tours around the world.
Natours allows users to browse and book various nature tours, each carefully curated to provide a unique and memorable experience. The backend provides a robust RESTful API that communicates with the frontend to handle user requests and manage tour bookings.
The frontend of Natours is built using server-side rendering, providing better SEO performance and a more efficient user experience. The combination of the API and the frontend website creates a seamless and intuitive platform for users to explore and book their dream nature tours.
- Browse through a list of nature tours from different locations.
- Get top tours,
- Get tours within your distance,
- Get tours monthly plan,
- Get all tours statistics
- View detailed information about each tour, including itinerary (map), difficulty level, duration, guides, and price.
- User authentication and authorization for booking tours and leaving reviews.
- Features: signup, login, password reset (via Email)
- Roles: user, guide, lead-guide, admin
- Secure payment processing for tour bookings.
- User dashboard to manage tours, bookings and account details.
- Administrator dashboard to manage tours, users, and bookings.
The Natours project utilizes the following technologies:
- Node.js: Backend environment for running JavaScript on the server.
- Express.js: Web application framework for building the API and handling routes.
- MongoDB: NoSQL database for storing tour, user, review and booking data.
- Mongoose: MongoDB object modeling for Node.js.
- JWT: JSON Web Tokens for user authentication and authorization.
- Bcrypt: Library for hashing and salting passwords.
- Express Mongoose Sanitize: Sanitizes user-supplied data to prevent MongoDB Operator Injection.
- Express Rate Limit: Basic rate-limiting middleware for Express - used to limit repeated requests to the API.
- Helmet: Helps secure Express apps by setting HTTP response headers.
- HPP: Express middleware to protect against HTTP Parameter Pollution attacks.
- XSS Filters: Library for output filtering, prevents XSS.
- Pug: Template engine for server-side rendering the frontend.
- Leaflet: Mapping API for displaying tour locations.
- Stripe: Payment processing platform for secure payments.
- Nodemailer: Used for sending emails.
- Multer: Middleware for handling
multipart/form-data
, which is primarily used for uploading files. - Compression: Compresses response bodies for all requests.
- Sharp: High speed Node.js module used for image manipulation.
- Morgan: HTTP request logger middleware for Node.js
To set up the Natours project locally, follow these steps:
- Clone the repository
git clone https://github.com/tttomasicc/natours.git
- Navigate to the project directory
cd software/
- Install the dependencies
npm install
To start the development server, configure necessary environment variables and run
- MongoDB using Docker (Compose)
docker-compose up
- Node.js Web app
npm run start:dev
Visit http://localhost:3000
in your Web browser to access the Natours website.
For detailed information about the API endpoints and how to interact with them, refer to the API documentation file.
Web examples can be found in the Documentation
The Natours project is licensed under the GNU General Public License v2.0. You are free to use, modify, and distribute this code as per the terms of the license.