Skip to content

bahjat9/Java-Project

Repository files navigation

Timeout Airline Booking System

Spring Boot web app for managing airline bookings.

Features

  • User, Plane, Airport, Flight management
  • Client and Employee management (linked to users)
  • Flight search by city and date
  • Booking system with seat validation
  • Miles reward system (discount code after 3 flights per year)

Tech Stack

  • Backend: Spring Boot 3.2.0, Spring Data JPA
  • Frontend: JavaScript, HTML, CSS
  • Database: H2
  • Build: Maven

Setup

  1. Build: mvn clean install
  2. Run: mvn spring-boot:run or java -jar target/airline-booking-system-1.0.0.jar
  3. Open: http://localhost:8080

Database is created automatically in ./data/airline.mv.db by Hibernate.

API Endpoints

Users

  • GET /api/users - Get all users
  • GET /api/users/{id} - Get user by ID
  • POST /api/users - Create user
  • PUT /api/users/{id} - Update user
  • DELETE /api/users/{id} - Delete user

Planes

  • GET /api/planes - Get all planes
  • GET /api/planes/{id} - Get plane by ID
  • POST /api/planes - Create plane
  • PUT /api/planes/{id} - Update plane
  • DELETE /api/planes/{id} - Delete plane

Airports

  • GET /api/airports - Get all airports
  • GET /api/airports/{id} - Get airport by ID
  • POST /api/airports - Create airport
  • PUT /api/airports/{id} - Update airport
  • DELETE /api/airports/{id} - Delete airport

Flights

  • GET /api/flights - Get all flights
  • GET /api/flights/{flightNumber} - Get flight by number
  • POST /api/flights - Create flight
  • PUT /api/flights/{flightNumber} - Update flight
  • DELETE /api/flights/{flightNumber} - Delete flight

Clients

  • GET /api/clients - Get all clients
  • GET /api/clients/{numPassport} - Get client by passport
  • POST /api/clients - Create client
  • PUT /api/clients/{numPassport} - Update client
  • DELETE /api/clients/{numPassport} - Delete client

Employees

  • GET /api/employees - Get all employees
  • GET /api/employees/{numEmp} - Get employee by number
  • POST /api/employees - Create employee
  • PUT /api/employees/{numEmp} - Update employee
  • DELETE /api/employees/{numEmp} - Delete employee

Search

  • GET /api/search/flights?departureCity={city}&arrivalCity={city}&departureDate={date} - Search flights

Bookings

  • POST /api/bookings - Create booking
  • GET /api/bookings/{id} - Get booking by ID
  • DELETE /api/bookings/{id} - Delete booking
  • GET /api/bookings/available-seats/{flightNumber} - Get available seats

Data Model

  • User: Basic user info (id, firstname, lastname, address, email, phone, birthdate)
  • Client: User + passport number
  • Employee: User + employee number, profession, title
  • Plane: Brand, model, manufacturing year
  • Airport: Name, country, city
  • Flight: Flight details with pricing for different seat classes
  • Book: Booking records
  • MilesReward: Tracks client flight history

Business Rules

  • Bookings only allowed if seats are available
  • Discount code generated after 3 flights in same year
  • Cascade deletes handle related data cleanup

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages