A full-stack hotel booking web application built with the MERN stack (MongoDB, Express.js, React, Node.js). This platform allows users to search for hotels, view hotel details, make bookings, and manage their own hotel listings.
- User Authentication: Secure user registration and login functionality
- Search Hotels: Search for hotels with various filters and criteria
- View Hotels: Browse and view detailed information about available hotels
- Add Hotels: Hotel owners can add and manage their hotel listings
- Book Hotels: Users can make bookings for available hotels
- Payment Integration: Integrated with Stripe for secure payment processing
- React - UI library for building user interfaces
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Tanstack Query - Data fetching and state management
- Context API - For client side state management
- React Hook Form - Form validation and handling
- Node.js - JavaScript runtime
- Express.js - Web application framework
- TypeScript - Type-safe JavaScript
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens for authentication
- AWS S3 Bucket - Image upload handling
- Stripe - Payment processing
- Playwright - End-to-end testing
Create .env files in the backend directory with the following variables:
JWT_SECRET=****
MONGODB_URI=****
S3_ACCESS_KEY=****
S3_BUCKET_NAME=****
S3_REGION=****
S3_SECRET_KEY=****
STRIPE_API_KEY=****
FRONTEND_URL=****
PORT=****
NODE_ENV=****- Clone the repository:
git clone https://github.com/NoorFatima01/hotel-booking-website.git
cd hotel-booking-website- Install backend dependencies:
cd backend
npm install- Install frontend dependencies:
cd ../frontend
npm install- Start the backend server:
cd backend
npm run dev- Start the frontend development server:
cd frontend
npm run dev- Open your browser and navigate to
http://localhost:5173
- Build the backend:
cd backend
npm run build- Build the frontend:
cd frontend
npm run buildRun end-to-end tests:
cd e2etests
npx playwright testThe backend provides the following main API routes:
/api/auth- Authentication endpoints (login, register, logout)/api/users- User management/api/my-hotels- Hotel management for owners/api/hotels- Public hotel browsing and booking