Welcome to LuxStay! 🌟
This is a complete implementation of a modern Hotel Booking Application. Whether you are a developer looking for code reference or a user wanting to see a beautiful booking site, you are in the right place.
We built this key question in mind: "How can we make booking a hotel room as smooth and beautiful as possible?"
(Detailed screenshots available below)
- 🌟 What Can You Do Here?
- 🚀 The Easiest Way to Run This (For Beginners)
- 💻 For Developers (Manual Setup)
- 📖 Step-by-Step User Guide
- ❓ Troubleshooting Profile
For Users:
- Browse Hotels: Explore a curated list of luxury hotels with beautiful images and prices.
- Search & Filter: Find exactly what you want by filtering by city or price.
- Sign Up/Login: Create your secure account or just click "Login with GitHub" for instant access.
- Book a Room: distinct dates, check availability, and "pay" (simulation) for your stay.
- Manage Bookings: View all your past and upcoming trips in your dashboard.
For Developers:
- See how Java Spring Boot (Backend) talks to React (Frontend).
- Learn how Docker containers work together.
- Understand OAuth2 (Social Login) and JWT (Security).
If you don't want to install Java, Maven, Node.js, and everything else manually, use Docker. It bundles everything into a "box" that just runs.
- Docker Desktop: Download and install it from docker.com.
- Tip: After installing, open the "Docker Desktop" app and make sure it is running.
-
Download the Code
- Click the green "Code" button above and select "Download ZIP", then unzip it.
- OR run in terminal:
git clone https://github.com/imrajeevnayan/hotel-booking.git
-
Open Terminal
- Go to the folder where you downloaded the project.
-
Setup Configuration (Important!)
- Creates a file named
.env. - Open
.env.example, copy everything, and paste it into your new.envfile. - Crucial: You need to fill in
GITHUB_CLIENT_IDandRAZORPAY_KEYfor those specific features to work. (You can leave them blank if you just want to browse hotels, but login might fail).
- Creates a file named
-
Run One Command
docker-compose up --build
- This will take a few minutes the first time as it downloads all the necessary tools.
-
Visit the App!
- Frontend (The Website): Open http://localhost:3000
- Backend (The Server): Open http://localhost:8080
If you want to modify the code, you should run the services individually.
- Location:
./backendfolder. - Tech: Java 25, Spring Boot.
- Run:
cd backend mvn spring-boot:run - Read detailed Backend Guide
- Location:
./frontendfolder. - Tech: React, Vite.
- Run:
cd frontend npm install npm run dev - Read detailed Frontend Guide
So the app is running. Now what?
- Click the "Login" button in the top right.
- Option A: Enter an email and password to create a new account.
- Option B (Easier): Click "Continue with GitHub".
- On the Home page, scroll down to see "Featured Hotels".
- Click on any hotel card to specific details (Amenities, Map, Rooms).
- On the Hotel Details page, you will see a "Book Now" section.
- Select your Check-in and Check-out dates.
- Select the number of guests.
- Click "Reserve".
- Note: If you are not logged in, it will ask you to login first.
- You will see a Razorpay payment popup.
- Since this is a test mode, you can use any dummy card details provided by Razorpay documentation, or just close the popup (depending on config) to simulate a transaction.
- Click your profile icon in the top right -> "My Bookings".
- You will see your reservation there!
"Port 8080 is already in use"
- This means another program is using the port our backend needs.
- Fix: Close the other program or restart your computer.
"Connection Refused"
- The frontend cannot talk to the backend.
- Fix: Make sure the backend terminal says "Started HotelBookingApplication".
"Login Failed"
- Did you set up the
.envfile? - Check if your Database password in
.envmatches your local PostgreSQL password.
Docker Error: KeyError: 'ContainerConfig'
- This happens when docker-compose cannot read the state of an existing container (common with older versions).
- Fix: Run the helper script
./fix_docker.shOR manually run:docker rm -f hotel-booking_backend_1 docker-compose up --build
Built with ❤️ by Rajeev Nayan