A full-stack tour booking system featuring a REST API and server-rendered web interface. Built with modern web development practices and enterprise-grade security.
- REST API with filtering, sorting, pagination, and aliasing
- Geospatial queries for tour location searches
- MongoDB Aggregation Pipeline for advanced analytics
- CRUD Operations with Mongoose ODM
- JWT Authentication System (User/Roles/Password Reset)
- Advanced Security: Rate limiting, XSS protection, CSRF tokens
- Stripe Integration for secure credit card processing
- Data Sanitization with express-mongo-sanitize and helmet
- File/Image Uploads with Multer
- Email Services (Mailtrap & Brevo integration)
- Railway Deployment Configuration
- Server-Side Rendering with Pug Templates
-
Clone repository:
git clone https://github.com/zeyadwaleed003/Natours
-
Initialize a Package.json File (if not already done):
npm init
-
Install dependencies:
npm install
-
Setting up env variables:
# Server Configuration NODE_ENV=development PORT=8000 # Database Configuration DATABASE=<your_mongo_db_URL> DATABASE_PASSWORD=<your_mongo_db_password> # Authentication JWT_SECRET=<your_jwt_secret_key> JWT_EXPIRES_IN=<JWT_expiration_date> JWT_COOKIE_EXPIRES_IN=<JWT_cookie_expiration_date> # Email Services ## Mailtrap (Development) MAILTRAP_HOST=<sandbox.smtp.mailtrap.io> MAILTRAP_PORT=587 MAILTRAP_USERNAME=<your_mailtrap_username> MAILTRAP_PASSWORD=<your_mailtrap_password> ## Brevo (Production) SENDINBLUE_HOST=<smtp-relay.brevo.com> SENDINBLUE_PORT=587 SENDINBLUE_USERNAME=<your_brevo_username> SENDINBLUE_PASSWORD=<your_brevo_api_key> # Payments STRIPE_SECRET_KEY=<your_stripe_secret_key> STRIPE_WEBHOOK_SECRET=<your_stripe_webhook_secret> # General Settings EMAIL_FROM=<your_sender_email>