Skip to content

udaymittal7/natours

Repository files navigation


Natours
Natours

An awesome tour booking site built on top of NodeJS.

Deployed Version

Live demo (Feel free to visit) 👉 : https://natours-com.onrender.com/

Key Features

  • Authentication and Authorization
    • Login and logout
    • Using JWT
    • Using best security practices like rate-limiter, xss-clean, helmat for headers, hpp for preventing parameter pollution and mongo-sanitize.
  • Tour
    • Manage booking, check tours map, check users' reviews and rating
    • Admin can add new tours
  • User profile
    • Update username, photo, email, and password
    • See all your bought tours at the same place
  • Credit card Payment
    • Using stripe using webhooks to avoid adding tour without payment

How To Use

Book a tour

  • Login or Signup to the site
  • Search for tours that you want to book
  • Book a tour
  • Proceed to the payment checkout page
  • Enter the card details:
    - Card No. : 4242 4242 4242 4242
    - Expiry date: 02 / 22
    - CVV: 222
    
  • Finished!

API Documentation

Link(https://documenter.getpostman.com/view/14039764/TWDfDDa9)

API Usage

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.

API Features:

Tours List 👉 https://natours-com.onrender.com/api/v1/tours

Tours State 👉 https://natours-com.onrender.com/api/v1/tours/tour-stats

Get Top 5 Cheap Tours 👉https://natours-com.onrender.com/api/v1/tours/top-5-cheap

Get Tours Within Radius 👉https://natours-com.onrender.com/api/v1/tours/tours-within/200/center/34.098453,-118.096327/unit/mi

Deployment

The website is deployed with git into heroku. Below are the steps taken:

git init
git add -A
git commit -m "Commit message"
heroku login
heroku create
heroku config:set CONFIG_KEY=CONFIG_VALUE
parcel build ./public/js/index.js --out-dir ./public/js --out-file bundle.js
git push heroku master
heroku open

You can also changed your website url by running this command:

heroku apps:rename natours-users

Build With

To-do

  • Review and rating
    • Allow user to add a review directly at the website after they have taken a tour
  • Booking
    • Prevent duplicate bookings after user has booked that exact tour, implement favourite tours
  • Advanced authentication features
    • Confirm user email, two-factor authentication, using email functionality properly
  • And More ! There's always room for improvement!

Installation

You can fork the app or you can git-clone the app into your local machine. Once done that, please install all the dependencies by running

$ npm i
set your env variables
$ 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