An Awesome Tour Booking Site Built On Top Of NodeJS.
Demo • Key Features • Demonstration • How To Use • API Usage • Built With • Installation • Future Updates • Acknowledgement
Live demo of Natours (Feel free to visit) 👉🏻 : https://natours-7lr2.onrender.com/
- Authentication and Authorization 🚀
- Sign up, Log in, Logout, Update, and reset password.
- Google OAuth (new) for seamless single sign-on, enabling users to log in with their Google accounts.
- User Profile 🧑💼
- Update username, photo, email, password, and other information.
- Users categorized as regular, admin, lead guide, or guide.
- Tour Management 🗺️
- Manage booking, check tour map, reviews, and ratings.
- Tours created, updated, and deleted by admins or lead guides.
- Bookings 📅
- Only regular users can book tours (make a payment).
- Prevent duplicate bookings for regular users.
- Admins or lead guides can manage all bookings.
- Reviews 🌟
- Only regular users can write reviews for booked tours.
- Admins can delete any review.
- Favorite Tours ❤️
- Regular users can add/remove tours to/from their favorites.
- Credit Card Payment 💳
Before using the API, you need to set the variables in Postman depending on your environment (development or production). Simply add:
- {{URL}} with your hostname as value (Eg. http://127.0.0.1:3000 or http://www.example.com)
- {{password}} with your user password as value.
For more info check API Documentation on Postman 👉🏻 Natours API Documentation.
API Features:
Tours List 👉🏻 https://natours-tvyz.onrender.com/api/v1/tours
Tours State 👉🏻 https://natours-tvyz.onrender.com/api/v1/tours/tour-stats
Get Top 5 Cheap Tours 👉🏻 https://natours-tvyz.onrender.com/api/v1/tours/top-5-cheap
Get Tours Within Radius 👉🏻 https://natours-tvyz.onrender.com/api/v1/tours/tours_within/200/center/34.111745,%20-118.113491/unit/mi
- Login to the site.
- Search for tours.
- Book a tour.
- Proceed to the payment checkout page.
- Enter the card details (Test Mode):
- Card No.: 4242 4242 4242 4242
- Expiry date: 02 / 25
- CVV: 375
- Finished!
- Check booked tours on the "Manage Booking" page in user settings.
- Update username, profile photo, email, and password.
Follow these steps to set up your local environment for the Natours app:
-
Clone the Repository: Clone this repository to your local machine:
git clone https://github.com/AhmedSalman1/Natours.git cd natours
-
Install Dependencies: Run the following command to install all the required dependencies:
npm install
-
Configure Environment Variables:
Before you can run the Natours app, you need to set up your environment variables. These variables store sensitive information required for the app to function properly. Follow these steps to configure your environment variables:
-
Create a
.env
File: In the root directory of the app, create a file named.env
. -
Add the Following Environment Variables: Replace the placeholders with your actual information. You might need to sign up for accounts and services to obtain the required credentials.
# MongoDB Configuration DATABASE=your-mongodb-database-url USERNAME=your-mongodb-username DATABASE_PASSWORD=your-mongodb-password # JSON Web Token Configuration SECRET=your-json-web-token-secret JWT_EXPIRES_IN=90d JWT_COOKIE_EXPIRES_IN=90 # Stripe Configuration STRIPE_SECRET_KEY=your-stripe-secret-key STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret
-
You can get the Natours app up and running on your local machine using the following steps:
-
Fork or Git-clone:
- You can fork the app on GitHub or git-clone it into your local machine.
-
Install Dependencies and Set Environment Variables:
$ npm i Set your env variables
-
Build and Run Commands:
$ npm run watch:js $ npm run build:js $ npm run dev (for development) $ npm run start:prod (for production) $ npm run debug (for debug) $ npm start
-
Setting up ESLint and Prettier in VS Code 👇🏻:
$ npm i eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-node eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react --save-dev
- NodeJS - JS runtime environment
- Express - The web framework used
- Mongoose - Object Data Modelling (ODM) library
- MongoDB Atlas - Cloud database service
- Pug - High performance template engine
- JSON Web Token - Security token
- ParcelJS - Blazing fast, zero configuration web application bundler
- Stripe - Online payment API and Making payments on the app.
- Postman - API testing
- Brevo - Email delivery platform
- Render - Cloud platform
- Leaflet - Displaying the different locations of each tour.
- Featured Tours
- Recently Viewed Tours
- And More! There's always room for improvement!
- This project is part of the online course I've taken at Udemy. Thanks to Jonas Schmedtmann for creating this awesome course! Link to the course: Node.js, Express, MongoDB & More: The Complete Bootcamp 2019