Skip to content

noodkhan/SpringBoot-NextJS-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Room Reservation System Room Reservation Badge

Overview Overview Sticker

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.

Features Features Sticker

  • 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.

Requirements Requirements Sticker

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.

Setup Instructions Setup Sticker

1. Set up the Backend (Java Spring)

  1. Install Spring Boot with dependencies like Spring Web, Spring Data JPA, and MySQL Driver.
  2. Create models for Room, Booking, and User.
  3. Set up JPA repositories for interacting with MySQL.
  4. Create services to manage bookings, room availability, and user authentication.
  5. 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>

Usage Instructions Usage Sticker

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.

Customization Options Customization Sticker

  • 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.

Troubleshooting Troubleshooting Sticker

  • 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.

Contributing Contributing Sticker

We welcome contributions! Feel free to fork the repository, make changes, and submit a pull request for enhancements or bug fixes.

License License Sticker

This project is licensed under the MIT License. You can freely use, modify, and distribute the code, as long as the license is included.

Acknowledgments Acknowledgments Sticker

  • 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.

Features

  • 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

Tech Stack

Frontend:

  • Next.js (React Framework)
  • Axios (API Requests)
  • Tailwind CSS (Styling)

Backend:

  • Spring Boot (Java Framework)
  • Spring Data JPA (Database Interaction)
  • Spring Security (Authentication & Authorization)

Database:

  • MySQL (Relational Database Management System)

Installation & Setup

Prerequisites

  • Node.js & npm installed
  • Java 17+ installed
  • MySQL Server running

1. Clone the Repository

    
        git clone https://github.com/yourusername/room-reservation-system.git
        cd room-reservation-system
    

2. Setup Backend (Spring Boot)

    
        cd backend
        mvn clean install
        mvn spring-boot:run
    

The backend will run on http://localhost:8080

3. Setup Frontend (Next.js)

    
        cd frontend
        npm install
        npm run dev
    

The frontend will run on http://localhost:3000

API Endpoints

Authentication

  • POST /api/auth/register – Register a new user
  • POST /api/auth/login – Login and get JWT token

Rooms

  • GET /api/rooms – Get all available rooms
  • POST /api/rooms – Add a new room (Admin only)

Reservations

  • POST /api/reservations – Create a new booking
  • GET /api/reservations/{id} – Get reservation details
  • DELETE /api/reservations/{id} – Cancel a reservation

How It Works

  1. User Signup/Login – Users register and log in with JWT authentication.
  2. Book a Room – Users browse available rooms and make reservations.
  3. Admin Panel – Admin users can add, remove, or update room listings.
  4. Database Management – MySQL stores users, rooms, and reservations.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-xyz)
  3. Commit your changes (git commit -m "Added new feature")
  4. Push to the branch (git push origin feature-xyz)
  5. Create a Pull Request

License

This project is licensed under the MIT License.

Contact

For any questions, reach out to your.email@example.com

About

Java Spring Boot Backend + Next JS Frontend + MySQL Database OOP Final Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published