Skip to content

MohammadShabib/Flight-Search-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flight Search API Application

Table of Contents

  1. Summary
  2. Key Features
  3. Technology Stack
  4. Getting Started
  5. API Documentation
  6. To Do

Summary

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.

Key Features

  1. One-way Flight Search: Enables users to search for single-leg flights based on specified criteria.
  2. Two-way Flight Search: Facilitates the search for round-trip flights, enhancing the user's convenience.
  3. Bulk Flight Addition: Offers the functionality to add a large number of flights to the database simultaneously, which is especially useful for administrative purposes.
  4. Real-time Flight Data: Directly connects to the Amadeus Database for accessing real-time flight information, ensuring up-to-date and accurate flight data.

Technology Stack

  • Programming Language: Java
  • Framework: Spring Boot
  • Database: Aerospike
  • Authentication: JWT (JSON Web Tokens)

Getting Started

To set up and run the application, follow these steps:

  1. Clone the Project: Begin by cloning the repository to your local machine.

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

    Important Note:

    • 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.
  3. Build and Run the Application: Proceed with building and running the application

  4. Explore and Test the APIs:

    a. Using Swagger:

    You can use Swagger to try out the APIs. To do so, follow these steps:

    1. Obtain a JWT token by making a GET request to {{base_url}}/jwt.

    2. 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:

    1. Import the Amadeus.postman_collection.json file into Postman.

    2. Trigger the GET JWT API. It is autoconfigured to generate and add the JWT token for the entire collection after successful execution.

    3. Interact with the APIs :D

API Documentation

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:

  1. Run the Application: Ensure that the application is running on your local machine or deployment server.

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

Amadeus Database Search OneWay JWT Authentication png Local Database Search OneWay Add Flights Local Database Search TwoWay

To Do

  1. 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.
  2. Enable Logging:

    • Implement logging throughout the application to capture critical information, errors, and operational data.
  3. Exception Handling and Failure Management

  4. Add JUnit Tests

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages