This is a RESTful API for a Tour Booking System built with Node.js, Express, and MongoDB. It allows users to explore tours, book them, leave reviews, and process payments via Stripe. The system includes JWT authentication, role-based access control, and error handling to ensure security and efficiency.
- User authentication (Signup/Login with JWT)
- Role-based access control (Admin, User, Guide)
- Tour management (CRUD operations)
- Booking system with Stripe Payment Integration
- Reviews & Ratings for tours
- Secure API with validation and error handling
git clone https://github.com/yourusername/nodejs-tour-booking.git
cd nodejs-tour-booking
npm install
Create a .env
file in the root directory and configure the following:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
npm run dev
npm start
POST /api/v1/auth/signup
- Register a new userPOST /api/v1/auth/login
- Login userGET /api/v1/tours
- Get all toursPOST /api/v1/tours
- Create a new tour (Admin only)POST /api/v1/bookings
- Book a tourPOST /api/v1/reviews
- Add a review
- Node.js, Express.js
- MongoDB, Mongoose
- JWT Authentication
- Stripe Payment Integration
- RESTful API Design
This project is licensed under the MIT License.
Made with ❤️ by [KrunalSavaj]