This application provides a comprehensive API for various flight-related operations. It is designed to cater to both one-way and round-trip flight searches, along with the capability to add multiple flights to the database in bulk. A notable feature of this application is its integration with the Amadeus Database, allowing it to fetch real-time information about flights.
- One-way Flight Search: Enables users to search for single-leg flights based on specified criteria.
- Two-way Flight Search: Facilitates the search for round-trip flights, enhancing the user's convenience.
- Bulk Flight Addition: Offers the functionality to add a large number of flights to the database simultaneously, which is especially useful for administrative purposes.
- Real-time Flight Data: Directly connects to the Amadeus Database for accessing real-time flight information, ensuring up-to-date and accurate flight data.
- Programming Language: Java
- Framework: Spring Boot
- Database: Aerospike
- Authentication: JWT (JSON Web Tokens)
To set up and run the application, follow these steps:
-
Clone the Project: Begin by cloning the repository to your local machine.
-
Configure Application Properties: In the project, find the
application.properties
file and update it with the following configuration settings:For Aerospike database configuration, use these values:
aerospike.host.name=54f66803-a5ef-4328-a19d-af9caa028014.asdb.io aerospike.apiKeyId=6192fb7b629c4beab3305f3637dec96d aerospike.apiKeySecret=011c01efd55943e9a1893c4ffb79260c
For Amadeus security settings, use these values:
security.amadeus.clientId=ozH5U6xhACfGKJkF4n31xM2nKpATnrHt security.amadeus.clientSecret=sbzRL3i6A60why05
- The configuration values provided above are for demonstration purposes and can be invalid after sometime and btw they are not linked to personal accounts :D.
-
Build and Run the Application: Proceed with building and running the application
-
Explore and Test the APIs:
a. Using Swagger:
You can use Swagger to try out the APIs. To do so, follow these steps:
-
Obtain a JWT token by making a GET request to
{{base_url}}/jwt
. -
Use the obtained token to authenticate your requests while testing the APIs in Swagger.
b. Using Postman Collection:
Alternatively, you can use the provided Postman collection for convenience. Here's how:
-
Import the Amadeus.postman_collection.json file into Postman.
-
Trigger the GET JWT API. It is autoconfigured to generate and add the JWT token for the entire collection after successful execution.
-
Interact with the APIs :D
-
The APIs of this application are fully documented using Swagger, providing a clear and interactive interface for understanding and testing the available endpoints.
To access the API documentation, follow these steps:
-
Run the Application: Ensure that the application is running on your local machine or deployment server.
-
Access Swagger UI: Open a web browser and navigate to the Swagger UI using the following URL pattern: http://localhost:8080/swagger-ui/index.html
-
Implement CRUD APIs for the Airport Object:
- Develop and integrate APIs to perform Create, Read, Update, and Delete (CRUD) operations for the Airport object.
- Ensure these APIs are connected with the corresponding CRUD operations on the database, allowing for seamless data management.
-
Enable Logging:
- Implement logging throughout the application to capture critical information, errors, and operational data.
-
Exception Handling and Failure Management
-
Add JUnit Tests
-
Enhance Authentication Mechanism Using JWT:
-
Replace the current dummy token generation method with a more secure and standard approach that verifies user credentials before issuing a token.
-
Implement an in-memory check for user credentials, including username and password, to enhance authentication processes.
-