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 = '[email protected]'

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

No packages published