FlightSearchAPI is a Spring Boot application that provides an API for managing flight information.
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.
- 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.
- Java
- Spring Boot
- Spring Data JPA
- PostgreSQL
- Swagger
- OAuth2
-
Clone the Repository:
git clone https://github.com/berkinozturk/FlightSearchAPI.git
-
Database Configuration:
Configure your database settings in the application.properties file.
- Build and Run:
Build the project using Maven build tool. Run the application using your IDE or by executing the generated JAR file.
Once logged in with your Google account, you have two options to interact with the FlightSearchAPI:
After successful login:
- The application will redirect you to
http://localhost:<port>
(replace<port>
with your application's port number). - You can access the application's functionalities through the provided API endpoints.
- Refer to the documentation or API specifications for details on available endpoints.
Alternatively, you can access the Swagger UI to interact with the API endpoints:
- Open your browser and navigate to
http://localhost:<port>/swagger-ui.html
(replace<port>
with your application's port number). - This will open the Swagger UI interface, allowing you to explore and test the available endpoints interactively.
- 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.
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.
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
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.
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
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 |