Skip to content

yordan-gergov01/Natours

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Natours

Natours is a tour booking web application designed to provide users with a seamless experience in exploring and booking various tours. Built with Node.js, Express, MongoDB, and Mongoose, it offers robust functionality and performance while following the MVC (Model-View-Controller) architecture for better structure and maintainability.

Features

  • User Authentication and Authorization: Secure sign-up, login, and role-based access control.

  • Tour Management: Browse, search, and book tours with detailed information and pricing.

  • Booking System: Integrated booking process with payment handling via Stripe.

  • User Profiles: Manage personal information, view booking history, and update settings.

  • Secure API: Implemented best security practices to protect user data.

    Natours 1 Natours 2 Natours 3 Natours 4 Natours 5 Natours 6 Natours 7 Natours 8 Natours 9

Technologies Used

  • Backend: Node.js, Express.js
  • Database: MongoDB, Mongoose
  • Architecture: MVC (Model-View-Controller) pattern
  • Templating Engine: Pug
  • Payment Processing: Stripe
  • Authentication: JSON Web Tokens (JWT), bcrypt
  • Email Service: Nodemailer, SendGrid
  • Security: Helmet, xss-clean, express-rate-limit, mongo-sanitize
  • File Uploads: Multer, Sharp

Installation

  1. Clone the repository: git clone https://github.com/yordan-gergov01/Natours.git cd Natours

  2. Install Dependencies: npm install

  3. Environment Variables: Create a .env file in the root directory and add the following:

NODE_ENV=development

PORT=3000

DATABASE=Your MongoDB connection string

DATABASE_PASSWORD=Your MongoDB password

JWT_SECRET=Your JWT Secret

JWT_EXPIRES_IN=90d

JWT_COOKIE_EXPIRES_IN=90

EMAIL_USERNAME=Your Email username

EMAIL_PASSWORD=Your Email password

EMAIL_HOST=Your Email host

EMAIL_PORT=Your Email port

STRIPE_SECRET_KEY=Your Stripe secret key

STRIPE_WEBHOOK_SECRET=Your Stripe webhook secret

  1. Start the application

API Endpoints

Tours:

  • GET /api/v1/tours: Retrieve all tours
  • GET /api/v1/tours/:id: Retrieve a specific tour
  • POST /api/v1/tours: Create a new tour
  • PATCH /api/v1/tours/:id: Update an existing tour
  • DELETE /api/v1/tours/:id: Delete a tour

Users:

  • POST /api/v1/users/signup: User registration
  • POST /api/v1/users/login: User login
  • GET /api/v1/users/logout: User logout
  • GET /api/v1/users/me: Retrieve logged-in user's profile
  • PATCH /api/v1/users/updateMe: Update logged-in user's profile
  • DELETE /api/v1/users/deleteMe: Deactivate logged-in user's account

Bookings:

  • GET /api/v1/bookings: Retrieve all bookings
  • GET /api/v1/bookings/:id: Retrieve a specific booking
  • POST /api/v1/bookings: Create a new booking
  • PATCH /api/v1/bookings/:id: Update an existing booking
  • DELETE /api/v1/bookings/:id: Delete a booking

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published