Skip to content

Latest commit

 

History

History
161 lines (115 loc) · 4.98 KB

README.md

File metadata and controls

161 lines (115 loc) · 4.98 KB

Flight Search API

FlightSearchAPI is a Spring Boot application that provides an API for managing flight information.

Table of Contents

Introduction

FlightSearchAPI is designed to handle various operations related to flights, including CRUD functionalities (Create, Read, Update, Delete) and searching for flights based on different criteria such as departure airport, arrival airport, and date/time.

Features

  • CRUD Operations: Perform basic CRUD operations on flight entities.
  • Flight Search: Search for flights based on departure airport, arrival airport, and date/time criteria.
  • API Endpoints: Provides RESTful API endpoints for interacting with flight data.

Technologies Used

  • Java
  • Spring Boot
  • Spring Data JPA
  • PostgreSQL
  • Swagger
  • OAuth2

Setup

  1. Clone the Repository:

    git clone https://github.com/berkinozturk/FlightSearchAPI.git
    
    
  2. Database Configuration:

Configure your database settings in the application.properties file.

  1. Build and Run:

Build the project using Maven build tool. Run the application using your IDE or by executing the generated JAR file.

After Logging In with Google Account

Once logged in with your Google account, you have two options to interact with the FlightSearchAPI:

Option 1: Localhost Redirect

After successful login:

  1. The application will redirect you to http://localhost:<port> (replace <port> with your application's port number).
  2. You can access the application's functionalities through the provided API endpoints.
  3. Refer to the documentation or API specifications for details on available endpoints.

Option 2: Swagger UI

Alternatively, you can access the Swagger UI to interact with the API endpoints:

  1. Open your browser and navigate to http://localhost:<port>/swagger-ui.html (replace <port> with your application's port number).
  2. This will open the Swagger UI interface, allowing you to explore and test the available endpoints interactively.
  3. Use the Swagger UI to execute requests, view responses, and understand the API's capabilities.

Choose the option that best suits your needs to interact with the FlightSearchAPI after logging in with your Google account.

Configuring PostgreSQL and Port Information

In order to connect and run the FlightSearchAPI successfully, ensure that you have configured the PostgreSQL database settings and specified the port information in the application.properties file.

PostgreSQL Configuration

Edit the application.properties file and provide the necessary PostgreSQL connection details:


spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=1234

Port Information

Specify the port information for running the FlightSearchAPI:


server.port=your_desired_port_number

Replace your_desired_port_number with the port number you want to use for running the FlightSearchAPI locally (e.g., 8080, 9090, etc.).

Save the changes made to the application.properties file to ensure proper database connectivity and application execution.

Usage

Once the application is up and running, you can interact with it using the provided API endpoints. Here are some examples:

  • Retrieve all flights: GET /flights
  • Retrieve a specific flight by ID: GET /flights/{id}
  • Create a new flight: POST /flights
  • Update an existing flight: PUT /flights/{id}
  • Delete a flight: DELETE /flights/{id}
  • Search for flights based on criteria: GET /flights/search

Endpoints

Endpoint Description Request Type
GET /flights Retrieve all flights GET
GET /flights/{id} Retrieve a specific flight by ID GET
POST /flights Create a new flight POST
PUT /flights/{id} Update an existing flight PUT
DELETE /flights/{id} Delete a flight DELETE
GET /flights/search Search for flights based on criteria GET

Sample Images

Get By ID for flights Get All Airports