Code Monkey home page Code Monkey logo

mahmoud-aboudeghedy / tour-booking-app Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 87.7 MB

Natours is a full-stack project for a tour booking company. It features CRUD operations for tours, reviews, users, and bookings, user authentication, password encryption and reset, image processing, payment processing, error handling, and more. The project uses Node.js, Express, MongoDB, JWT, Stripe, Mapbox, Pug, and other technologies.

Home Page: https://natours-deghedy.cyclic.app/

JavaScript 85.16% Pug 5.72% CSS 4.04% HTML 5.08%
css express mailtrap mapbox mongodb mongoose nodejs pug sendinblue cloudinary cyclic jwt multer postman sharp stripe

tour-booking-app's Introduction

Natours

This is a full-stack project for a fictional tour booking company called Natours.

Getting Started

To get started with the project, clone the repository to your local machine and install the dependencies:

git clone https://github.com/Mahmoud-AbouDeghedy/natours.git

cd natours

npm install

To start the server, run:

npm start or npm run start:dev for development mode or npm run start:prod for production mode

this will start the server on http://localhost:3000

The server will listen on port 3000 by default. You can also access the API at http://localhost:3000/api/v1.

You can test with some test user-emails stored on the database like: "[email protected]", "[email protected]" with a password of "test1234", or you can create a new user.

Features and Functionality

The Natours project includes the following features:

  • CRUD operations for tours, reviews, users, and bookings through a handler factory class that supports advanced fetures like: filtering, sorting, pagination, and field limiting
  • Using aggregate functions to calculate tour statistics
  • Geospatial querying for finding tours within a certain radius of a given location
  • User authentication and authorization using JWT tokens
  • Password encryption using the bcrypt library
  • Password reset functionality using JWT tokens
  • Handling of user roles and permissions
  • Handling forgetting and resetting user passwords
  • Specifying 2 special routes for updating either the current user's data or password
  • Sending real emails for new signUps and resetting passwords to users using the SendinBlue API and the Mailtrap service
  • Ability to get all reviews and create new reviews for a specific tour (nested routes)
  • Ability to make new bookings through Stripe checkout sessions
  • Using Stripe webhooks to handle asynchronous payment events to update booking statuses and protect against fraud
  • Sophisticated handling of errors and exceptions using global error middleware and error controller in both development and production environments
  • Catching errors in asynchronous functions using the catchAsync utility function
  • Handling all unhandled rejections and uncaught exceptions
  • Image upload and processing using the Cloudinary API, Multer and sharp packages
  • Implementing advanced security measures like rate limiting and data sanitization to prevent security vulnerabilities
  • Integration with the Mapbox API for displaying tour locations on a map
  • Use of the MVC (Model-View-Controller) architecture pattern to organize the project's code
  • Use of the Pug template engine to render HTML templates on the server
  • Use of the Parcel bundler to bundle the project's JavaScript files
  • Use of the ESLint linter to maintain a consistent code style
  • Use of the Prettier code formatter to maintain a consistent code style
  • Deployment of the project to Cyclic hosting platform
  • Enable CORS (Cross-Origin Resource Sharing) to allow requests from other domains
  • Some api documentation using postman https://web.postman.co/workspace/My-Workspace~0bcab44a-ec2c-465b-8616-4525188fbc69/documentation/18406472-8fb758cf-0036-4233-9dfe-1cef379458e3

Technologies Used

  • Node.js: a server-side JavaScript runtime environment for building scalable and efficient network applications
  • Express: a popular Node.js web application framework for building APIs and web applications
  • MongoDB: a popular NoSQL database for storing and querying large volumes of unstructured data
  • Mongoose: an Object Data Modeling (ODM) library for MongoDB and Node.js that provides a more intuitive way to interact with MongoDB
  • JWT: a widely-used standard for representing and transmitting secure authentication and authorization information
  • Stripe: a payment processing platform for securely processing credit and debit card payments
  • Mailtrap: an email testing service that helps developers test email notifications without sending them to real users
  • Mapbox: a popular location data platform for building location-based applications and services
  • Pug: a template engine for Node.js that makes it easy to create HTML templates with JavaScript
  • SendInBlue: a transactional email service for sending emails to real users
  • CSS: a style sheet language used for describing the presentation of a document written in a markup language such as HTML
  • Multer: a Node.js middleware for handling multipart/form-data, which is primarily used for uploading files
  • Sharp: a Node.js image processing library for resizing and optimizing images
  • cloudinary: a cloud service that offers a solution to a web application's entire image management pipeline
  • Prettier: an opinionated code formatter that helps maintain consistent code style across the entire project
  • ESLint: a popular JavaScript linter for identifying and reporting on patterns found in JavaScript code
  • parcel: a web application bundler for JavaScript and CSS

tour-booking-app's People

Contributors

mahmoud-aboudeghedy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.