This system automates the process of managing room reservations for a hotel or any accommodation. Users can view available rooms, check in/out, and book rooms, while administrators can manage room details, bookings, and user information.
- Room Availability Check: Users can view available rooms in real-time.
- Booking Management: Allows users to reserve rooms and view booking details.
- Admin Panel: Admins can manage rooms, check bookings, and update statuses.
- User Management: Users can create an account, manage reservations, and view booking history.
- Responsive UI: Works seamlessly across different devices.
Before running the system, ensure you have the following:
- Java Spring: For backend API development.
- Next.js: For creating the frontend.
- MySQL: For storing user data, room availability, and bookings.
- Node.js: Required to run the Next.js application.
- Install Spring Boot with dependencies like Spring Web, Spring Data JPA, and MySQL Driver.
- Create models for Room, Booking, and User.
- Set up JPA repositories for interacting with MySQL.
- Create services to manage bookings, room availability, and user authentication.
- Create REST controllers to expose endpoints for the frontend.
<h3>2. Set up the Frontend (Next.js)</h3>
<ol>
<li>Initialize a Next.js project.</li>
<li>Create pages for user registration, room booking, and admin management.</li>
<li>Integrate API calls with the backend using Axios or fetch.</li>
<li>Implement user authentication using JWT tokens.</li>
</ol>
<h3>3. Set up MySQL</h3>
<ol>
<li>Create a MySQL database to store tables for <strong>users</strong>, <strong>rooms</strong>, and <strong>bookings</strong>.</li>
<li>Ensure proper relationships between the tables for efficient data handling.</li>
</ol>
Once everything is set up, follow these steps to run the system:
- Start Backend: Run the Spring Boot application using the command
mvn spring-boot:run. - Start Frontend: Run the Next.js application using
npm run dev.
- Room Categories: Customize room categories (e.g., single, double, suite).
- Booking Duration: Allow users to select specific check-in and check-out dates.
- Payment Integration: Integrate with a payment gateway for booking payments.
- Database Connection: Verify MySQL is running and check connection details in
application.properties. - API Issues: Ensure that the Spring Boot application is running and API routes are correctly configured.
- Frontend Build Issues: Ensure Next.js is properly set up with React components and API routes.
We welcome contributions! Feel free to fork the repository, make changes, and submit a pull request for enhancements or bug fixes.
This project is licensed under the MIT License. You can freely use, modify, and distribute the code, as long as the license is included.
- Unsplash: For providing high-quality, free-to-use images for the website.
- Spring Boot: For being a powerful framework to build the backend.
- Next.js: For being a fast and efficient framework for the frontend.
- User authentication and role-based access
- Room listing and availability checking
- Booking creation, modification, and cancellation
- Admin dashboard for managing reservations
- REST API for frontend-backend communication
- Next.js (React Framework)
- Axios (API Requests)
- Tailwind CSS (Styling)
- Spring Boot (Java Framework)
- Spring Data JPA (Database Interaction)
- Spring Security (Authentication & Authorization)
- MySQL (Relational Database Management System)
- Node.js & npm installed
- Java 17+ installed
- MySQL Server running
git clone https://github.com/yourusername/room-reservation-system.git
cd room-reservation-system
cd backend
mvn clean install
mvn spring-boot:run
The backend will run on http://localhost:8080
cd frontend
npm install
npm run dev
The frontend will run on http://localhost:3000
- POST /api/auth/register – Register a new user
- POST /api/auth/login – Login and get JWT token
- GET /api/rooms – Get all available rooms
- POST /api/rooms – Add a new room (Admin only)
- POST /api/reservations – Create a new booking
- GET /api/reservations/{id} – Get reservation details
- DELETE /api/reservations/{id} – Cancel a reservation
- User Signup/Login – Users register and log in with JWT authentication.
- Book a Room – Users browse available rooms and make reservations.
- Admin Panel – Admin users can add, remove, or update room listings.
- Database Management – MySQL stores users, rooms, and reservations.
- Fork the repository
- Create a feature branch (
git checkout -b feature-xyz) - Commit your changes (
git commit -m "Added new feature") - Push to the branch (
git push origin feature-xyz) - Create a Pull Request
This project is licensed under the MIT License.
For any questions, reach out to your.email@example.com