A dynamic tour booking platform built with NodeJS, Express, and MongoDB. It delivers a seamless travel planning experience with secure authentication, advanced tour filtering, interactive maps, and streamlined booking processes. Explore the power of modern web technologies in this production-ready API.
Experience Natours live: Natours Live Demo
For complete API documentation, visit: Natours API Documentation
- User Authentication: Secure login/signup using JWT.
- Role-based Access Control: Different roles for Admin, User, and Guide.
- Tour Management: Create, update, delete, and list tours.
- Advanced Querying: Filtering, sorting, and pagination of tours.
- Booking System: Secure bookings and payment integration.
- Robust Security: Helmet, data sanitization, rate limiting, and CORS.
- Responsive API: Fast and efficient API endpoints.
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Templating Engine: Pug
- Bundler: Parcel
- Authentication: JSON Web Tokens (JWT), bcrypt
- Security: Helmet, CORS, Express-rate-limit
- Payment Integration: Stripe
- Other Tools:
- Mailtrap: For email testing
- SendGrid: For email delivery
- Leaflet: For interactive maps
- Postman: For API testing
- Render: For Deployment
- Create an account or login (username: john@example.com, password: test1234)
- Browse available tours
- Select a tour and click "Book Tour"
- Complete payment with test credit card:
Card Number: 4242 4242 4242 4242 Expiry Date: Any future date (MM/YY) CVC: Any 3 digits - View your booked tour in your user dashboard
- Update your profile picture, name, and email
- Change your password
- View your booked tours
-
Clone the Repository:
git clone https://github.com/yourusername/Natours.git cd Natours -
Install Dependencies:
npm install
-
Set up Environment Variables:
- Copy
sampleConfig.envtoconfig.envand configure it with your settings.
- Copy
-
Run the Application:
npm run dev
For production:
npm run build:js npm run start:prod
The Natours API provides programmatic access to tours, users, reviews, and bookings.
GET /api/v1/tours - List all tours
GET /api/v1/tours/:id - Get specific tour
GET /api/v1/tours/top-5-cheap - Top 5 affordable tours
GET /api/v1/tours/tours-within/:distance/center/:latlng/unit/:unit - Find tours within radius
POST /api/v1/users/signup - Create new user
POST /api/v1/users/login - Login user
All protected routes require a Bearer Token obtained after logging in:
- Sign up or log in to receive a token.
- Include the token in the
Authorizationheader for protected routes.
Authorization: Bearer <your_token>For complete API documentation, visit: Natours API Documentation
- User Reviews & Ratings: Allow users to leave feedback on tours.
- Dark Mode: Allow users choose between light and dark mode.
- Enhanced Payment Integration: Expand support for more payment gateways.
- Real-Time Notifications: Integrate WebSocket for real-time updates.
- Mobile App Integration: Build a companion mobile app.
- This project is inspired by Jonas Schmedtmann’s Udemy course - Node.js, Express, MongoDB & More: The Complete Bootcamp.
- Logo and design elements from the original course materials.
This project is licensed under the MIT License.
Feel free to modify and enhance this project as needed!





