Skip to content

Priya-creates/Natours

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 Natours – Full-Stack Tour Booking Web Application Natours is a feature-rich tour booking web application built using MVC architecture. It allows users to explore various tours, register securely, and book their favorite packages with ease.

⚡️ Tech Stack 🎨 Frontend: HTML, CSS, JavaScript

⚡ Backend: Node.js, Express.js

🗄️ Database: MongoDB, Compass, Mongoose

🚀 Key Features ✅ Explore and browse available tour packages ✅ Secure user registration, login, and authentication (JWT) ✅ CRUD operations for managing tours and users ✅ MongoDB integration with Mongoose for efficient data handling ✅ MVC pattern for clean and scalable code ✅ Payment integration with Razorpay for smooth checkout

📡 Database Management MongoDB Atlas: For cloud-based data storage

MongoDB Compass: For local data visualization and management

🛠️ Installation & Setup Follow these steps to run the project locally:

  1. Clone the Repository git clone https://github.com/your-username/natours.git

  2. Navigate to Project Directory cd natours

  3. Install Dependencies npm install

  4. Set Up Environment Variables Create a .env file in the root directory and add the following: NODE_ENV = 'development' # or 'production' USER = 'your_name_here'

MongoDB Connection

DATABASE = 'mongodb+srv://:@cluster.mongodb.net/natours' DATABASE_LOCAL = 'mongodb://localhost:27017/natours'

JWT Configuration

JWT_SECRET = 'your_jwt_secret' JWT_EXPIRES_IN = '90d' JWT_COOKIE_EXPIRES_IN = '30d'

Mailtrap Credentials for Development

EMAIL_USERNAME = 'your_mailtrap_username' EMAIL_PASSWORD = 'your_mailtrap_password' EMAIL_HOST = 'smtp.mailtrap.io' EMAIL_PORT = '2525'

Brevo (SendinBlue) Credentials for Production

PROD_EMAIL_USERNAME = 'your_brevo_email_username' PROD_EMAIL_PASSWORD = 'your_brevo_password'

EMAIL_FROM = 'your_email@example.com'

Razorpay API Keys

RAZORPAY_KEY_ID = 'your_razorpay_key_id' RAZORPAY_KEY_SECRET = 'your_razorpay_secret_key'

⚠️ Note: Never commit your .env file to GitHub! Add it to .gitignore

Ignore environment files

.env

  1. Start the Server

For development

npm run start

For production

npm run start:prod

  1. Open the App in Your Browser http://localhost:3000

📧 Email Configuration Development: Mailtrap SMTP for testing email services. Production: Brevo (SendinBlue) SMTP for sending real emails.

Booking Routes: POST /api/v1/bookings/checkout-session/:tourId – Payment via Razorpay

📝 Important Notes ✅ Security: Add .env to .gitignore to avoid pushing sensitive data. ✅ Payment Gateway: Razorpay API keys should be securely stored.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors