Giter Club home page Giter Club logo

natours's Introduction


Natours
Natours

An Awesome Tour Booking Site Built On Top Of NodeJS.

DemoKey FeaturesDemonstrationHow To UseAPI UsageBuilt WithInstallationFuture UpdatesAcknowledgement


Deployed Version

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

a free deployed server, could take a few moments for first-time rendering.

Key Features

  • Authentication and Authorization 🚀
    • Sign up, Log in, Logout, Update, and reset password.
  • 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 💳

Demonstration

Home Page :

Tour :

Admin Profile :

User Profile :

Payment Process :

Forget Password :

Reset Password :


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.

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


How To Use

Book a Tour 🌐

  1. Login to the site.
  2. Search for tours.
  3. Book a tour.
  4. Proceed to the payment checkout page.
  5. Enter the card details (Test Mode):
    • Card No.: 4242 4242 4242 4242
    • Expiry date: 02 / 25
    • CVV: 375
  6. Finished!

Manage Bookings 📅

  • Check booked tours on the "Manage Booking" page in user settings.

Update Profile 🔄

  • Update username, profile photo, email, and password.

Setting Up Your Local Environment

Follow these steps to set up your local environment for the Natours app:

  1. Clone the Repository: Clone this repository to your local machine:

    git clone https://github.com/AhmedSalman1/Natours.git
    cd natours
  2. Install Dependencies: Run the following command to install all the required dependencies:

    npm install
  3. 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:

    1. Create a .env File: In the root directory of the app, create a file named .env.

    2. 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
      

Installation

You can get the Natours app up and running on your local machine using the following steps:

  1. Fork or Git-clone:

    • You can fork the app on GitHub or git-clone it into your local machine.
  2. Install Dependencies and Set Environment Variables:

    $ npm i
    Set your env variables
    
  3. 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
    
  4. 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
    

Built With

  • 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.

Future Updates

  • Enable PWA
  • Improve overall UX/UI and fix bugs
  • Featured Tours
  • Recently Viewed Tours
  • And More! There's always room for improvement!

Acknowledgement

natours's People

Stargazers

Mahmoud Ammar avatar

Watchers

Ahmed Salman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.